Commit 1fbe7ca5 authored by Robert Speicher's avatar Robert Speicher

CE-EE parity for Platform feature specs

parent 98c44525
require 'spec_helper'
feature 'Login' do
before do
stub_licensed_features(extended_audit_events: true)
end
it 'creates a security event for an invalid password login' do
user = create(:user, password: 'not-the-default')
expect { gitlab_sign_in(user) }
.to change { SecurityEvent.where(entity_id: -1).count }.from(0).to(1)
end
it 'creates a security event for an invalid OAuth login' do
stub_omniauth_saml_config(
enabled: true,
auto_link_saml_user: false,
allow_single_sign_on: ['saml'],
providers: [mock_saml_config]
)
user = create(:omniauth_user, :two_factor, extern_uid: 'my-uid', provider: 'saml')
expect { gitlab_sign_in_via('saml', user, 'wrong-uid') }
.to change { SecurityEvent.where(entity_id: -1).count }.from(0).to(1)
end
end
...@@ -4,8 +4,6 @@ describe 'User visits the profile preferences page' do ...@@ -4,8 +4,6 @@ describe 'User visits the profile preferences page' do
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
stub_licensed_features(ide: true)
sign_in(user) sign_in(user)
visit(profile_preferences_path) visit(profile_preferences_path)
......
...@@ -186,16 +186,6 @@ feature 'Login' do ...@@ -186,16 +186,6 @@ feature 'Login' do
enter_code(user.current_otp) enter_code(user.current_otp)
expect(current_path).to eq root_path expect(current_path).to eq root_path
end end
it 'creates a security event after failed OAuth login' do
stub_omniauth_saml_config(enabled: true, auto_link_saml_user: false, allow_single_sign_on: ['saml'], providers: [mock_saml_config])
stub_licensed_features(extended_audit_events: true)
user = create(:omniauth_user, :two_factor, extern_uid: 'my-uid', provider: 'saml')
gitlab_sign_in_via('saml', user, 'wrong-uid')
expect(SecurityEvent.where(entity_id: -1).count).to eq(1)
end
end end
end end
...@@ -213,14 +203,10 @@ feature 'Login' do ...@@ -213,14 +203,10 @@ feature 'Login' do
end end
it 'blocks invalid login' do it 'blocks invalid login' do
stub_licensed_features(extended_audit_events: true)
user = create(:user, password: 'not-the-default') user = create(:user, password: 'not-the-default')
gitlab_sign_in(user) gitlab_sign_in(user)
expect(page).to have_content('Invalid Login or password.') expect(page).to have_content('Invalid Login or password.')
expect(SecurityEvent.where(entity_id: -1).count).to eq(1)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment