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/support/shared_examples/services/issuable_links')
-rw-r--r--spec/support/shared_examples/services/issuable_links/create_links_shared_examples.rb2
-rw-r--r--spec/support/shared_examples/services/issuable_links/destroyable_issuable_links_shared_examples.rb7
2 files changed, 5 insertions, 4 deletions
diff --git a/spec/support/shared_examples/services/issuable_links/create_links_shared_examples.rb b/spec/support/shared_examples/services/issuable_links/create_links_shared_examples.rb
index 12f2b5d78a5..e47ff2fcd59 100644
--- a/spec/support/shared_examples/services/issuable_links/create_links_shared_examples.rb
+++ b/spec/support/shared_examples/services/issuable_links/create_links_shared_examples.rb
@@ -30,7 +30,7 @@ RSpec.shared_examples 'issuable link creation' do
context 'when user has no permission to target issuable' do
let(:params) do
- { issuable_references: [guest_issuable.to_reference(issuable_parent)] }
+ { issuable_references: [restricted_issuable.to_reference(issuable_parent)] }
end
it 'returns error' do
diff --git a/spec/support/shared_examples/services/issuable_links/destroyable_issuable_links_shared_examples.rb b/spec/support/shared_examples/services/issuable_links/destroyable_issuable_links_shared_examples.rb
index cc170c6544d..1532e870dcc 100644
--- a/spec/support/shared_examples/services/issuable_links/destroyable_issuable_links_shared_examples.rb
+++ b/spec/support/shared_examples/services/issuable_links/destroyable_issuable_links_shared_examples.rb
@@ -1,10 +1,11 @@
# frozen_string_literal: true
-RSpec.shared_examples 'a destroyable issuable link' do
+RSpec.shared_examples 'a destroyable issuable link' do |required_role: :reporter|
context 'when successfully removes an issuable link' do
before do
- issuable_link.source.resource_parent.add_reporter(user)
- issuable_link.target.resource_parent.add_reporter(user)
+ [issuable_link.target, issuable_link.source].each do |issuable|
+ issuable.resource_parent.try(:"add_#{required_role}", user)
+ end
end
it 'removes related issue' do