summaryrefslogtreecommitdiff
path: root/spec/services/issuable
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/issuable')
-rw-r--r--spec/services/issuable/bulk_update_service_spec.rb30
-rw-r--r--spec/services/issuable/clone/attributes_rewriter_spec.rb2
-rw-r--r--spec/services/issuable/clone/content_rewriter_spec.rb2
-rw-r--r--spec/services/issuable/common_system_notes_service_spec.rb18
-rw-r--r--spec/services/issuable/destroy_service_spec.rb2
5 files changed, 27 insertions, 27 deletions
diff --git a/spec/services/issuable/bulk_update_service_spec.rb b/spec/services/issuable/bulk_update_service_spec.rb
index c791c454d70..168a80a97c0 100644
--- a/spec/services/issuable/bulk_update_service_spec.rb
+++ b/spec/services/issuable/bulk_update_service_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe Issuable::BulkUpdateService do
+RSpec.describe Issuable::BulkUpdateService do
let(:user) { create(:user) }
let(:project) { create(:project, :repository, namespace: user.namespace) }
@@ -18,8 +18,8 @@ describe Issuable::BulkUpdateService do
it 'succeeds' do
result = bulk_update(issuables, milestone_id: milestone.id)
- expect(result[:success]).to be_truthy
- expect(result[:count]).to eq(issuables.count)
+ expect(result.success?).to be_truthy
+ expect(result.payload[:count]).to eq(issuables.count)
end
it 'updates the issuables milestone' do
@@ -121,8 +121,8 @@ describe Issuable::BulkUpdateService do
it 'succeeds and returns the correct number of issues updated' do
result = bulk_update(issues, state_event: 'close')
- expect(result[:success]).to be_truthy
- expect(result[:count]).to eq(issues.count)
+ expect(result.success?).to be_truthy
+ expect(result.payload[:count]).to eq(issues.count)
end
it 'closes all the issues passed' do
@@ -139,8 +139,8 @@ describe Issuable::BulkUpdateService do
it 'succeeds and returns the correct number of issues updated' do
result = bulk_update(issues, state_event: 'reopen')
- expect(result[:success]).to be_truthy
- expect(result[:count]).to eq(issues.count)
+ expect(result.success?).to be_truthy
+ expect(result.payload[:count]).to eq(issues.count)
end
it 'reopens all the issues passed' do
@@ -161,8 +161,8 @@ describe Issuable::BulkUpdateService do
result = bulk_update(merge_request, assignee_ids: [user.id, new_assignee.id])
- expect(result[:success]).to be_truthy
- expect(result[:count]).to eq(1)
+ expect(result.success?).to be_truthy
+ expect(result.payload[:count]).to eq(1)
end
it 'updates the assignee to the user ID passed' do
@@ -199,8 +199,8 @@ describe Issuable::BulkUpdateService do
result = bulk_update(issue, assignee_ids: [new_assignee.id])
- expect(result[:success]).to be_truthy
- expect(result[:count]).to eq(1)
+ expect(result.success?).to be_truthy
+ expect(result.payload[:count]).to eq(1)
end
it 'updates the assignee to the user ID passed' do
@@ -273,8 +273,8 @@ describe Issuable::BulkUpdateService do
issue2 = create(:issue, project: create(:project))
result = bulk_update([issue1, issue2], assignee_ids: [user.id])
- expect(result[:success]).to be_truthy
- expect(result[:count]).to eq(1)
+ expect(result.success?).to be_truthy
+ expect(result.payload[:count]).to eq(1)
expect(issue1.reload.assignees).to eq([user])
expect(issue2.reload.assignees).to be_empty
@@ -332,8 +332,8 @@ describe Issuable::BulkUpdateService do
milestone = create(:milestone, group: group)
result = bulk_update([issue1, issue2, issue3], milestone_id: milestone.id)
- expect(result[:success]).to be_truthy
- expect(result[:count]).to eq(2)
+ expect(result.success?).to be_truthy
+ expect(result.payload[:count]).to eq(2)
expect(issue1.reload.milestone).to eq(milestone)
expect(issue2.reload.milestone).to be_nil
diff --git a/spec/services/issuable/clone/attributes_rewriter_spec.rb b/spec/services/issuable/clone/attributes_rewriter_spec.rb
index fb520f828fa..372e6d480e3 100644
--- a/spec/services/issuable/clone/attributes_rewriter_spec.rb
+++ b/spec/services/issuable/clone/attributes_rewriter_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe Issuable::Clone::AttributesRewriter do
+RSpec.describe Issuable::Clone::AttributesRewriter do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:project1) { create(:project, :public, group: group) }
diff --git a/spec/services/issuable/clone/content_rewriter_spec.rb b/spec/services/issuable/clone/content_rewriter_spec.rb
index 3479c20862a..f39439b7c2f 100644
--- a/spec/services/issuable/clone/content_rewriter_spec.rb
+++ b/spec/services/issuable/clone/content_rewriter_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe Issuable::Clone::ContentRewriter do
+RSpec.describe Issuable::Clone::ContentRewriter do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:project1) { create(:project, :public, group: group) }
diff --git a/spec/services/issuable/common_system_notes_service_spec.rb b/spec/services/issuable/common_system_notes_service_spec.rb
index 771e7ca42c9..daf4f68208e 100644
--- a/spec/services/issuable/common_system_notes_service_spec.rb
+++ b/spec/services/issuable/common_system_notes_service_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe Issuable::CommonSystemNotesService do
+RSpec.describe Issuable::CommonSystemNotesService do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
@@ -43,23 +43,23 @@ describe Issuable::CommonSystemNotesService do
it_behaves_like 'system note creation', {}, 'changed milestone'
end
- context 'with merge requests WIP note' do
- context 'adding WIP note' do
+ context 'with merge requests Draft note' do
+ context 'adding Draft note' do
let(:issuable) { create(:merge_request, title: "merge request") }
- it_behaves_like 'system note creation', { title: "WIP merge request" }, 'marked as a **Work In Progress**'
+ it_behaves_like 'system note creation', { title: "Draft: merge request" }, 'marked as a **Work In Progress**'
context 'and changing title' do
before do
- issuable.update_attribute(:title, "WIP changed title")
+ issuable.update_attribute(:title, "Draft: changed title")
end
- it_behaves_like 'WIP notes creation', 'marked'
+ it_behaves_like 'draft notes creation', 'marked'
end
end
- context 'removing WIP note' do
- let(:issuable) { create(:merge_request, title: "WIP merge request") }
+ context 'removing Draft note' do
+ let(:issuable) { create(:merge_request, title: "Draft: merge request") }
it_behaves_like 'system note creation', { title: "merge request" }, 'unmarked as a **Work In Progress**'
@@ -68,7 +68,7 @@ describe Issuable::CommonSystemNotesService do
issuable.update_attribute(:title, "changed title")
end
- it_behaves_like 'WIP notes creation', 'unmarked'
+ it_behaves_like 'draft notes creation', 'unmarked'
end
end
end
diff --git a/spec/services/issuable/destroy_service_spec.rb b/spec/services/issuable/destroy_service_spec.rb
index dd6a966c145..8d62932f986 100644
--- a/spec/services/issuable/destroy_service_spec.rb
+++ b/spec/services/issuable/destroy_service_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe Issuable::DestroyService do
+RSpec.describe Issuable::DestroyService do
let(:user) { create(:user) }
let(:project) { create(:project, :public) }