저는 Ruby on Rails에서 Capybara를 사용하여 모든 필드를 채우고 양식을 제출하는 통합 테스트를 작성합니다. 이렇게하면 새 페이지가 브라우저에로드됩니다. 테스트에서 두 번째 페이지에 대한 응답을받을 수 있습니까? 카피 바라가 정보를 제공하지 않기 때문에Capybara로 여러 페이지의 페이지 응답을 확인하십시오.
describe "the signup process", :type => :request do
it "signs me in" do
visit sign_up_path
fill_in 'user_first_name', :with => "Jhonny"
t1 = Time.new
fill_in 'user_email', :with => "[email protected]"
fill_in 'user_last_name', :with => "Bravo"
fill_in 'user_zip_code', :with => "94102"
fill_in 'user_password', :with => "password1234"
click_button 'user-button'
response.should be_success
response.body should_contain("Text on next page")
end
end
'방문 '이 응답을 반환하지 않으면,'get'을 사용해야합니다. 참조 : http://stackoverflow.com/questions/11090038/rspec-and-capybara-difference-between-visit-and-get-methods-with-regards-to-th이 경우에도, 더 많이 탐색하고 있으므로 한 페이지 이상이면'get'가 작동하지 않습니다. –