Request Test
suggest changeThe 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
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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents