diff options
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/helpers/graphql_helpers.rb | 4 | ||||
-rw-r--r-- | spec/support/helpers/login_helpers.rb | 13 |
2 files changed, 14 insertions, 3 deletions
diff --git a/spec/support/helpers/graphql_helpers.rb b/spec/support/helpers/graphql_helpers.rb index 35b1b802f35..370162b45f0 100644 --- a/spec/support/helpers/graphql_helpers.rb +++ b/spec/support/helpers/graphql_helpers.rb @@ -12,8 +12,8 @@ module GraphqlHelpers end # Run a loader's named resolver - def resolve(resolver_class, obj: nil, args: {}, ctx: {}) - resolver_class.new(object: obj, context: ctx).resolve(args) + def resolve(resolver_class, obj: nil, args: {}, ctx: {}, field: nil) + resolver_class.new(object: obj, context: ctx, field: field).resolve(args) end # Eagerly run a loader's named resolver diff --git a/spec/support/helpers/login_helpers.rb b/spec/support/helpers/login_helpers.rb index 1d42f26ad3e..6a4dcfcdb1e 100644 --- a/spec/support/helpers/login_helpers.rb +++ b/spec/support/helpers/login_helpers.rb @@ -51,7 +51,7 @@ module LoginHelpers def gitlab_enable_admin_mode_sign_in(user) visit new_admin_session_path - fill_in 'password', with: user.password + fill_in 'user_password', with: user.password click_button 'Enter Admin Mode' end @@ -62,6 +62,12 @@ module LoginHelpers click_link provider end + def gitlab_enable_admin_mode_sign_in_via(provider, user, uid, saml_response = nil) + mock_auth_hash_with_saml_xml(provider, uid, user.email, saml_response) + visit new_admin_session_path + click_link provider + end + # Requires Javascript driver. def gitlab_sign_out find(".header-user-dropdown-toggle").click @@ -71,6 +77,11 @@ module LoginHelpers expect(page).to have_button('Sign in') end + # Requires Javascript driver. + def gitlab_disable_admin_mode + click_on 'Leave Admin Mode' + end + private # Private: Login as the specified user |