Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/work_item_spec.rb')
-rw-r--r--spec/models/work_item_spec.rb21
1 files changed, 15 insertions, 6 deletions
diff --git a/spec/models/work_item_spec.rb b/spec/models/work_item_spec.rb
index e2240c225a9..341f9a9c60f 100644
--- a/spec/models/work_item_spec.rb
+++ b/spec/models/work_item_spec.rb
@@ -59,6 +59,14 @@ RSpec.describe WorkItem do
create(:work_item)
end
+
+ it_behaves_like 'issue_edit snowplow tracking' do
+ let(:work_item) { create(:work_item) }
+ let(:property) { Gitlab::UsageDataCounters::IssueActivityUniqueCounter::ISSUE_CREATED }
+ let(:project) { work_item.project }
+ let(:user) { work_item.author }
+ subject(:service_action) { work_item }
+ end
end
context 'work item namespace' do
@@ -123,8 +131,8 @@ RSpec.describe WorkItem do
child.confidential = false
expect(child).not_to be_valid
- expect(child.errors[:confidential])
- .to include('associated parent is confidential and can not have non-confidential children.')
+ expect(child.errors[:base])
+ .to include(_('A non-confidential work item cannot have a confidential parent.'))
end
it 'allows to make parent non-confidential' do
@@ -143,8 +151,9 @@ RSpec.describe WorkItem do
parent.confidential = true
expect(parent).not_to be_valid
- expect(parent.errors[:confidential])
- .to include('confidential parent can not be used if there are non-confidential children.')
+ expect(parent.errors[:base]).to include(
+ _('A confidential work item cannot have a parent that already has non-confidential children.')
+ )
end
it 'allows to make child confidential' do
@@ -161,8 +170,8 @@ RSpec.describe WorkItem do
child.work_item_parent = create(:work_item, confidential: true, project: project)
expect(child).not_to be_valid
- expect(child.errors[:confidential])
- .to include('associated parent is confidential and can not have non-confidential children.')
+ expect(child.errors[:base])
+ .to include('A non-confidential work item cannot have a confidential parent.')
end
end
end