2012-06-25 33 views
1

填充字段並按下按鈕後,瀏覽器(由腳本打開)顯示「正在等待127頁的頁面...」 「但它從來沒有去過任何地方(我等了30分鐘)。我正在測試一個Ubuntu 10.04盒子。有任何想法嗎?rails/rspec/capybara - 點擊按鈕後,無限'等待頁面...'

describe "GET 'new'", :js => true do 
    it "will log in" do 
     @admin = FactoryGirl.create(:admin) 
     puts @admin 
     puts @admin.attributes 
     visit '/' 
     fill_in 'user_login', :with => @admin.email 
     fill_in 'user_password', :with => @admin.password 
     click_on 'Sign in' 
     response.should be_success  
    end  

    it "should be successful" do 
     visit '/things/new' 
     page.should have_xpath('//form') 
    end 

    end 
+0

你使用哪種驅動程序的水豚?在哪個平臺上? 我在這個時候的猜測是JavaScript沒有按照你的預期工作。 您可能想要在操作之間運行'save_and_open_page'以驗證您是否正確擁有此頁面。 – shigeya

+0

我使用的默認值,我認爲是硒(火狐說在WebDriver在右下角) –

+0

這是有幫助的,至少它告訴我,我的Firefox的個人資料丟失。 –

回答

0

你不想在卡巴拉綜合測試中檢查response。在sign_in之後,請檢查新頁面中的某些成功消息,例如。 page.should have_content 'Welcome!