diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/controllers/errors_controller_spec.rb | 41 |
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 |
