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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
e45fee4a
Commit
e45fee4a
authored
Mar 31, 2021
by
Abdul Wadood
Committed by
Rémy Coutable
Mar 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rails/SaveBang offenses in spec/features
Contributes to
https://gitlab.com/gitlab-org/gitlab/-/issues/220040
.
parent
7ffc8a86
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
41 additions
and
51 deletions
+41
-51
.rubocop_manual_todo.yml
.rubocop_manual_todo.yml
+0
-15
changelogs/unreleased/rails-save-bang-spec-features.yml
changelogs/unreleased/rails-save-bang-spec-features.yml
+5
-0
spec/features/calendar_spec.rb
spec/features/calendar_spec.rb
+1
-1
spec/features/commits_spec.rb
spec/features/commits_spec.rb
+1
-1
spec/features/error_tracking/user_sees_error_index_spec.rb
spec/features/error_tracking/user_sees_error_index_spec.rb
+1
-1
spec/features/groups/members/request_access_spec.rb
spec/features/groups/members/request_access_spec.rb
+1
-1
spec/features/profiles/emails_spec.rb
spec/features/profiles/emails_spec.rb
+4
-4
spec/features/profiles/password_spec.rb
spec/features/profiles/password_spec.rb
+1
-1
spec/features/profiles/personal_access_tokens_spec.rb
spec/features/profiles/personal_access_tokens_spec.rb
+1
-1
spec/features/runners_spec.rb
spec/features/runners_spec.rb
+3
-3
spec/features/security/project/internal_access_spec.rb
spec/features/security/project/internal_access_spec.rb
+6
-6
spec/features/security/project/private_access_spec.rb
spec/features/security/project/private_access_spec.rb
+7
-7
spec/features/security/project/public_access_spec.rb
spec/features/security/project/public_access_spec.rb
+6
-6
spec/features/users/login_spec.rb
spec/features/users/login_spec.rb
+1
-1
spec/features/users/show_spec.rb
spec/features/users/show_spec.rb
+3
-3
No files found.
.rubocop_manual_todo.yml
View file @
e45fee4a
...
...
@@ -197,16 +197,10 @@ Rails/SaveBang:
-
'
spec/features/admin/admin_sees_project_statistics_spec.rb'
-
'
spec/features/admin/admin_sees_projects_statistics_spec.rb'
-
'
spec/features/admin/admin_users_impersonation_tokens_spec.rb'
-
'
spec/features/boards/sidebar_spec.rb'
-
'
spec/features/calendar_spec.rb'
-
'
spec/features/commits_spec.rb'
-
'
spec/features/dashboard/datetime_on_tooltips_spec.rb'
-
'
spec/features/dashboard/issuables_counter_spec.rb'
-
'
spec/features/dashboard/project_member_activity_index_spec.rb'
-
'
spec/features/dashboard/projects_spec.rb'
-
'
spec/features/error_tracking/user_sees_error_index_spec.rb'
-
'
spec/features/groups/members/request_access_spec.rb'
-
'
spec/features/issuables/close_reopen_report_toggle_spec.rb'
-
'
spec/features/issues/bulk_assignment_labels_spec.rb'
-
'
spec/features/issues/gfm_autocomplete_spec.rb'
-
'
spec/features/issues/issue_sidebar_spec.rb'
...
...
@@ -217,9 +211,6 @@ Rails/SaveBang:
-
'
spec/features/issues/user_filters_issues_spec.rb'
-
'
spec/features/issues/user_sees_live_update_spec.rb'
-
'
spec/features/issues/user_sorts_issues_spec.rb'
-
'
spec/features/profiles/emails_spec.rb'
-
'
spec/features/profiles/password_spec.rb'
-
'
spec/features/profiles/personal_access_tokens_spec.rb'
-
'
spec/features/projects/features_visibility_spec.rb'
-
'
spec/features/projects/fork_spec.rb'
-
'
spec/features/projects/jobs_spec.rb'
...
...
@@ -236,12 +227,6 @@ Rails/SaveBang:
-
'
spec/features/projects/wiki/user_updates_wiki_page_spec.rb'
-
'
spec/features/projects/wiki/user_views_wiki_page_spec.rb'
-
'
spec/features/projects/wiki/users_views_asciidoc_page_with_includes_spec.rb'
-
'
spec/features/runners_spec.rb'
-
'
spec/features/security/project/internal_access_spec.rb'
-
'
spec/features/security/project/private_access_spec.rb'
-
'
spec/features/security/project/public_access_spec.rb'
-
'
spec/features/users/login_spec.rb'
-
'
spec/features/users/show_spec.rb'
-
'
spec/frontend/fixtures/issues.rb'
-
'
spec/frontend/fixtures/merge_requests.rb'
-
'
spec/graphql/mutations/merge_requests/set_locked_spec.rb'
...
...
changelogs/unreleased/rails-save-bang-spec-features.yml
0 → 100644
View file @
e45fee4a
---
title
:
Fix Rails/SaveBang rubocop offenses in spec/features/
merge_request
:
57907
author
:
Abdul Wadood @abdulwd
type
:
fixed
spec/features/calendar_spec.rb
View file @
e45fee4a
...
...
@@ -64,7 +64,7 @@ RSpec.describe 'Contributions Calendar', :js do
author_id:
user
.
id
}
Event
.
create
(
note_comment_params
)
Event
.
create
!
(
note_comment_params
)
end
def
selected_day_activities
(
visible:
true
)
...
...
spec/features/commits_spec.rb
View file @
e45fee4a
...
...
@@ -140,7 +140,7 @@ RSpec.describe 'Commits' do
context
'when accessing internal project with disallowed access'
,
:js
,
quarantine:
'https://gitlab.com/gitlab-org/gitlab/-/issues/299575'
do
before
do
project
.
update
(
project
.
update
!
(
visibility_level:
Gitlab
::
VisibilityLevel
::
INTERNAL
,
public_builds:
false
)
create
(
:ci_job_artifact
,
:archive
,
file:
artifacts_file
,
job:
build
)
...
...
spec/features/error_tracking/user_sees_error_index_spec.rb
View file @
e45fee4a
...
...
@@ -41,7 +41,7 @@ RSpec.describe 'View error index page', :js, :use_clean_rails_memory_store_cachi
context
'with error tracking settings disabled'
do
before
do
project_error_tracking_settings
.
update
(
enabled:
false
)
project_error_tracking_settings
.
update
!
(
enabled:
false
)
sign_in
(
project
.
owner
)
visit
project_error_tracking_index_path
(
project
)
...
...
spec/features/groups/members/request_access_spec.rb
View file @
e45fee4a
...
...
@@ -15,7 +15,7 @@ RSpec.describe 'Groups > Members > Request access' do
end
it
'request access feature is disabled'
do
group
.
update
(
request_access_enabled:
false
)
group
.
update
!
(
request_access_enabled:
false
)
visit
group_path
(
group
)
expect
(
page
).
not_to
have_content
'Request Access'
...
...
spec/features/profiles/emails_spec.rb
View file @
e45fee4a
...
...
@@ -43,7 +43,7 @@ RSpec.describe 'Profile > Emails' do
end
it
'user removes email'
do
user
.
emails
.
create
(
email:
'my@email.com'
)
user
.
emails
.
create
!
(
email:
'my@email.com'
)
visit
profile_emails_path
expect
(
page
).
to
have_content
(
"my@email.com"
)
...
...
@@ -52,7 +52,7 @@ RSpec.describe 'Profile > Emails' do
end
it
'user confirms email'
do
email
=
user
.
emails
.
create
(
email:
'my@email.com'
)
email
=
user
.
emails
.
create
!
(
email:
'my@email.com'
)
visit
profile_emails_path
expect
(
page
).
to
have_content
(
"
#{
email
.
email
}
Unverified"
)
...
...
@@ -64,7 +64,7 @@ RSpec.describe 'Profile > Emails' do
end
it
'user re-sends confirmation email'
do
email
=
user
.
emails
.
create
(
email:
'my@email.com'
)
email
=
user
.
emails
.
create
!
(
email:
'my@email.com'
)
visit
profile_emails_path
expect
{
click_link
(
"Resend confirmation email"
)
}.
to
have_enqueued_job
.
on_queue
(
'mailers'
)
...
...
@@ -72,7 +72,7 @@ RSpec.describe 'Profile > Emails' do
end
it
'old unconfirmed emails show Send Confirmation button'
do
email
=
user
.
emails
.
create
(
email:
'my@email.com'
)
email
=
user
.
emails
.
create
!
(
email:
'my@email.com'
)
email
.
update_attribute
(
:confirmation_sent_at
,
nil
)
visit
profile_emails_path
...
...
spec/features/profiles/password_spec.rb
View file @
e45fee4a
...
...
@@ -119,7 +119,7 @@ RSpec.describe 'Profile > Password' do
before
do
sign_in
(
user
)
user
.
update
(
password_expires_at:
1
.
hour
.
ago
)
user
.
update
!
(
password_expires_at:
1
.
hour
.
ago
)
user
.
identities
.
delete
expect
(
user
.
ldap_user?
).
to
eq
false
end
...
...
spec/features/profiles/personal_access_tokens_spec.rb
View file @
e45fee4a
...
...
@@ -95,7 +95,7 @@ RSpec.describe 'Profile > Personal Access Tokens', :js do
end
it
"removes expired tokens from 'active' section"
do
personal_access_token
.
update
(
expires_at:
5
.
days
.
ago
)
personal_access_token
.
update
!
(
expires_at:
5
.
days
.
ago
)
visit
profile_personal_access_tokens_path
expect
(
page
).
to
have_selector
(
".settings-message"
)
...
...
spec/features/runners_spec.rb
View file @
e45fee4a
...
...
@@ -92,7 +92,7 @@ RSpec.describe 'Runners' do
context
'when a runner has a tag'
do
before
do
specific_runner
.
update
(
tag_list:
[
'tag'
])
specific_runner
.
update
!
(
tag_list:
[
'tag'
])
end
it
'user edits runner not to run untagged jobs'
do
...
...
@@ -370,7 +370,7 @@ RSpec.describe 'Runners' do
context
'when a runner has a tag'
do
before
do
runner
.
update
(
tag_list:
[
'tag'
])
runner
.
update
!
(
tag_list:
[
'tag'
])
end
it
'user edits runner not to run untagged jobs'
do
...
...
@@ -450,7 +450,7 @@ RSpec.describe 'Runners' do
context
'when a runner has a tag'
do
before
do
runner
.
update
(
tag_list:
[
'tag'
])
runner
.
update
!
(
tag_list:
[
'tag'
])
end
it
'user edits runner not to run untagged jobs'
do
...
...
spec/features/security/project/internal_access_spec.rb
View file @
e45fee4a
...
...
@@ -356,7 +356,7 @@ RSpec.describe "Internal Project Access" do
context
"when allowed for public and internal"
do
before
do
project
.
update
(
public_builds:
true
)
project
.
update
!
(
public_builds:
true
)
end
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
...
...
@@ -372,7 +372,7 @@ RSpec.describe "Internal Project Access" do
context
"when disallowed for public and internal"
do
before
do
project
.
update
(
public_builds:
false
)
project
.
update
!
(
public_builds:
false
)
end
it
(
'is allowed for admin when admin mode is enabled'
,
:enable_admin_mode
)
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
...
...
@@ -396,7 +396,7 @@ RSpec.describe "Internal Project Access" do
context
"when allowed for public and internal"
do
before
do
project
.
update
(
public_builds:
true
)
project
.
update
!
(
public_builds:
true
)
end
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
...
...
@@ -412,7 +412,7 @@ RSpec.describe "Internal Project Access" do
context
"when disallowed for public and internal"
do
before
do
project
.
update
(
public_builds:
false
)
project
.
update
!
(
public_builds:
false
)
end
it
(
'is allowed for admin when admin mode is enabled'
,
:enable_admin_mode
)
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
...
...
@@ -436,7 +436,7 @@ RSpec.describe "Internal Project Access" do
context
'when allowed for public and internal'
do
before
do
project
.
update
(
public_builds:
true
)
project
.
update
!
(
public_builds:
true
)
end
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
...
...
@@ -452,7 +452,7 @@ RSpec.describe "Internal Project Access" do
context
'when disallowed for public and internal'
do
before
do
project
.
update
(
public_builds:
false
)
project
.
update
!
(
public_builds:
false
)
end
it
(
'is allowed for admin when admin mode is enabled'
,
:enable_admin_mode
)
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
...
...
spec/features/security/project/private_access_spec.rb
View file @
e45fee4a
...
...
@@ -319,7 +319,7 @@ RSpec.describe "Private Project Access" do
context
'when public builds is enabled'
do
before
do
project
.
update
(
public_builds:
true
)
project
.
update
!
(
public_builds:
true
)
end
it
{
is_expected
.
to
be_allowed_for
(
:guest
).
of
(
project
)
}
...
...
@@ -348,7 +348,7 @@ RSpec.describe "Private Project Access" do
context
'when public builds is enabled'
do
before
do
project
.
update
(
public_builds:
true
)
project
.
update
!
(
public_builds:
true
)
end
it
{
is_expected
.
to
be_allowed_for
(
:guest
).
of
(
project
)
}
...
...
@@ -375,7 +375,7 @@ RSpec.describe "Private Project Access" do
context
'when public builds is enabled'
do
before
do
project
.
update
(
public_builds:
true
)
project
.
update
!
(
public_builds:
true
)
end
it
{
is_expected
.
to
be_allowed_for
(
:guest
).
of
(
project
)
}
...
...
@@ -405,7 +405,7 @@ RSpec.describe "Private Project Access" do
context
'when public builds is enabled'
do
before
do
project
.
update
(
public_builds:
true
)
project
.
update
!
(
public_builds:
true
)
end
it
{
is_expected
.
to
be_allowed_for
(
:guest
).
of
(
project
)
}
...
...
@@ -414,7 +414,7 @@ RSpec.describe "Private Project Access" do
context
'when public buils are disabled'
do
before
do
project
.
public_builds
=
false
project
.
save
project
.
save
!
end
it
{
is_expected
.
to
be_denied_for
(
:guest
).
of
(
project
)
}
...
...
@@ -440,7 +440,7 @@ RSpec.describe "Private Project Access" do
context
'when public builds is enabled'
do
before
do
project
.
update
(
public_builds:
true
)
project
.
update
!
(
public_builds:
true
)
end
it
{
is_expected
.
to
be_allowed_for
(
:guest
).
of
(
project
)
}
...
...
@@ -448,7 +448,7 @@ RSpec.describe "Private Project Access" do
context
'when public builds is disabled'
do
before
do
project
.
update
(
public_builds:
false
)
project
.
update
!
(
public_builds:
false
)
end
it
{
is_expected
.
to
be_denied_for
(
:guest
).
of
(
project
)
}
...
...
spec/features/security/project/public_access_spec.rb
View file @
e45fee4a
...
...
@@ -164,7 +164,7 @@ RSpec.describe "Public Project Access" do
context
"when allowed for public"
do
before
do
project
.
update
(
public_builds:
true
)
project
.
update
!
(
public_builds:
true
)
end
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
...
...
@@ -180,7 +180,7 @@ RSpec.describe "Public Project Access" do
context
"when disallowed for public"
do
before
do
project
.
update
(
public_builds:
false
)
project
.
update
!
(
public_builds:
false
)
end
it
(
'is allowed for admin when admin mode is enabled'
,
:enable_admin_mode
)
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
...
...
@@ -204,7 +204,7 @@ RSpec.describe "Public Project Access" do
context
"when allowed for public"
do
before
do
project
.
update
(
public_builds:
true
)
project
.
update
!
(
public_builds:
true
)
end
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
...
...
@@ -220,7 +220,7 @@ RSpec.describe "Public Project Access" do
context
"when disallowed for public"
do
before
do
project
.
update
(
public_builds:
false
)
project
.
update
!
(
public_builds:
false
)
end
it
(
'is allowed for admin when admin mode is enabled'
,
:enable_admin_mode
)
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
...
...
@@ -244,7 +244,7 @@ RSpec.describe "Public Project Access" do
context
'when allowed for public'
do
before
do
project
.
update
(
public_builds:
true
)
project
.
update
!
(
public_builds:
true
)
end
it
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
...
...
@@ -260,7 +260,7 @@ RSpec.describe "Public Project Access" do
context
'when disallowed for public'
do
before
do
project
.
update
(
public_builds:
false
)
project
.
update
!
(
public_builds:
false
)
end
it
(
'is allowed for admin when admin mode is enabled'
,
:enable_admin_mode
)
{
is_expected
.
to
be_allowed_for
(
:admin
)
}
...
...
spec/features/users/login_spec.rb
View file @
e45fee4a
...
...
@@ -239,7 +239,7 @@ RSpec.describe 'Login' do
expect
(
codes
.
size
).
to
eq
10
# Ensure the generated codes get saved
user
.
save
(
touch:
false
)
user
.
save
!
(
touch:
false
)
end
context
'with valid code'
do
...
...
spec/features/users/show_spec.rb
View file @
e45fee4a
...
...
@@ -33,7 +33,7 @@ RSpec.describe 'User page' do
context
'work information'
do
it
'shows job title and organization details'
do
user
.
update
(
organization:
'GitLab - work info test'
,
job_title:
'Frontend Engineer'
)
user
.
update
!
(
organization:
'GitLab - work info test'
,
job_title:
'Frontend Engineer'
)
subject
...
...
@@ -41,7 +41,7 @@ RSpec.describe 'User page' do
end
it
'shows job title'
do
user
.
update
(
organization:
nil
,
job_title:
'Frontend Engineer - work info test'
)
user
.
update
!
(
organization:
nil
,
job_title:
'Frontend Engineer - work info test'
)
subject
...
...
@@ -49,7 +49,7 @@ RSpec.describe 'User page' do
end
it
'shows organization details'
do
user
.
update
(
organization:
'GitLab - work info test'
,
job_title:
''
)
user
.
update
!
(
organization:
'GitLab - work info test'
,
job_title:
''
)
subject
...
...
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