Commit 0e462768 authored by Michael Kozono's avatar Michael Kozono

Merge branch 'rails-save-bang-features-projects' into 'master'

Fix Rails/SaveBang offenses in spec/features/projects

See merge request gitlab-org/gitlab!57904
parents 3e27a0dc a762ff0d
...@@ -202,22 +202,6 @@ Rails/SaveBang: ...@@ -202,22 +202,6 @@ Rails/SaveBang:
- 'spec/features/issues/user_filters_issues_spec.rb' - 'spec/features/issues/user_filters_issues_spec.rb'
- 'spec/features/issues/user_sees_live_update_spec.rb' - 'spec/features/issues/user_sees_live_update_spec.rb'
- 'spec/features/issues/user_sorts_issues_spec.rb' - 'spec/features/issues/user_sorts_issues_spec.rb'
- 'spec/features/projects/features_visibility_spec.rb'
- 'spec/features/projects/fork_spec.rb'
- 'spec/features/projects/jobs_spec.rb'
- 'spec/features/projects/members/user_requests_access_spec.rb'
- 'spec/features/projects/pages_lets_encrypt_spec.rb'
- 'spec/features/projects/pages_spec.rb'
- 'spec/features/projects/pipelines/pipeline_spec.rb'
- 'spec/features/projects/pipelines/pipelines_spec.rb'
- 'spec/features/projects/remote_mirror_spec.rb'
- 'spec/features/projects/services/user_activates_slack_notifications_spec.rb'
- 'spec/features/projects/settings/access_tokens_spec.rb'
- 'spec/features/projects/show/user_sees_deletion_failure_message_spec.rb'
- 'spec/features/projects/user_sees_sidebar_spec.rb'
- '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/frontend/fixtures/issues.rb' - 'spec/frontend/fixtures/issues.rb'
- 'spec/frontend/fixtures/merge_requests.rb' - 'spec/frontend/fixtures/merge_requests.rb'
- 'spec/graphql/mutations/merge_requests/set_locked_spec.rb' - 'spec/graphql/mutations/merge_requests/set_locked_spec.rb'
......
---
title: Fix Rails/SaveBang rubocop offenses in spec/features/projects
merge_request: 57904
author: Abdul Wadood @abdulwd
type: fixed
...@@ -134,7 +134,7 @@ RSpec.describe 'Edit Project Settings' do ...@@ -134,7 +134,7 @@ RSpec.describe 'Edit Project Settings' do
it 'renders 200 if user is member of group' do it 'renders 200 if user is member of group' do
group = create(:group) group = create(:group)
project.group = group project.group = group
project.save project.save!
group.add_owner(member) group.add_owner(member)
......
...@@ -76,7 +76,7 @@ RSpec.describe 'Project fork' do ...@@ -76,7 +76,7 @@ RSpec.describe 'Project fork' do
let(:forking_access_level) { ProjectFeature::PRIVATE } let(:forking_access_level) { ProjectFeature::PRIVATE }
before do before do
project.update(visibility_level: Gitlab::VisibilityLevel::INTERNAL) project.update!(visibility_level: Gitlab::VisibilityLevel::INTERNAL)
end end
context 'user is not a team member' do context 'user is not a team member' do
......
...@@ -1057,7 +1057,7 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state do ...@@ -1057,7 +1057,7 @@ RSpec.describe 'Jobs', :clean_gitlab_redis_shared_state do
before do before do
job.run! job.run!
job.cancel! job.cancel!
project.update(visibility_level: Gitlab::VisibilityLevel::PUBLIC) project.update!(visibility_level: Gitlab::VisibilityLevel::PUBLIC)
sign_out(:user) sign_out(:user)
sign_in(create(:user)) sign_in(create(:user))
......
...@@ -13,7 +13,7 @@ RSpec.describe 'Projects > Members > User requests access', :js do ...@@ -13,7 +13,7 @@ RSpec.describe 'Projects > Members > User requests access', :js do
end end
it 'request access feature is disabled' do it 'request access feature is disabled' do
project.update(request_access_enabled: false) project.update!(request_access_enabled: false)
visit project_path(project) visit project_path(project)
expect(page).not_to have_content 'Request Access' expect(page).not_to have_content 'Request Access'
......
...@@ -566,7 +566,7 @@ RSpec.describe 'Pipeline', :js do ...@@ -566,7 +566,7 @@ RSpec.describe 'Pipeline', :js do
end end
before do before do
pipeline.update(user: user) pipeline.update!(user: user)
end end
it 'shows the pipeline information' do it 'shows the pipeline information' do
...@@ -628,7 +628,7 @@ RSpec.describe 'Pipeline', :js do ...@@ -628,7 +628,7 @@ RSpec.describe 'Pipeline', :js do
context 'when user does not have access to read jobs' do context 'when user does not have access to read jobs' do
before do before do
project.update(public_builds: false) project.update!(public_builds: false)
end end
describe 'GET /:project/-/pipelines/:id' do describe 'GET /:project/-/pipelines/:id' do
...@@ -1185,7 +1185,7 @@ RSpec.describe 'Pipeline', :js do ...@@ -1185,7 +1185,7 @@ RSpec.describe 'Pipeline', :js do
let(:role) { :guest } let(:role) { :guest }
before do before do
project.update(public_builds: false) project.update!(public_builds: false)
end end
context 'when accessing failed jobs page' do context 'when accessing failed jobs page' do
......
...@@ -768,7 +768,7 @@ RSpec.describe 'Pipelines', :js do ...@@ -768,7 +768,7 @@ RSpec.describe 'Pipelines', :js do
describe 'user clicks the button' do describe 'user clicks the button' do
context 'when project already has jobs_cache_index' do context 'when project already has jobs_cache_index' do
before do before do
project.update(jobs_cache_index: 1) project.update!(jobs_cache_index: 1)
end end
it 'increments jobs_cache_index' do it 'increments jobs_cache_index' do
......
...@@ -15,7 +15,7 @@ RSpec.describe 'Project remote mirror', :feature do ...@@ -15,7 +15,7 @@ RSpec.describe 'Project remote mirror', :feature do
context 'when last_error is present but last_update_at is not' do context 'when last_error is present but last_update_at is not' do
it 'renders error message without timstamp' do it 'renders error message without timstamp' do
remote_mirror.update(last_error: 'Some new error', last_update_at: nil) remote_mirror.update!(last_error: 'Some new error', last_update_at: nil)
visit project_mirror_path(project) visit project_mirror_path(project)
...@@ -25,7 +25,7 @@ RSpec.describe 'Project remote mirror', :feature do ...@@ -25,7 +25,7 @@ RSpec.describe 'Project remote mirror', :feature do
context 'when last_error and last_update_at are present' do context 'when last_error and last_update_at are present' do
it 'renders error message with timestamp' do it 'renders error message with timestamp' do
remote_mirror.update(last_error: 'Some new error', last_update_at: Time.now - 5.minutes) remote_mirror.update!(last_error: 'Some new error', last_update_at: Time.now - 5.minutes)
visit project_mirror_path(project) visit project_mirror_path(project)
......
...@@ -25,7 +25,7 @@ RSpec.describe 'User activates Slack notifications', :js do ...@@ -25,7 +25,7 @@ RSpec.describe 'User activates Slack notifications', :js do
before do before do
service.fields service.fields
service.update( service.update!(
push_channel: 1, push_channel: 1,
issue_channel: 2, issue_channel: 2,
merge_request_channel: 3, merge_request_channel: 3,
......
...@@ -96,7 +96,7 @@ RSpec.describe 'Project > Settings > Access Tokens', :js do ...@@ -96,7 +96,7 @@ RSpec.describe 'Project > Settings > Access Tokens', :js do
end end
it 'removes expired tokens from active section' do it 'removes expired tokens from active section' do
project_access_token.update(expires_at: 5.days.ago) project_access_token.update!(expires_at: 5.days.ago)
visit project_settings_access_tokens_path(project) visit project_settings_access_tokens_path(project)
expect(page).to have_selector('.settings-message') expect(page).to have_selector('.settings-message')
......
...@@ -10,7 +10,7 @@ RSpec.describe 'Projects > Show > User sees a deletion failure message' do ...@@ -10,7 +10,7 @@ RSpec.describe 'Projects > Show > User sees a deletion failure message' do
end end
it 'shows error message if deletion for project fails' do it 'shows error message if deletion for project fails' do
project.update(delete_error: "Something went wrong", pending_delete: false) project.update!(delete_error: "Something went wrong", pending_delete: false)
visit project_path(project) visit project_path(project)
......
...@@ -208,7 +208,7 @@ RSpec.describe 'Projects > User sees sidebar' do ...@@ -208,7 +208,7 @@ RSpec.describe 'Projects > User sees sidebar' do
it 'shows build tab if builds are public' do it 'shows build tab if builds are public' do
project.public_builds = true project.public_builds = true
project.save project.save!
visit project_path(project) visit project_path(project)
......
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