diff options
Diffstat (limited to 'spec/services/issues/update_service_spec.rb')
-rw-r--r-- | spec/services/issues/update_service_spec.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index 81fac33a3c7..b5811077acf 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -354,7 +354,7 @@ RSpec.describe Issues::UpdateService, :mailer do end it 'does not update assignee_id with unauthorized users' do - project.update(visibility_level: Gitlab::VisibilityLevel::PUBLIC) + project.update!(visibility_level: Gitlab::VisibilityLevel::PUBLIC) update_issue(confidential: true) non_member = create(:user) original_assignees = issue.assignees @@ -457,7 +457,7 @@ RSpec.describe Issues::UpdateService, :mailer do it 'sends notifications for subscribers of changed milestone', :sidekiq_might_not_need_inline do issue.milestone = create(:milestone, project: project) - issue.save + issue.save! perform_enqueued_jobs do update_issue(milestone_id: "") @@ -470,7 +470,7 @@ RSpec.describe Issues::UpdateService, :mailer do it 'clears milestone issue counters cache' do issue.milestone = create(:milestone, project: project) - issue.save + issue.save! expect_next_instance_of(Milestones::IssuesCountService, issue.milestone) do |service| expect(service).to receive(:delete_cache).and_call_original @@ -718,7 +718,7 @@ RSpec.describe Issues::UpdateService, :mailer do let(:params) { { label_ids: [label.id], add_label_ids: [label3.id] } } before do - issue.update(labels: [label2]) + issue.update!(labels: [label2]) end it 'replaces the labels with the ones in label_ids and adds those in add_label_ids' do @@ -730,7 +730,7 @@ RSpec.describe Issues::UpdateService, :mailer do let(:params) { { label_ids: [label.id, label2.id, label3.id], remove_label_ids: [label.id] } } before do - issue.update(labels: [label, label3]) + issue.update!(labels: [label, label3]) end it 'replaces the labels with the ones in label_ids and removes those in remove_label_ids' do @@ -742,7 +742,7 @@ RSpec.describe Issues::UpdateService, :mailer do let(:params) { { add_label_ids: [label3.id], remove_label_ids: [label.id] } } before do - issue.update(labels: [label]) + issue.update!(labels: [label]) end it 'adds the passed labels' do @@ -759,7 +759,7 @@ RSpec.describe Issues::UpdateService, :mailer do context 'for a label assigned to an issue' do it 'removes the label' do - issue.update(labels: [label]) + issue.update!(labels: [label]) expect(result.label_ids).to be_empty end @@ -808,7 +808,7 @@ RSpec.describe Issues::UpdateService, :mailer do levels.each do |level| it "does not update with unauthorized assignee when project is #{Gitlab::VisibilityLevel.level_name(level)}" do assignee = create(:user) - project.update(visibility_level: level) + project.update!(visibility_level: level) feature_visibility_attr = :"#{issue.model_name.plural}_access_level" project.project_feature.update_attribute(feature_visibility_attr, ProjectFeature::PRIVATE) |