Commit 2ff3f4fb authored by Aleksei Lipniagov's avatar Aleksei Lipniagov

Merge branch 'issue_220040_11' into 'master'

Fix Rails/SaveBang offenses for spec/controllers/

See merge request gitlab-org/gitlab!75973
parents 478de5cf c75e8475
......@@ -67,10 +67,6 @@ Rails/SaveBang:
- qa/qa/specs/features/browser_ui/3_create/repository/push_mirroring_lfs_over_http_spec.rb
- qa/qa/specs/features/ee/browser_ui/3_create/repository/pull_mirroring_over_http_spec.rb
- qa/qa/specs/features/ee/browser_ui/3_create/repository/pull_mirroring_over_ssh_with_key_spec.rb
- spec/controllers/abuse_reports_controller_spec.rb
- spec/controllers/boards/issues_controller_spec.rb
- spec/controllers/sent_notifications_controller_spec.rb
- spec/controllers/sessions_controller_spec.rb
- spec/lib/backup/manager_spec.rb
- spec/lib/gitlab/alerting/alert_spec.rb
- spec/lib/gitlab/analytics/cycle_analytics/records_fetcher_spec.rb
......
......@@ -19,7 +19,7 @@ RSpec.describe AbuseReportsController do
context 'when the user has already been deleted' do
it 'redirects the reporter to root_path' do
user_id = user.id
user.destroy
user.destroy!
get :new, params: { user_id: user_id }
......
......@@ -484,7 +484,7 @@ RSpec.describe Boards::IssuesController do
context 'with guest user' do
context 'in open list' do
it 'returns a successful 200 response' do
open_list = board.lists.create(list_type: :backlog)
open_list = board.lists.create!(list_type: :backlog)
create_issue user: guest, board: board, list: open_list, title: 'New issue'
expect(response).to have_gitlab_http_status(:ok)
......
......@@ -10,19 +10,19 @@ RSpec.describe SentNotificationsController do
let(:issue) do
create(:issue, project: target_project) do |issue|
issue.subscriptions.create(user: user, project: target_project, subscribed: true)
issue.subscriptions.create!(user: user, project: target_project, subscribed: true)
end
end
let(:confidential_issue) do
create(:issue, project: target_project, confidential: true) do |issue|
issue.subscriptions.create(user: user, project: target_project, subscribed: true)
issue.subscriptions.create!(user: user, project: target_project, subscribed: true)
end
end
let(:merge_request) do
create(:merge_request, source_project: target_project, target_project: target_project) do |mr|
mr.subscriptions.create(user: user, project: target_project, subscribed: true)
mr.subscriptions.create!(user: user, project: target_project, subscribed: true)
end
end
......@@ -213,7 +213,7 @@ RSpec.describe SentNotificationsController do
context 'when the force param is not passed' do
let(:merge_request) do
create(:merge_request, source_project: project, author: user) do |merge_request|
merge_request.subscriptions.create(user: user, project: project, subscribed: true)
merge_request.subscriptions.create!(user: user, project: project, subscribed: true)
end
end
......
......@@ -403,7 +403,7 @@ RSpec.describe SessionsController do
context 'when the user is on their last attempt' do
before do
user.update(failed_attempts: User.maximum_attempts.pred)
user.update!(failed_attempts: User.maximum_attempts.pred)
end
context 'when OTP is valid' do
......
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