act as an saml identity provider
This commit is contained in:
parent
f30ac39ffb
commit
9347951cea
9 changed files with 93 additions and 0 deletions
24
spec/controllers/saml_idp_controller_spec.rb
Normal file
24
spec/controllers/saml_idp_controller_spec.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
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
|
||||
expect(flash[:alert]).to eq("Vous n'êtes pas autorisé à accéder à ce service.")
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue