aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/lines_controller_spec.rb
diff options
context:
space:
mode:
authorZog2018-02-08 16:27:52 +0100
committerLuc Donnet2018-02-21 11:23:28 +0100
commitbcb9a2a7e915a1158427e16342dbaa700ce4ee5d (patch)
tree80e4134c7242953440c96a907f49c36450bc5d7e /spec/controllers/lines_controller_spec.rb
parent6599a8d6a10e338fed38119115d12a3acb507e1b (diff)
downloadchouette-core-bcb9a2a7e915a1158427e16342dbaa700ce4ee5d.tar.bz2
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
Diffstat (limited to 'spec/controllers/lines_controller_spec.rb')
-rw-r--r--spec/controllers/lines_controller_spec.rb8
1 files changed, 4 insertions, 4 deletions
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