Commit 3e27a0dc authored by Michael Kozono's avatar Michael Kozono

Merge branch 'rails-save-bang-profile-controller' into 'master'

Fix Rails/SaveBang offenses for profile & projects controllers

See merge request gitlab-org/gitlab!57890
parents 66e5e658 dfc9a292
......@@ -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'
......
---
title: Fix Rails/SaveBang rubocop offenses in profiles & projects controllers
merge_request: 57890
author: Abdul Wadood @abdulwd
type: fixed
......@@ -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