我有以下测试,可以在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