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
Léo-Paul Géneau
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
Hide 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
...
@@ -15,7 +15,7 @@ describe 'Issues Feed', feature: true do
context
'when authenticated'
do
context
'when authenticated'
do
it
'renders atom feed'
do
it
'renders atom feed'
do
login_with
user
gitlab_sign_in
user
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
:atom
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
:atom
)
expect
(
response_headers
[
'Content-Type'
]).
expect
(
response_headers
[
'Content-Type'
]).
...
...
spec/features/commits_spec.rb
View file @
018ed2c4
...
@@ -191,7 +191,7 @@ describe 'Commits' do
...
@@ -191,7 +191,7 @@ describe 'Commits' do
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
visit
namespace_project_commits_path
(
project
.
namespace
,
project
,
branch_name
)
visit
namespace_project_commits_path
(
project
.
namespace
,
project
,
branch_name
)
end
end
...
...
spec/features/dashboard_milestones_spec.rb
View file @
018ed2c4
...
@@ -17,7 +17,7 @@ feature 'Dashboard > Milestones', feature: true do
...
@@ -17,7 +17,7 @@ feature 'Dashboard > Milestones', feature: true do
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
visit
dashboard_milestones_path
visit
dashboard_milestones_path
end
end
...
...
spec/features/global_search_spec.rb
View file @
018ed2c4
...
@@ -6,7 +6,7 @@ feature 'Global search', feature: true do
...
@@ -6,7 +6,7 @@ feature 'Global search', feature: true do
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
end
end
describe
'I search through the issues and I see pagination'
do
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
...
@@ -13,7 +13,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
end
...
@@ -42,7 +42,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do
...
@@ -42,7 +42,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do
before
do
before
do
project
.
team
<<
[
guest
,
:guest
]
project
.
team
<<
[
guest
,
:guest
]
logout
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
end
...
@@ -82,7 +82,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do
...
@@ -82,7 +82,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do
before
do
before
do
project
.
team
<<
[
guest
,
:guest
]
project
.
team
<<
[
guest
,
:guest
]
logout
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
end
...
...
spec/features/issues_spec.rb
View file @
018ed2c4
...
@@ -484,7 +484,7 @@ describe 'Issues', feature: true do
...
@@ -484,7 +484,7 @@ describe 'Issues', feature: true do
it
'shows assignee text'
,
js:
true
do
it
'shows assignee text'
,
js:
true
do
logout
logout
login_with
guest
gitlab_sign_in
guest
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
expect
(
page
).
to
have_content
issue
.
assignees
.
first
.
name
expect
(
page
).
to
have_content
issue
.
assignees
.
first
.
name
...
@@ -547,7 +547,7 @@ describe 'Issues', feature: true do
...
@@ -547,7 +547,7 @@ describe 'Issues', feature: true do
it
'shows milestone text'
,
js:
true
do
it
'shows milestone text'
,
js:
true
do
logout
logout
login_with
guest
gitlab_sign_in
guest
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
expect
(
page
).
to
have_content
milestone
.
title
expect
(
page
).
to
have_content
milestone
.
title
...
...
spec/features/login_spec.rb
View file @
018ed2c4
...
@@ -36,7 +36,7 @@ feature 'Login', feature: true do
...
@@ -36,7 +36,7 @@ feature 'Login', feature: true do
it
'prevents the user from logging in'
do
it
'prevents the user from logging in'
do
user
=
create
(
:user
,
:blocked
)
user
=
create
(
:user
,
:blocked
)
login_with
(
user
)
gitlab_sign_in
(
user
)
expect
(
page
).
to
have_content
(
'Your account has been blocked.'
)
expect
(
page
).
to
have_content
(
'Your account has been blocked.'
)
end
end
...
@@ -44,19 +44,19 @@ feature 'Login', feature: true do
...
@@ -44,19 +44,19 @@ feature 'Login', feature: true do
it
'does not update Devise trackable attributes'
,
:redis
do
it
'does not update Devise trackable attributes'
,
:redis
do
user
=
create
(
:user
,
:blocked
)
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
end
end
describe
'with the ghost user'
do
describe
'with the ghost user'
do
it
'disallows login'
do
it
'disallows login'
do
login_with
(
User
.
ghost
)
gitlab_sign_in
(
User
.
ghost
)
expect
(
page
).
to
have_content
(
'Invalid Login or password.'
)
expect
(
page
).
to
have_content
(
'Invalid Login or password.'
)
end
end
it
'does not update Devise trackable attributes'
,
:redis
do
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
end
end
...
@@ -70,7 +70,7 @@ feature 'Login', feature: true do
...
@@ -70,7 +70,7 @@ feature 'Login', feature: true do
let
(
:user
)
{
create
(
:user
,
:two_factor
)
}
let
(
:user
)
{
create
(
:user
,
:two_factor
)
}
before
do
before
do
login_with
(
user
,
remember:
true
)
gitlab_sign_in
(
user
,
remember:
true
)
expect
(
page
).
to
have_content
(
'Two-Factor Authentication'
)
expect
(
page
).
to
have_content
(
'Two-Factor Authentication'
)
end
end
...
@@ -167,7 +167,7 @@ feature 'Login', feature: true do
...
@@ -167,7 +167,7 @@ feature 'Login', feature: true do
it
'shows 2FA prompt after OAuth login'
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
])
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'
)
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'
)
expect
(
page
).
to
have_content
(
'Two-Factor Authentication'
)
enter_code
(
user
.
current_otp
)
enter_code
(
user
.
current_otp
)
...
@@ -180,19 +180,19 @@ feature 'Login', feature: true do
...
@@ -180,19 +180,19 @@ feature 'Login', feature: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
it
'allows basic login'
do
it
'allows basic login'
do
login_with
(
user
)
gitlab_sign_in
(
user
)
expect
(
current_path
).
to
eq
root_path
expect
(
current_path
).
to
eq
root_path
end
end
it
'does not show a "You are already signed in." error message'
do
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.'
)
expect
(
page
).
not_to
have_content
(
'You are already signed in.'
)
end
end
it
'blocks invalid login'
do
it
'blocks invalid login'
do
user
=
create
(
:user
,
password:
'not-the-default'
)
user
=
create
(
:user
,
password:
'not-the-default'
)
login_with
(
user
)
gitlab_sign_in
(
user
)
expect
(
page
).
to
have_content
(
'Invalid Login or password.'
)
expect
(
page
).
to
have_content
(
'Invalid Login or password.'
)
end
end
end
end
...
@@ -209,7 +209,7 @@ feature 'Login', feature: true do
...
@@ -209,7 +209,7 @@ feature 'Login', feature: true do
context
'with grace period defined'
do
context
'with grace period defined'
do
before
do
before
do
stub_application_setting
(
two_factor_grace_period:
48
)
stub_application_setting
(
two_factor_grace_period:
48
)
login_with
(
user
)
gitlab_sign_in
(
user
)
end
end
context
'within the grace period'
do
context
'within the grace period'
do
...
@@ -246,7 +246,7 @@ feature 'Login', feature: true do
...
@@ -246,7 +246,7 @@ feature 'Login', feature: true do
context
'without grace period defined'
do
context
'without grace period defined'
do
before
do
before
do
stub_application_setting
(
two_factor_grace_period:
0
)
stub_application_setting
(
two_factor_grace_period:
0
)
login_with
(
user
)
gitlab_sign_in
(
user
)
end
end
it
'redirects to two-factor configuration page'
do
it
'redirects to two-factor configuration page'
do
...
@@ -269,7 +269,7 @@ feature 'Login', feature: true do
...
@@ -269,7 +269,7 @@ feature 'Login', feature: true do
context
'with grace period defined'
do
context
'with grace period defined'
do
before
do
before
do
stub_application_setting
(
two_factor_grace_period:
48
)
stub_application_setting
(
two_factor_grace_period:
48
)
login_with
(
user
)
gitlab_sign_in
(
user
)
end
end
context
'within the grace period'
do
context
'within the grace period'
do
...
@@ -310,7 +310,7 @@ feature 'Login', feature: true do
...
@@ -310,7 +310,7 @@ feature 'Login', feature: true do
context
'without grace period defined'
do
context
'without grace period defined'
do
before
do
before
do
stub_application_setting
(
two_factor_grace_period:
0
)
stub_application_setting
(
two_factor_grace_period:
0
)
login_with
(
user
)
gitlab_sign_in
(
user
)
end
end
it
'redirects to two-factor configuration page'
do
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
...
@@ -16,7 +16,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
describe
'merge-request-only commands'
do
describe
'merge-request-only commands'
do
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
end
...
@@ -52,7 +52,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
...
@@ -52,7 +52,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
before
do
before
do
project
.
team
<<
[
guest
,
:guest
]
project
.
team
<<
[
guest
,
:guest
]
logout
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
end
...
@@ -98,7 +98,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
...
@@ -98,7 +98,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
before
do
before
do
project
.
team
<<
[
guest
,
:guest
]
project
.
team
<<
[
guest
,
:guest
]
logout
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
end
...
@@ -127,7 +127,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
...
@@ -127,7 +127,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
before
do
before
do
logout
logout
another_project
.
team
<<
[
user
,
:master
]
another_project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
end
end
it
'changes target_branch in new merge_request'
do
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
...
@@ -182,7 +182,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do
before
do
before
do
project
.
team
<<
[
guest
,
:guest
]
project
.
team
<<
[
guest
,
:guest
]
logout
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
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
...
@@ -6,7 +6,7 @@ feature 'user browses project', feature: true, js: true do
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
visit
namespace_project_tree_path
(
project
.
namespace
,
project
,
project
.
default_branch
)
visit
namespace_project_tree_path
(
project
.
namespace
,
project
,
project
.
default_branch
)
end
end
...
...
spec/features/projects/jobs_spec.rb
View file @
018ed2c4
...
@@ -393,7 +393,7 @@ feature 'Jobs', :feature do
...
@@ -393,7 +393,7 @@ feature 'Jobs', :feature do
project
.
update
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
)
project
.
update
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
)
logout_direct
logout_direct
login_with
(
create
(
:user
))
gitlab_sign_in
(
create
(
:user
))
visit
namespace_project_job_path
(
project
.
namespace
,
project
,
job
)
visit
namespace_project_job_path
(
project
.
namespace
,
project
,
job
)
end
end
...
...
spec/features/projects_spec.rb
View file @
018ed2c4
...
@@ -39,7 +39,7 @@ feature 'Project', feature: true do
...
@@ -39,7 +39,7 @@ feature 'Project', feature: true do
let
(
:project
)
{
create
(
:empty_project
,
namespace:
user
.
namespace
)
}
let
(
:project
)
{
create
(
:empty_project
,
namespace:
user
.
namespace
)
}
before
do
before
do
login_with
user
gitlab_sign_in
user
create
(
:forked_project_link
,
forked_to_project:
project
)
create
(
:forked_project_link
,
forked_to_project:
project
)
visit
edit_namespace_project_path
(
project
.
namespace
,
project
)
visit
edit_namespace_project_path
(
project
.
namespace
,
project
)
end
end
...
@@ -60,7 +60,7 @@ feature 'Project', feature: true do
...
@@ -60,7 +60,7 @@ feature 'Project', feature: true do
let
(
:project
)
{
create
(
:empty_project
,
namespace:
user
.
namespace
,
name:
'project1'
)
}
let
(
:project
)
{
create
(
:empty_project
,
namespace:
user
.
namespace
,
name:
'project1'
)
}
before
do
before
do
login_with
(
user
)
gitlab_sign_in
(
user
)
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
visit
edit_namespace_project_path
(
project
.
namespace
,
project
)
visit
edit_namespace_project_path
(
project
.
namespace
,
project
)
end
end
...
@@ -79,7 +79,7 @@ feature 'Project', feature: true do
...
@@ -79,7 +79,7 @@ feature 'Project', feature: true do
let
(
:project
)
{
create
(
:empty_project
,
namespace:
user
.
namespace
)
}
let
(
:project
)
{
create
(
:empty_project
,
namespace:
user
.
namespace
)
}
before
do
before
do
login_with
(
user
)
gitlab_sign_in
(
user
)
project
.
add_user
(
user
,
Gitlab
::
Access
::
MASTER
)
project
.
add_user
(
user
,
Gitlab
::
Access
::
MASTER
)
visit
namespace_project_path
(
project
.
namespace
,
project
)
visit
namespace_project_path
(
project
.
namespace
,
project
)
end
end
...
@@ -98,7 +98,7 @@ feature 'Project', feature: true do
...
@@ -98,7 +98,7 @@ feature 'Project', feature: true do
context
'on issues page'
,
js:
true
do
context
'on issues page'
,
js:
true
do
before
do
before
do
login_with
(
user
)
gitlab_sign_in
(
user
)
project
.
add_user
(
user
,
Gitlab
::
Access
::
MASTER
)
project
.
add_user
(
user
,
Gitlab
::
Access
::
MASTER
)
project2
.
add_user
(
user
,
Gitlab
::
Access
::
MASTER
)
project2
.
add_user
(
user
,
Gitlab
::
Access
::
MASTER
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
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
...
@@ -9,7 +9,7 @@ describe "Search", feature: true do
let!
(
:issue2
)
{
create
(
:issue
,
project:
project
,
author:
user
)
}
let!
(
:issue2
)
{
create
(
:issue
,
project:
project
,
author:
user
)
}
before
do
before
do
login_with
(
user
)
gitlab_sign_in
(
user
)
project
.
team
<<
[
user
,
:reporter
]
project
.
team
<<
[
user
,
:reporter
]
visit
search_path
visit
search_path
end
end
...
...
spec/features/tags/master_creates_tag_spec.rb
View file @
018ed2c4
...
@@ -6,7 +6,7 @@ feature 'Master creates tag', feature: true do
...
@@ -6,7 +6,7 @@ feature 'Master creates tag', feature: true do
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
end
end
context
'from tag list'
do
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
...
@@ -6,7 +6,7 @@ feature 'Master deletes tag', feature: true do
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
visit
namespace_project_tags_path
(
project
.
namespace
,
project
)
visit
namespace_project_tags_path
(
project
.
namespace
,
project
)
end
end
...
...
spec/features/tags/master_updates_tag_spec.rb
View file @
018ed2c4
...
@@ -6,7 +6,7 @@ feature 'Master updates tag', feature: true do
...
@@ -6,7 +6,7 @@ feature 'Master updates tag', feature: true do
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
visit
namespace_project_tags_path
(
project
.
namespace
,
project
)
visit
namespace_project_tags_path
(
project
.
namespace
,
project
)
end
end
...
...
spec/features/tags/master_views_tags_spec.rb
View file @
018ed2c4
...
@@ -5,7 +5,7 @@ feature 'Master views tags', feature: true do
...
@@ -5,7 +5,7 @@ feature 'Master views tags', feature: true do
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
login_with
(
user
)
gitlab_sign_in
(
user
)
end
end
context
'when project has no tags'
do
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
...
@@ -55,7 +55,7 @@ feature 'Task Lists', feature: true do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user2
,
:guest
]
project
.
team
<<
[
user2
,
:guest
]
gitlab_sign_in
(
user
)
login_as
(
user
)
end
end
def
visit_issue
(
project
,
issue
)
def
visit_issue
(
project
,
issue
)
...
@@ -90,7 +90,7 @@ feature 'Task Lists', feature: true do
...
@@ -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"
)
expect
(
page
).
to
have_selector
(
".wiki .task-list .task-list-item .task-list-item-checkbox"
)
logout
(
:user
)
logout
(
:user
)
gitlab_sign_in
(
user2
)
login_as
(
user2
)
visit
current_path
visit
current_path
wait_for_requests
wait_for_requests
...
@@ -203,7 +203,7 @@ feature 'Task Lists', feature: true do
...
@@ -203,7 +203,7 @@ feature 'Task Lists', feature: true do
logout
(
:user
)
logout
(
:user
)
gitlab_sign_in
(
user2
)
login_as
(
user2
)
visit
current_path
visit
current_path
expect
(
page
).
not_to
have_selector
(
'.js-task-list-container'
)
expect
(
page
).
not_to
have_selector
(
'.js-task-list-container'
)
end
end
...
@@ -275,7 +275,7 @@ feature 'Task Lists', feature: true do
...
@@ -275,7 +275,7 @@ feature 'Task Lists', feature: true do
logout
(
:user
)
logout
(
:user
)
gitlab_sign_in
(
user2
)
login_as
(
user2
)
visit
current_path
visit
current_path
expect
(
page
).
not_to
have_selector
(
'.js-task-list-container'
)
expect
(
page
).
not_to
have_selector
(
'.js-task-list-container'
)
end
end
...
...
spec/features/u2f_spec.rb
View file @
018ed2c4
...
@@ -158,7 +158,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
...
@@ -158,7 +158,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
describe
"when 2FA via OTP is disabled"
do
describe
"when 2FA via OTP is disabled"
do
it
"allows logging in with the U2F device"
do
it
"allows logging in with the U2F device"
do
user
.
update_attribute
(
:otp_required_for_login
,
false
)
user
.
update_attribute
(
:otp_required_for_login
,
false
)
login_with
(
user
)
gitlab_sign_in
(
user
)
@u2f_device
.
respond_to_u2f_authentication
@u2f_device
.
respond_to_u2f_authentication
...
@@ -170,7 +170,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
...
@@ -170,7 +170,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
describe
"when 2FA via OTP is enabled"
do
describe
"when 2FA via OTP is enabled"
do
it
"allows logging in with the U2F device"
do
it
"allows logging in with the U2F device"
do
user
.
update_attribute
(
:otp_required_for_login
,
true
)
user
.
update_attribute
(
:otp_required_for_login
,
true
)
login_with
(
user
)
gitlab_sign_in
(
user
)
@u2f_device
.
respond_to_u2f_authentication
@u2f_device
.
respond_to_u2f_authentication
...
@@ -180,7 +180,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
...
@@ -180,7 +180,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
end
end
it
'persists remember_me value via hidden field'
do
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
@u2f_device
.
respond_to_u2f_authentication
expect
(
page
).
to
have_content
(
'We heard back from your U2F device'
)
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
...
@@ -308,7 +308,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
describe
'when no u2f device is registered'
do
describe
'when no u2f device is registered'
do
before
do
before
do
logout
logout
login_with
(
user
)
gitlab_sign_in
(
user
)
end
end
it
'shows the fallback otp code UI'
do
it
'shows the fallback otp code UI'
do
...
@@ -321,7 +321,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
...
@@ -321,7 +321,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
manage_two_factor_authentication
manage_two_factor_authentication
@u2f_device
=
register_u2f_device
@u2f_device
=
register_u2f_device
logout
logout
login_with
(
user
)
gitlab_sign_in
(
user
)
end
end
it
'provides a button that shows the fallback otp code UI'
do
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
...
@@ -24,7 +24,7 @@ feature 'Users', feature: true, js: true do
user
.
reload
user
.
reload
expect
(
user
.
reset_password_token
).
not_to
be_nil
expect
(
user
.
reset_password_token
).
not_to
be_nil
login_with
(
user
)
gitlab_sign_in
(
user
)
expect
(
current_path
).
to
eq
root_path
expect
(
current_path
).
to
eq
root_path
user
.
reload
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
...
@@ -17,7 +17,7 @@ shared_examples 'issuable record that supports quick actions in its description
project
.
team
<<
[
master
,
:master
]
project
.
team
<<
[
master
,
:master
]
project
.
team
<<
[
assignee
,
:developer
]
project
.
team
<<
[
assignee
,
:developer
]
project
.
team
<<
[
guest
,
:guest
]
project
.
team
<<
[
guest
,
:guest
]
login_with
(
master
)
gitlab_sign_in
(
master
)
end
end
after
do
after
do
...
@@ -106,7 +106,7 @@ shared_examples 'issuable record that supports quick actions in its description
...
@@ -106,7 +106,7 @@ shared_examples 'issuable record that supports quick actions in its description
context
"when current user cannot close
#{
issuable_type
}
"
do
context
"when current user cannot close
#{
issuable_type
}
"
do
before
do
before
do
logout
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
public_send
(
"namespace_project_
#{
issuable_type
}
_path"
,
project
.
namespace
,
project
,
issuable
)
visit
public_send
(
"namespace_project_
#{
issuable_type
}
_path"
,
project
.
namespace
,
project
,
issuable
)
end
end
...
@@ -141,7 +141,7 @@ shared_examples 'issuable record that supports quick actions in its description
...
@@ -141,7 +141,7 @@ shared_examples 'issuable record that supports quick actions in its description
context
"when current user cannot reopen
#{
issuable_type
}
"
do
context
"when current user cannot reopen
#{
issuable_type
}
"
do
before
do
before
do
logout
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
public_send
(
"namespace_project_
#{
issuable_type
}
_path"
,
project
.
namespace
,
project
,
issuable
)
visit
public_send
(
"namespace_project_
#{
issuable_type
}
_path"
,
project
.
namespace
,
project
,
issuable
)
end
end
...
@@ -171,7 +171,7 @@ shared_examples 'issuable record that supports quick actions in its description
...
@@ -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
context
"when current user cannot change title of
#{
issuable_type
}
"
do
before
do
before
do
logout
logout
login_with
(
guest
)
gitlab_sign_in
(
guest
)
visit
public_send
(
"namespace_project_
#{
issuable_type
}
_path"
,
project
.
namespace
,
project
,
issuable
)
visit
public_send
(
"namespace_project_
#{
issuable_type
}
_path"
,
project
.
namespace
,
project
,
issuable
)
end
end
...
...
spec/support/login_helpers.rb
View file @
018ed2c4
...
@@ -14,7 +14,7 @@ module LoginHelpers
...
@@ -14,7 +14,7 @@ module LoginHelpers
# # Provide an existing User record
# # Provide an existing User record
# user = create(:user)
# user = create(:user)
# gitlab_sign_in(user)
# gitlab_sign_in(user)
def
gitlab_sign_in
(
user_or_role
)
def
gitlab_sign_in
(
user_or_role
,
**
kwargs
)
@user
=
@user
=
if
user_or_role
.
is_a?
(
User
)
if
user_or_role
.
is_a?
(
User
)
user_or_role
user_or_role
...
@@ -22,7 +22,7 @@ module LoginHelpers
...
@@ -22,7 +22,7 @@ module LoginHelpers
create
(
user_or_role
)
create
(
user_or_role
)
end
end
gitlab_sign_in_with
(
@user
)
gitlab_sign_in_with
(
@user
,
**
kwargs
)
end
end
def
gitlab_sign_in_via
(
provider
,
user
,
uid
)
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