aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorVlatka Pavisic2017-04-25 14:10:37 +0200
committerVlatka Pavisic2017-04-25 14:10:45 +0200
commitd6d5884aed86156735cb1727f66d229664b675fd (patch)
treefa79160674cabcb19d2c918202d8d311f841e684 /spec
parentcf73ce3becb8670524975e5561a498cae620017f (diff)
downloadchouette-core-d6d5884aed86156735cb1727f66d229664b675fd.tar.bz2
Refs #3033 : 403 page and ErrorsController tests
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/errors_controller_spec.rb41
1 files changed, 41 insertions, 0 deletions
diff --git a/spec/controllers/errors_controller_spec.rb b/spec/controllers/errors_controller_spec.rb
new file mode 100644
index 000000000..558fd0aa4
--- /dev/null
+++ b/spec/controllers/errors_controller_spec.rb
@@ -0,0 +1,41 @@
+require 'spec_helper'
+
+RSpec.describe ErrorsController, type: :controller do
+ login_user
+
+ describe 'GET not_found' do
+ before(:each) { get 'not_found' }
+
+ it 'renders the not_found template' do
+ expect(response).to render_template('not_found')
+ end
+
+ it 'returns 404 status code' do
+ expect(response).to have_http_status(404)
+ end
+ end
+
+ describe 'GET not_allowed' do
+ before(:each) { get 'not_allowed' }
+
+ it 'renders the not_allowed template' do
+ expect(response).to render_template('not_allowed')
+ end
+
+ it 'returns 403 status code' do
+ expect(response).to have_http_status(403)
+ end
+ end
+
+ describe 'GET server_error' do
+ before(:each) { get 'server_error' }
+
+ it 'renders the server_error template' do
+ expect(response).to render_template('server_error')
+ end
+
+ it 'returns 500 status code' do
+ expect(response).to have_http_status(500)
+ end
+ end
+end