我有以下測試,可以在Rack :: Test中使用但不使用Selenium。即如果我添加, js: true
的描述塊,我得到在Firefox的錯誤消息說,它couldn't find the License with id=
(的@l
的ID)不使用Selenium保存模型,但使用Rack保存:測試
describe "should hide allocation rule # for pdf & clickthrough licenses" do
it "reads current state and shows/hides fields appropriately" do
@l = FactoryGirl.create(:license:,
way: License::CLICK_WAY)
visit edit_admin_license_path(@l)
end
end
爲什麼?我必須缺少東西。我可以使用Sequel Pro驗證在使用js: true
時記錄沒有保存。
我需要此規範在Selenium中運行,因爲我有javascript來測試。
嘗試檢查'日誌/ test.log'並確認正確的行動正在達成。你也可以在'visit'後面加上'save_and_open_page'來在瀏覽器中顯示頁面。 – zetetic 2012-08-07 23:15:07
可能與你的數據庫策略有關,你可以包含'spec_helper.rb'嗎? – 2012-08-07 23:43:03