我正在用黄瓜运行 BDD 步骤来实现我的 autlogic 登录行为。
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"
这是我的场景,当我击中
Then I should see "Login successful!"
我的黄瓜步骤失败了,但只在 webrat 中。我用launchy进行了调试,当网页出现时确实没有消息,但在开发模式下,当我运行脚本/服务器时,我看到了我的消息。我的控制器看起来像这样
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 并且不明白这对我有什么帮助,这也没有帮助
Rails/Cucumber/Webrat:redirect_to,flash[:notice] 不工作
我的设置是
*** LOCAL GEMS ***
actionmailer (2.3.8)
动作包 (2.3.8)
活动记录(2.3.8)
主动资源(2.3.8)
主动支持 (2.3.8)
授权逻辑(2.1.5)
建设者(2.1.2)
配置 (1.1.0)
黄瓜 (0.8.4, 0.8.3)
黄瓜导轨 (0.3.2)
database_cleaner (0.5.2)
声明性授权(0.4.1)
diff-lcs (1.1.2)
小黄瓜 (2.1.2, 2.0.2)
json_pure (1.4.3)
发射 (0.3.5)
mysql (2.8.1)
nokogiri (1.4.2)
回形针 (2.3.3)
泡菜(0.3.0)
机架(1.2.1、1.1.0)
机架测试(0.5.4)
导轨 (2.3.8)
耙子 (0.8.7)
rspec (1.3.0)
rspec-rails (1.3.2)
语法 (1.0.0)
术语 ansicolor (1.0.5)
思想机器人工厂女孩 (1.2.2)
巨魔(1.16.2)
韦拉特 (0.7.1)
ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux] gem 1.3.7 在 Ubuntu 上运行
我该怎么做才能让我的黄瓜步骤通过!
谢谢你的帮助