minor refactoring of flash messages

This commit is contained in:
Hauke Klement
2015-03-23 16:42:57 +01:00
parent 2e596110fd
commit 4eef3d70d5
12 changed files with 46 additions and 49 deletions

View File

@ -22,18 +22,13 @@ describe ApplicationController do
end
describe '#render_not_authorized' do
let(:render_not_authorized) { controller.send(:render_not_authorized) }
it 'displays a flash message' do
expect(controller).to receive(:redirect_to)
render_not_authorized
expect(flash[:danger]).to eq(I18n.t('application.not_authorized'))
before(:each) do
expect(controller).to receive(:welcome) { controller.send(:render_not_authorized) }
get :welcome
end
it 'redirects to the root URL' do
expect(controller).to receive(:redirect_to).with(:root)
render_not_authorized
end
expect_flash_message(:alert, I18n.t('application.not_authorized'))
expect_redirect(:root)
end
describe '#set_locale' do