2015-10-09 17:33:33 +02:00
|
|
|
RSpec.shared_examples 'not owner of dossier' do |controller, redirect|
|
2016-01-18 17:18:04 +01:00
|
|
|
let(:dossier_2) { create(:dossier) }
|
2015-10-09 17:33:33 +02:00
|
|
|
|
|
|
|
before do
|
2018-01-16 13:34:24 +01:00
|
|
|
get controller, params: { dossier_id: dossier_2.id }
|
2015-10-09 17:33:33 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'redirect to home page' do
|
2015-11-02 16:36:52 +01:00
|
|
|
expect(response).to redirect_to(redirect || '/')
|
2015-10-09 17:33:33 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'show a flash message error' do
|
|
|
|
expect(flash[:alert]).to be_present
|
|
|
|
end
|
|
|
|
end
|