我有一个简单的规格
describe "Workers" do
describe "user attempts to view workers" do
context "admin logged in" do
end
context "non-logged in user" do
before do
visit workers_path
end
it "should redirect to home page" do
page.should have_content 'You are not authorized to access this page.'
end
end
end
end
这通过就好了。如果我添加save_and_open_page
,则测试运行终止并且输出显示“进程以退出代码 0 完成”,但没有说明测试状态。
describe "Workers" do
describe "user attempts to view workers" do
context "admin logged in" do
end
context "non-logged in user" do
before do
visit workers_path
end
it "should redirect to home page" do
save_and_open_page
page.should have_content 'You are not authorized to access this page.'
end
end
end
end
水豚:2.1.0
启动:2.3.0
rspec:2.13.0
导轨:3.2.13