demarches-normaliennes/spec/controllers/saml_idp_controller_spec.rb

25 lines
637 B
Ruby
Raw Normal View History

2020-11-12 16:09:21 +01:00
describe SamlIdpController do
describe '#new' do
let(:action) { get :new }
context 'without superadmin connected' do
it { expect(action).to redirect_to root_path }
it "display alert" do
action
2021-05-26 15:16:30 +02:00
expect(flash[:alert]).to eq("Vous nêtes pas autorisé à accéder à ce service.")
2020-11-12 16:09:21 +01:00
end
end
context 'with superadmin connected' do
let(:superadmin) { create(:super_admin) }
before { sign_in superadmin }
it 'encode saml response' do
expect(subject).to receive(:encode_SAMLResponse).with(superadmin.email, anything())
action
end
end
end
end