次の統合テストがあります。フォーム上にフォームをロードします。送信ボタンがデータなしで押されると、フォームにエラーボックスが表示されます。フォームはajaxで送信され、エラーが発生したページにフォームを戻す必要があります。NOOBセレンrspecテストが通過しない
これはブラウザで見ることができますが、テストは失敗します。
私は間違っていますか?私は完全なNOOBですので、いくつかのガイダンスが必要です。
は 'spec_helperは、' 私はそれを考え出した "RubyGemsの"
describe "Boards" do
describe "board creation failure" do
attr_reader :selenium_driver
alias :page :selenium_driver
before(:all) do
@verification_errors = []
@selenium_driver = Selenium::Client::Driver.new \
:host => "localhost",
:port => 4444,
:browser => "*chrome",
:url => "http://localhost:3000/",
:timeout_in_second => 60
end
before(:each) do
@selenium_driver.start_new_browser_session
end
after(:each) do
@selenium_driver.close_current_browser_session
@verification_errors.should == []
end
it "should show the error explanation div" do
page.open "/"
page.click "board_submit"
page.is_element_present("error_explanation").should be_true #should show error box
end
end