before :each do
request.env["HTTP_ACCEPT"] = 'application/json'
end
More Related Contents:
- Why isn’t my CORS configuration causing the server to filter incoming requests? How can I make the server only accept requests from a specific origin?
- Reducing n+1 queries using the Bullet and RSpec gems
- How can I test the page title with Capybara 2.0?
- Rails: Missing host to link to! Please provide :host parameter or set default_url_options[:host]
- How do I change the default “www.example.com” domain for testing in rails?
- How to spec a private method
- undefined method `get’ for #
- Visit method not found in my rspec
- Suppress Ruby warnings when running specs
- Rails rspec set subdomain
- How to check for a JSON response using RSpec?
- How to check a checkbox in capybara?
- How is spec/rails_helper.rb different from spec/spec_helper.rb? Do I need it?
- undefined method `visit’ when using RSpec and Capybara in rails
- Controller spec unknown keyword: id
- Why not use shared ActiveRecord connections for Rspec + Selenium?
- How to set request headers in rspec request spec?
- Why is Rspec saying “Failure/Error: Unable to find matching line from backtrace”?
- Rspec and capybara, difference between visit and get methods, with regards to the current_path object
- Why does adding “sleep 1” in an after hook cause this Rspec/Capybara test to pass?
- Configuring Warden for use in RSpec controller specs
- Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib
- ActiveRecord: size vs count
- Validate presence of one field or another (XOR)
- Rails 4 – passing variable to partial
- How to get a query string from a URL in Rails
- Nokogiri ‘Failed to build gem native extension’ when I run bundle install
- How can I use Rails routes to redirect from one domain to another?
- rails many to many self join
- How do I add some inserts in rails migration?