English 中文(简体)
umber、铁路和届会变量
原标题:cucumber, rails and session variables

I m 执行两个步骤标志。 第一步,用户必须进入电子邮件+密码。 如果正确的话,便会产生随机铺设,储存在会议中,并寄给账户持有人移动电话。

我想知道,如何从我的步骤定义中获取届会的变量,或者如何以其他方式捕获随机标示,以便我能够以表格的形式加以填补,从而测试整个标识,因为用户将使用。 护卫并不储存在模型中,因为它只是临时性的。

Thanks, Corin

最佳回答

图二 显示的发电机返回固定体。

问题回答

我通过篡改员工和管理当局协调会解决了这一问题。 我的特稿/文稿:

require  cucumber/rspec/doubles 

...

Before do |scenario|
  @smsgateway_sent_text_messages = []
  SMSGateway.stub(:send_text_message) do |message, phone_number|
    @smsgateway_sent_text_messages << {
      :phone_number => phone_number,
      :message => message,
    }
  end
end




相关问题
Pass session data onto URL

I have some information that is set in the sessions, and I was wondering if it s possible to pass this info onto the URL for the view that uses this session data. I want this to be working in such a ...

Session Variables, Hidden Fields and Tables

Ok, would this work? When a user logins a session variable is created. Then using the session variable I am able to put into a hidden field the correct user s ID number. The hidden field is in a ...

php - transfer $_SESSION var s to local var s?

What is best practice with regards to using session variables? Is it best to just refer to them as session variables or is it better at the beginning of the script to transfer them to local variables ...

Get session variable value

After I set a session object, how can I access the value of the given object in my templates?

invalid sharepoint session objects

Ok I m new to SharePoint and ASP, so bear with me... I want to persist objects to the session array for maintaining stuff between postbacks. I enabled the session array in my web.config file, and ...

.NET HttpSessionState Case Insensitivity

.NET s HttpSessionState using an "InProc" store seems to treat session variable key values as case insensitive. For example: session["foo"] = 1; session["Foo"] = 2; Trace.Write(session["foo"]....

热门标签