Commit 394746ff authored by Sanad Liaquat's avatar Sanad Liaquat

Some refactoring done

parent d85adbac
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
module QA module QA
context 'Manage', :orchestrated, :ldap_tls, :ldap_no_tls do context 'Manage', :orchestrated, :ldap_tls, :ldap_no_tls do
it 'Has LDAP user synced using group cn method' do describe 'LDAP Group sync' do
before(:all) do
users = [ users = [
{ {
name: 'ENG User 2', name: 'ENG User 2',
...@@ -17,12 +18,28 @@ module QA ...@@ -17,12 +18,28 @@ module QA
email: 'enguser3@example.org', email: 'enguser3@example.org',
provider: 'ldapmain', provider: 'ldapmain',
extern_uid: 'uid=enguser3,ou=people,ou=global groups,dc=example,dc=org' extern_uid: 'uid=enguser3,ou=people,ou=global groups,dc=example,dc=org'
},
{
name: 'HR User 2',
username: 'hruser2',
email: 'hruser2@example.org',
provider: 'ldapmain',
extern_uid: 'uid=hruser2,ou=people,ou=global groups,dc=example,dc=org'
},
{
name: 'HR User 3',
username: 'hruser3',
email: 'hruser3@example.org',
provider: 'ldapmain',
extern_uid: 'uid=hruser3,ou=people,ou=global groups,dc=example,dc=org'
} }
] ]
create_users_via_api(users) create_users_via_api(users)
end
it 'Has LDAP user synced using group cn method' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
create_group_with_user_via_api(user: 'enguser1', group_name: 'Synched-engineering-group') create_group_with_user_via_api(user: 'enguser1', group_name: 'Synched-engineering-group')
EE::Page::Group::Menu.perform(&:go_to_ldap_sync_settings) EE::Page::Group::Menu.perform(&:go_to_ldap_sync_settings)
...@@ -39,25 +56,6 @@ module QA ...@@ -39,25 +56,6 @@ module QA
end end
it 'Has LDAP user synced using user filter method' do it 'Has LDAP user synced using user filter method' do
users = [
{
name: 'HR User 2',
username: 'hruser2',
email: 'hruser2@example.org',
provider: 'ldapmain',
extern_uid: 'uid=hruser2,ou=people,ou=global groups,dc=example,dc=org'
},
{
name: 'HR User 3',
username: 'hruser3',
email: 'hruser3@example.org',
provider: 'ldapmain',
extern_uid: 'uid=hruser3,ou=people,ou=global groups,dc=example,dc=org'
}
]
create_users_via_api(users)
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
create_group_with_user_via_api(user: 'hruser1', group_name: 'Synched-human-resources-group') create_group_with_user_via_api(user: 'hruser1', group_name: 'Synched-human-resources-group')
...@@ -114,4 +112,5 @@ module QA ...@@ -114,4 +112,5 @@ module QA
end end
end end
end 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