diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /spec/support/shared_examples/quick_actions/issuable | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) | |
download | gitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/support/shared_examples/quick_actions/issuable')
-rw-r--r-- | spec/support/shared_examples/quick_actions/issuable/issuable_quick_actions_shared_examples.rb | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/spec/support/shared_examples/quick_actions/issuable/issuable_quick_actions_shared_examples.rb b/spec/support/shared_examples/quick_actions/issuable/issuable_quick_actions_shared_examples.rb index b03da4471bc..50a8b81b518 100644 --- a/spec/support/shared_examples/quick_actions/issuable/issuable_quick_actions_shared_examples.rb +++ b/spec/support/shared_examples/quick_actions/issuable/issuable_quick_actions_shared_examples.rb @@ -18,6 +18,16 @@ RSpec.shared_examples 'issuable quick actions' do end end + let(:unlabel_expectation) do + ->(noteable, can_use_quick_action) { + if can_use_quick_action + expect(noteable.labels).to be_empty + else + expect(noteable.labels).not_to be_empty + end + } + end + # Quick actions shared by issues and merge requests let(:issuable_quick_actions) do [ @@ -136,13 +146,11 @@ RSpec.shared_examples 'issuable quick actions' do ), QuickAction.new( action_text: "/unlabel", - expectation: ->(noteable, can_use_quick_action) { - if can_use_quick_action - expect(noteable.labels).to be_empty - else - expect(noteable.labels).not_to be_empty - end - } + expectation: unlabel_expectation + ), + QuickAction.new( + action_text: "/remove_label", + expectation: unlabel_expectation ), QuickAction.new( action_text: "/award :100:", |