自動ロジックのログイン動作を実装するために、きゅうりを使用して BDD 手順を実行しています。
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 でデバッグしましたが、Web ページが表示されたときにメッセージはありませんが、開発モードでスクリプト/サーバーを実行するとメッセージが表示されます。私のコントローラは次のようになります
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 ***
アクションメーラー (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)
データベースクリーナー (0.5.2)
declarative_authorization (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)
のこぎり (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 レール (1.3.2)
構文 (1.0.0)
用語 - ansicolor (1.0.5)
thinkbot-factory_girl (1.2.2)
トロロップ (1.16.2)
ウェブラット (0.7.1)
ruby 1.8.7 (2010-01-10 パッチレベル 249) [i486-linux] Ubuntu で動作する gem 1.3.7
きゅうりの歩みを通すにはどうしたらいいですか!
助けてくれてありがとう