authlogic flash[:notice] 没有出现在黄瓜 webrat 步骤中出现在、黄瓜、步骤、flash

由网友(给你邮寄月亮)分享简介:我正在使用 cucumber 运行 BDD 步骤来实现我的 autlogic 登录行为.I am running BDD steps with cucumber to implement my autlogic login behavior.Scenario: log inGiven a registered us...

我正在使用 cucumber 运行 BDD 步骤来实现我的 autlogic 登录行为.

I am running BDD steps with cucumber to implement my autlogic login behavior.

 Scenario: log in
Given a registered user: "test@test.com" with password: "p@ssword" exists
And I am on the homepage
When I follow "Log in"
And I fill in "Username" with "test@test.com"
And I fill in "Password" with "p@ssword"
And I open the page
And I press "Login"
And I open the page
Then I should see "Login successful!"
And I should see "Logout"

这是我的场景,当我点击时

this is my scenario and when I hit

Then I should see "Login successful!"

我的黄瓜步骤失败了,但仅限于 webrat.我用launchy进行了调试,当网页出现时确实没有消息,但在开发模式下,当我运行脚本/服务器时,我看到了我的消息.我的控制器是这样的

my cucumber step fails but only in webrat. I debugged with launchy and when the web-page appeard there is indeed no message but in development mode, when I run script/server I see my messages. My controller looks like this

 def create
@user_session = UserSession.new(params[:user_session])
  if @user_session.save
    flash[:notice] = "Login successful!"
   redirect_to root_url
  else
    render :action => 'new'
  end

结束

是的,我看到了这个http://github.com/binarylogic/authlogic/issuesearch?state=open&q=cucumber+flash#issue/142并且不明白这对我有什么帮助这也没有帮助

And yes I saw this http://github.com/binarylogic/authlogic/issuesearch?state=open&q=cucumber+flash#issue/142 and did not understand how this could help me and this also did not help

Rails/Cucumber/Webrat:redirect_to,flash[:notice]不工作

我的设置是

*** LOCAL GEMS ***

actionmailer (2.3.8)

actionmailer (2.3.8)

动作包 (2.3.8)

actionpack (2.3.8)

活动记录(2.3.8)

activerecord (2.3.8)

活动资源(2.3.8)

activeresource (2.3.8)

主动支持 (2.3.8)

activesupport (2.3.8)

authlogic (2.1.5)

authlogic (2.1.5)

建造者(2.1.2)

配置(1.1.0)

黄瓜 (0.8.4, 0.8.3)

cucumber (0.8.4, 0.8.3)

黄瓜导轨 (0.3.2)

cucumber-rails (0.3.2)

database_cleaner (0.5.2)

database_cleaner (0.5.2)

declarative_authorization (0.4.1)

declarative_authorization (0.4.1)

diff-lcs (1.1.2)

diff-lcs (1.1.2)

小黄瓜(2.1.2、2.0.2)

gherkin (2.1.2, 2.0.2)

json_pure (1.4.3)

json_pure (1.4.3)

启动 (0.3.5)

mysql (2.8.1)

mysql (2.8.1)

nokogiri (1.4.2)

nokogiri (1.4.2)

回形针 (2.3.3)

paperclip (2.3.3)

泡菜(0.3.0)

机架(1.2.1、1.1.0)

rack (1.2.1, 1.1.0)

机架测试 (0.5.4)

rack-test (0.5.4)

导轨 (2.3.8)

耙子 (0.8.7)

rspec (1.3.0)

rspec (1.3.0)

rspec-rails (1.3.2)

rspec-rails (1.3.2)

语法 (1.0.0)

term-ansicolor (1.0.5)

term-ansicolor (1.0.5)

thoughtbot-factory_girl (1.2.2)

thoughtbot-factory_girl (1.2.2)

巨魔 (1.16.2)

trollop (1.16.2)

webrat (0.7.1)

webrat (0.7.1)

ruby 1.8.7 (2010-01-10 补丁级别 249) [i486-linux]宝石 1.3.7在 Ubuntu 上运行

ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux] gem 1.3.7 running on Ubuntu

我该怎么做才能让我的黄瓜步骤通过!

What can I do to make my cucumber steps pass!

感谢您的帮助

推荐答案

感谢 raynb 为我指明了正确的方向.但不幸的是,这个解决方案不起作用,但我发现这个页面将所有内容都放在 cucumber.rb 中......这让它现在运行很疯狂......

thanks to raynb who pointed me into the right direction. But unfurtunatly this solution did not work but I found this page which puts everything in cucumber.rb... which mad it running now ...

https://webrat.lighthouseapp.com/projects/10503-webrat/tickets/383-reset_session-and-webrat-dont-play-nicely-with-one-another

阅读全文

相关推荐

最新文章