Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
018ed2c4
Commit
018ed2c4
authored
Jun 05, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change `login_with` uses to `gitlab_sign_in`
Change single `login_via` use to `gitlab_sign_in_via`
parent
45fb1f95
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
54 additions
and
54 deletions
+54
-54
spec/features/atom/issues_spec.rb
spec/features/atom/issues_spec.rb
+1
-1
spec/features/commits_spec.rb
spec/features/commits_spec.rb
+1
-1
spec/features/dashboard_milestones_spec.rb
spec/features/dashboard_milestones_spec.rb
+1
-1
spec/features/global_search_spec.rb
spec/features/global_search_spec.rb
+1
-1
spec/features/issues/user_uses_slash_commands_spec.rb
spec/features/issues/user_uses_slash_commands_spec.rb
+3
-3
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+2
-2
spec/features/login_spec.rb
spec/features/login_spec.rb
+13
-13
spec/features/merge_requests/user_uses_slash_commands_spec.rb
.../features/merge_requests/user_uses_slash_commands_spec.rb
+5
-5
spec/features/projects/files/browse_files_spec.rb
spec/features/projects/files/browse_files_spec.rb
+1
-1
spec/features/projects/jobs_spec.rb
spec/features/projects/jobs_spec.rb
+1
-1
spec/features/projects_spec.rb
spec/features/projects_spec.rb
+4
-4
spec/features/search_spec.rb
spec/features/search_spec.rb
+1
-1
spec/features/tags/master_creates_tag_spec.rb
spec/features/tags/master_creates_tag_spec.rb
+1
-1
spec/features/tags/master_deletes_tag_spec.rb
spec/features/tags/master_deletes_tag_spec.rb
+1
-1
spec/features/tags/master_updates_tag_spec.rb
spec/features/tags/master_updates_tag_spec.rb
+1
-1
spec/features/tags/master_views_tags_spec.rb
spec/features/tags/master_views_tags_spec.rb
+1
-1
spec/features/task_lists_spec.rb
spec/features/task_lists_spec.rb
+4
-4
spec/features/u2f_spec.rb
spec/features/u2f_spec.rb
+5
-5
spec/features/users_spec.rb
spec/features/users_spec.rb
+1
-1
spec/support/features/issuable_slash_commands_shared_examples.rb
...pport/features/issuable_slash_commands_shared_examples.rb
+4
-4
spec/support/login_helpers.rb
spec/support/login_helpers.rb
+2
-2
No files found.
spec/features/atom/issues_spec.rb
View file @
018ed2c4
...
...
@@ -15,7 +15,7 @@ describe 'Issues Feed', feature: true do
context
'when authenticated'
do
it
'renders atom feed'
do
login_with
user
gitlab_sign_in
user
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
:atom
)
expect
(
response_headers
[
'Content-Type'
]).
...
...
spec/features/commits_spec.rb
View file @
018ed2c4
...
...
@@ -191,7 +191,7 @@ describe 'Commits' do
before
do
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
visit
namespace_project_commits_path
(
project
.
namespace
,
project
,
branch_name
)
end
...
...
spec/features/dashboard_milestones_spec.rb
View file @
018ed2c4
...
...
@@ -17,7 +17,7 @@ feature 'Dashboard > Milestones', feature: true do
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
before
do
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
visit
dashboard_milestones_path
end
...
...
spec/features/global_search_spec.rb
View file @
018ed2c4
...
...
@@ -6,7 +6,7 @@ feature 'Global search', feature: true do
before
do
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
end
describe
'I search through the issues and I see pagination'
do
...
...
spec/features/issues/user_uses_slash_commands_spec.rb
View file @
018ed2c4
...
...
@@ -13,7 +13,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do
before
do
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
...
...
@@ -42,7 +42,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do
before
do
project
.
team
<<
[
guest
,
:guest
]
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
...
...
@@ -82,7 +82,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do
before
do
project
.
team
<<
[
guest
,
:guest
]
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
...
...
spec/features/issues_spec.rb
View file @
018ed2c4
...
...
@@ -484,7 +484,7 @@ describe 'Issues', feature: true do
it
'shows assignee text'
,
js:
true
do
logout
login_with
guest
gitlab_sign_in
guest
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
expect
(
page
).
to
have_content
issue
.
assignees
.
first
.
name
...
...
@@ -547,7 +547,7 @@ describe 'Issues', feature: true do
it
'shows milestone text'
,
js:
true
do
logout
login_with
guest
gitlab_sign_in
guest
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
expect
(
page
).
to
have_content
milestone
.
title
...
...
spec/features/login_spec.rb
View file @
018ed2c4
...
...
@@ -36,7 +36,7 @@ feature 'Login', feature: true do
it
'prevents the user from logging in'
do
user
=
create
(
:user
,
:blocked
)
login_with
(
user
)
gitlab_sign_in
(
user
)
expect
(
page
).
to
have_content
(
'Your account has been blocked.'
)
end
...
...
@@ -44,19 +44,19 @@ feature 'Login', feature: true do
it
'does not update Devise trackable attributes'
,
:redis
do
user
=
create
(
:user
,
:blocked
)
expect
{
login_with
(
user
)
}.
not_to
change
{
user
.
reload
.
sign_in_count
}
expect
{
gitlab_sign_in
(
user
)
}.
not_to
change
{
user
.
reload
.
sign_in_count
}
end
end
describe
'with the ghost user'
do
it
'disallows login'
do
login_with
(
User
.
ghost
)
gitlab_sign_in
(
User
.
ghost
)
expect
(
page
).
to
have_content
(
'Invalid Login or password.'
)
end
it
'does not update Devise trackable attributes'
,
:redis
do
expect
{
login_with
(
User
.
ghost
)
}.
not_to
change
{
User
.
ghost
.
reload
.
sign_in_count
}
expect
{
gitlab_sign_in
(
User
.
ghost
)
}.
not_to
change
{
User
.
ghost
.
reload
.
sign_in_count
}
end
end
...
...
@@ -70,7 +70,7 @@ feature 'Login', feature: true do
let
(
:user
)
{
create
(
:user
,
:two_factor
)
}
before
do
login_with
(
user
,
remember:
true
)
gitlab_sign_in
(
user
,
remember:
true
)
expect
(
page
).
to
have_content
(
'Two-Factor Authentication'
)
end
...
...
@@ -167,7 +167,7 @@ feature 'Login', feature: true do
it
'shows 2FA prompt after OAuth login'
do
stub_omniauth_config
(
enabled:
true
,
auto_link_saml_user:
true
,
allow_single_sign_on:
[
'saml'
],
providers:
[
saml_config
])
user
=
create
(
:omniauth_user
,
:two_factor
,
extern_uid:
'my-uid'
,
provider:
'saml'
)
log
in_via
(
'saml'
,
user
,
'my-uid'
)
gitlab_sign_
in_via
(
'saml'
,
user
,
'my-uid'
)
expect
(
page
).
to
have_content
(
'Two-Factor Authentication'
)
enter_code
(
user
.
current_otp
)
...
...
@@ -180,19 +180,19 @@ feature 'Login', feature: true do
let
(
:user
)
{
create
(
:user
)
}
it
'allows basic login'
do
login_with
(
user
)
gitlab_sign_in
(
user
)
expect
(
current_path
).
to
eq
root_path
end
it
'does not show a "You are already signed in." error message'
do
login_with
(
user
)
gitlab_sign_in
(
user
)
expect
(
page
).
not_to
have_content
(
'You are already signed in.'
)
end
it
'blocks invalid login'
do
user
=
create
(
:user
,
password:
'not-the-default'
)
login_with
(
user
)
gitlab_sign_in
(
user
)
expect
(
page
).
to
have_content
(
'Invalid Login or password.'
)
end
end
...
...
@@ -209,7 +209,7 @@ feature 'Login', feature: true do
context
'with grace period defined'
do
before
do
stub_application_setting
(
two_factor_grace_period:
48
)
login_with
(
user
)
gitlab_sign_in
(
user
)
end
context
'within the grace period'
do
...
...
@@ -246,7 +246,7 @@ feature 'Login', feature: true do
context
'without grace period defined'
do
before
do
stub_application_setting
(
two_factor_grace_period:
0
)
login_with
(
user
)
gitlab_sign_in
(
user
)
end
it
'redirects to two-factor configuration page'
do
...
...
@@ -269,7 +269,7 @@ feature 'Login', feature: true do
context
'with grace period defined'
do
before
do
stub_application_setting
(
two_factor_grace_period:
48
)
login_with
(
user
)
gitlab_sign_in
(
user
)
end
context
'within the grace period'
do
...
...
@@ -310,7 +310,7 @@ feature 'Login', feature: true do
context
'without grace period defined'
do
before
do
stub_application_setting
(
two_factor_grace_period:
0
)
login_with
(
user
)
gitlab_sign_in
(
user
)
end
it
'redirects to two-factor configuration page'
do
...
...
spec/features/merge_requests/user_uses_slash_commands_spec.rb
View file @
018ed2c4
...
...
@@ -16,7 +16,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
describe
'merge-request-only commands'
do
before
do
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
...
...
@@ -52,7 +52,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
before
do
project
.
team
<<
[
guest
,
:guest
]
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
...
...
@@ -98,7 +98,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
before
do
project
.
team
<<
[
guest
,
:guest
]
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
...
...
@@ -127,7 +127,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
before
do
logout
another_project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
end
it
'changes target_branch in new merge_request'
do
...
...
@@ -182,7 +182,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
before
do
project
.
team
<<
[
guest
,
:guest
]
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
...
...
spec/features/projects/files/browse_files_spec.rb
View file @
018ed2c4
...
...
@@ -6,7 +6,7 @@ feature 'user browses project', feature: true, js: true do
before
do
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
visit
namespace_project_tree_path
(
project
.
namespace
,
project
,
project
.
default_branch
)
end
...
...
spec/features/projects/jobs_spec.rb
View file @
018ed2c4
...
...
@@ -393,7 +393,7 @@ feature 'Jobs', :feature do
project
.
update
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
)
logout_direct
login_with
(
create
(
:user
))
gitlab_sign_in
(
create
(
:user
))
visit
namespace_project_job_path
(
project
.
namespace
,
project
,
job
)
end
...
...
spec/features/projects_spec.rb
View file @
018ed2c4
...
...
@@ -39,7 +39,7 @@ feature 'Project', feature: true do
let
(
:project
)
{
create
(
:empty_project
,
namespace:
user
.
namespace
)
}
before
do
login_with
user
gitlab_sign_in
user
create
(
:forked_project_link
,
forked_to_project:
project
)
visit
edit_namespace_project_path
(
project
.
namespace
,
project
)
end
...
...
@@ -60,7 +60,7 @@ feature 'Project', feature: true do
let
(
:project
)
{
create
(
:empty_project
,
namespace:
user
.
namespace
,
name:
'project1'
)
}
before
do
login_with
(
user
)
gitlab_sign_in
(
user
)
project
.
team
<<
[
user
,
:master
]
visit
edit_namespace_project_path
(
project
.
namespace
,
project
)
end
...
...
@@ -79,7 +79,7 @@ feature 'Project', feature: true do
let
(
:project
)
{
create
(
:empty_project
,
namespace:
user
.
namespace
)
}
before
do
login_with
(
user
)
gitlab_sign_in
(
user
)
project
.
add_user
(
user
,
Gitlab
::
Access
::
MASTER
)
visit
namespace_project_path
(
project
.
namespace
,
project
)
end
...
...
@@ -98,7 +98,7 @@ feature 'Project', feature: true do
context
'on issues page'
,
js:
true
do
before
do
login_with
(
user
)
gitlab_sign_in
(
user
)
project
.
add_user
(
user
,
Gitlab
::
Access
::
MASTER
)
project2
.
add_user
(
user
,
Gitlab
::
Access
::
MASTER
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
...
...
spec/features/search_spec.rb
View file @
018ed2c4
...
...
@@ -9,7 +9,7 @@ describe "Search", feature: true do
let!
(
:issue2
)
{
create
(
:issue
,
project:
project
,
author:
user
)
}
before
do
login_with
(
user
)
gitlab_sign_in
(
user
)
project
.
team
<<
[
user
,
:reporter
]
visit
search_path
end
...
...
spec/features/tags/master_creates_tag_spec.rb
View file @
018ed2c4
...
...
@@ -6,7 +6,7 @@ feature 'Master creates tag', feature: true do
before
do
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
end
context
'from tag list'
do
...
...
spec/features/tags/master_deletes_tag_spec.rb
View file @
018ed2c4
...
...
@@ -6,7 +6,7 @@ feature 'Master deletes tag', feature: true do
before
do
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
visit
namespace_project_tags_path
(
project
.
namespace
,
project
)
end
...
...
spec/features/tags/master_updates_tag_spec.rb
View file @
018ed2c4
...
...
@@ -6,7 +6,7 @@ feature 'Master updates tag', feature: true do
before
do
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
visit
namespace_project_tags_path
(
project
.
namespace
,
project
)
end
...
...
spec/features/tags/master_views_tags_spec.rb
View file @
018ed2c4
...
...
@@ -5,7 +5,7 @@ feature 'Master views tags', feature: true do
before
do
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
end
context
'when project has no tags'
do
...
...
spec/features/task_lists_spec.rb
View file @
018ed2c4
...
...
@@ -55,7 +55,7 @@ feature 'Task Lists', feature: true do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user2
,
:guest
]
gitlab_sign_in
(
user
)
login_as
(
user
)
end
def
visit_issue
(
project
,
issue
)
...
...
@@ -90,7 +90,7 @@ feature 'Task Lists', feature: true do
expect
(
page
).
to
have_selector
(
".wiki .task-list .task-list-item .task-list-item-checkbox"
)
logout
(
:user
)
gitlab_sign_in
(
user2
)
login_as
(
user2
)
visit
current_path
wait_for_requests
...
...
@@ -203,7 +203,7 @@ feature 'Task Lists', feature: true do
logout
(
:user
)
gitlab_sign_in
(
user2
)
login_as
(
user2
)
visit
current_path
expect
(
page
).
not_to
have_selector
(
'.js-task-list-container'
)
end
...
...
@@ -275,7 +275,7 @@ feature 'Task Lists', feature: true do
logout
(
:user
)
gitlab_sign_in
(
user2
)
login_as
(
user2
)
visit
current_path
expect
(
page
).
not_to
have_selector
(
'.js-task-list-container'
)
end
...
...
spec/features/u2f_spec.rb
View file @
018ed2c4
...
...
@@ -158,7 +158,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
describe
"when 2FA via OTP is disabled"
do
it
"allows logging in with the U2F device"
do
user
.
update_attribute
(
:otp_required_for_login
,
false
)
login_with
(
user
)
gitlab_sign_in
(
user
)
@u2f_device
.
respond_to_u2f_authentication
...
...
@@ -170,7 +170,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
describe
"when 2FA via OTP is enabled"
do
it
"allows logging in with the U2F device"
do
user
.
update_attribute
(
:otp_required_for_login
,
true
)
login_with
(
user
)
gitlab_sign_in
(
user
)
@u2f_device
.
respond_to_u2f_authentication
...
...
@@ -180,7 +180,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
end
it
'persists remember_me value via hidden field'
do
login_with
(
user
,
remember:
true
)
gitlab_sign_in
(
user
,
remember:
true
)
@u2f_device
.
respond_to_u2f_authentication
expect
(
page
).
to
have_content
(
'We heard back from your U2F device'
)
...
...
@@ -308,7 +308,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
describe
'when no u2f device is registered'
do
before
do
logout
login_with
(
user
)
gitlab_sign_in
(
user
)
end
it
'shows the fallback otp code UI'
do
...
...
@@ -321,7 +321,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
manage_two_factor_authentication
@u2f_device
=
register_u2f_device
logout
login_with
(
user
)
gitlab_sign_in
(
user
)
end
it
'provides a button that shows the fallback otp code UI'
do
...
...
spec/features/users_spec.rb
View file @
018ed2c4
...
...
@@ -24,7 +24,7 @@ feature 'Users', feature: true, js: true do
user
.
reload
expect
(
user
.
reset_password_token
).
not_to
be_nil
login_with
(
user
)
gitlab_sign_in
(
user
)
expect
(
current_path
).
to
eq
root_path
user
.
reload
...
...
spec/support/features/issuable_slash_commands_shared_examples.rb
View file @
018ed2c4
...
...
@@ -17,7 +17,7 @@ shared_examples 'issuable record that supports quick actions in its description
project
.
team
<<
[
master
,
:master
]
project
.
team
<<
[
assignee
,
:developer
]
project
.
team
<<
[
guest
,
:guest
]
login_with
(
master
)
gitlab_sign_in
(
master
)
end
after
do
...
...
@@ -106,7 +106,7 @@ shared_examples 'issuable record that supports quick actions in its description
context
"when current user cannot close
#{
issuable_type
}
"
do
before
do
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
public_send
(
"namespace_project_
#{
issuable_type
}
_path"
,
project
.
namespace
,
project
,
issuable
)
end
...
...
@@ -141,7 +141,7 @@ shared_examples 'issuable record that supports quick actions in its description
context
"when current user cannot reopen
#{
issuable_type
}
"
do
before
do
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
public_send
(
"namespace_project_
#{
issuable_type
}
_path"
,
project
.
namespace
,
project
,
issuable
)
end
...
...
@@ -171,7 +171,7 @@ shared_examples 'issuable record that supports quick actions in its description
context
"when current user cannot change title of
#{
issuable_type
}
"
do
before
do
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
public_send
(
"namespace_project_
#{
issuable_type
}
_path"
,
project
.
namespace
,
project
,
issuable
)
end
...
...
spec/support/login_helpers.rb
View file @
018ed2c4
...
...
@@ -14,7 +14,7 @@ module LoginHelpers
# # Provide an existing User record
# user = create(:user)
# gitlab_sign_in(user)
def
gitlab_sign_in
(
user_or_role
)
def
gitlab_sign_in
(
user_or_role
,
**
kwargs
)
@user
=
if
user_or_role
.
is_a?
(
User
)
user_or_role
...
...
@@ -22,7 +22,7 @@ module LoginHelpers
create
(
user_or_role
)
end
gitlab_sign_in_with
(
@user
)
gitlab_sign_in_with
(
@user
,
**
kwargs
)
end
def
gitlab_sign_in_via
(
provider
,
user
,
uid
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment