From bcb9a2a7e915a1158427e16342dbaa700ce4ee5d Mon Sep 17 00:00:00 2001 From: Zog Date: Thu, 8 Feb 2018 16:27:52 +0100 Subject: Refs #5865 @1h; Ensure user is allowed to duplicate a referential before doing so I also changed the way 403 errors are handled, to properly respond with a 403 HTTP code --- spec/controllers/lines_controller_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'spec/controllers/lines_controller_spec.rb') diff --git a/spec/controllers/lines_controller_spec.rb b/spec/controllers/lines_controller_spec.rb index 65fe88b96..96f49bb36 100644 --- a/spec/controllers/lines_controller_spec.rb +++ b/spec/controllers/lines_controller_spec.rb @@ -7,8 +7,8 @@ RSpec.describe LinesController, :type => :controller do describe 'PUT deactivate' do let(:request){ put :deactivate, id: line.id, line_referential_id: line_referential.id } - it 'should redirect to 403' do - expect(request).to redirect_to "/403" + it 'should respond with 403' do + expect(request).to have_http_status 403 end with_permission "lines.change_status" do @@ -24,8 +24,8 @@ RSpec.describe LinesController, :type => :controller do before(:each){ line.deactivate! } - it 'should redirect to 403' do - expect(request).to redirect_to "/403" + it 'should respond with 403' do + expect(request).to have_http_status 403 end with_permission "lines.change_status" do -- cgit v1.2.3