2013-05-03 68 views
0

我有一個簡單的規範launchy寶石終止測試

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

launchy:2.3.0

rspec的:2.13.0

導軌:3.2.13

+0

在你的描述中,你提到了'save_and_load_page',但是在你的代碼中你有'save_and_open_page'。 'save_and_open_page'是正確的。 – Rebitzele 2013-05-03 16:50:22

+0

@Rebitzele - 絕對是一個錯字。解決這個問題。謝謝 – 2013-05-03 18:05:58

回答

0

一定是壞的安裝launchy。我降級到launchy 2.2.0和一切工作,然後我升級(後退)launchy 2.3.0和事情似乎工作正常。