我正在使用 Capybara 和 Ruby on Rails 创建一个集成测试,该测试将填写所有字段并提交表单。然后,这会将新页面加载到浏览器。是否有可能在测试中获得第二页的响应?
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 => "joe412@offerslot.com"
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