spec/controllers/rinfo_controller_spec.rb in rinfo-0.1.3 vs spec/controllers/rinfo_controller_spec.rb in rinfo-0.1.4

- old
+ new

@@ -70,12 +70,13 @@ context 'default blacklisted envs' do it 'does not display rinfo for blacklisted envs' do default_blacklist.each do |env| Rinfo.stub(:env).and_return(env.to_s) - get 'info', format: :json - response.status.should == 404 + expect { get 'info', format: :json }.to raise_error( + ActionController::RoutingError + ) end end it 'displays rinfo for all envs not on the blacklist' do default_whitelist.each do |env| @@ -106,12 +107,13 @@ end it 'does not display rinfo for any envs' do rails_envs.each do |env| Rinfo.stub(:env).and_return(env.to_s) - get 'info', format: :json - response.status.should == 404 + expect { get 'info', format: :json }.to raise_error( + ActionController::RoutingError + ) end end end context 'custom blacklist' do @@ -120,11 +122,12 @@ end it 'does not display rinfo for blacklisted envs' do custom_blacklist.each do |env| Rinfo.stub(:env).and_return(env.to_s) - get 'info', format: :json - response.status.should == 404 + expect { get 'info', format: :json }.to raise_error( + ActionController::RoutingError + ) end end it 'displays rinfo for non-blacklisted envs' do (rails_envs - custom_blacklist).each do |env|