I'm writing some pretty standard Rspec request specs for a Rails app.
describe "show" do
it "should respond successfully when given an id that exists" do
@badger = FactoryGirl.create(:badger)
get "/badgers/#{@badger.id}"
response.should be_ok
end
end
However, we've just added a middleware component for a single sign-on system, so the response comes back as a redirect - "please sign in."
For the purposes of these tests, how can I leave the middleware out of the chain? (It has its own tests elsewhere.)
In your config/environments/test.rb
you can delete this middleware:
config.middleware.delete YourMiddleware::Goes::Here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With