Commit 2c996a3d authored by Abdul Wadood's avatar Abdul Wadood

Fix Rails/SaveBang offenses for profile & projects controllers

Contributes to https://gitlab.com/gitlab-org/gitlab/-/issues/220040.
parent 66e5e658
......@@ -178,9 +178,6 @@ Rails/SaveBang:
- 'spec/controllers/groups/runners_controller_spec.rb'
- 'spec/controllers/groups/uploads_controller_spec.rb'
- 'spec/controllers/groups_controller_spec.rb'
- 'spec/controllers/profiles/emails_controller_spec.rb'
- 'spec/controllers/profiles/notifications_controller_spec.rb'
- 'spec/controllers/projects_controller_spec.rb'
- 'spec/controllers/sent_notifications_controller_spec.rb'
- 'spec/controllers/sessions_controller_spec.rb'
- 'spec/factories_spec.rb'
......
......@@ -5,8 +5,8 @@ require 'spec_helper'
RSpec.describe Profiles::NotificationsController do
let(:user) do
create(:user) do |user|
user.emails.create(email: 'original@example.com', confirmed_at: Time.current)
user.emails.create(email: 'new@example.com', confirmed_at: Time.current)
user.emails.create!(email: 'original@example.com', confirmed_at: Time.current)
user.emails.create!(email: 'new@example.com', confirmed_at: Time.current)
user.notification_email = 'original@example.com'
user.save!
end
......
......@@ -159,7 +159,7 @@ RSpec.describe ProjectsController do
before do
setting = user.notification_settings_for(public_project)
setting.level = :watch
setting.save
setting.save!
end
it "shows current notification setting" do
......@@ -237,7 +237,7 @@ RSpec.describe ProjectsController do
User.project_views.keys.each do |project_view|
context "with #{project_view} view set" do
before do
user.update(project_view: project_view)
user.update!(project_view: project_view)
get :show, params: { namespace_id: empty_project.namespace, id: empty_project }
end
......@@ -260,7 +260,7 @@ RSpec.describe ProjectsController do
User.project_views.keys.each do |project_view|
context "with #{project_view} view set" do
before do
user.update(project_view: project_view)
user.update!(project_view: project_view)
get :show, params: { namespace_id: empty_project.namespace, id: empty_project }
end
......
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