Request Test

suggest change

The example below is a Capybara feature spec. check and click_on drive a browser-like session. A Rails request spec, or an ActionDispatch::IntegrationTest, calls get and post and does not run JavaScript.

it "allows the user to set their preferences" do
  check "Ruby"
  click_on "Save and Continue"
  expect(user.languages).to eq ["Ruby"]
end

source

user in that spec comes from the surrounding example. The original file lives under spec/requests, but these matchers are feature-spec tools. Add js: true only when the scenario needs a JavaScript driver.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents