summaryrefslogtreecommitdiff
path: root/spec/models/award_emoji_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 15:08:01 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 15:08:01 +0000
commit53b1f4eaa2a451aaba908a5fee7ce97a930021ac (patch)
tree66501ec0de9f529ee1cfc7cd6c4b481b1fc76662 /spec/models/award_emoji_spec.rb
parent684d65316ac77c62f47d68b9926eea8af30db227 (diff)
downloadgitlab-ce-53b1f4eaa2a451aaba908a5fee7ce97a930021ac.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/award_emoji_spec.rb')
-rw-r--r--spec/models/award_emoji_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/award_emoji_spec.rb b/spec/models/award_emoji_spec.rb
index b2d58dd95ad..8b370e80c9b 100644
--- a/spec/models/award_emoji_spec.rb
+++ b/spec/models/award_emoji_spec.rb
@@ -41,6 +41,22 @@ describe AwardEmoji do
expect(new_award).to be_valid
end
+
+ # Similar to allowing duplicate award emojis for ghost users,
+ # when Importing a project that has duplicate award emoji placed by
+ # ghost user we change the author to be importer user and allow
+ # duplicates, otherwise relation containing such duplicates
+ # fails to be created
+ context 'when importing' do
+ it 'allows duplicate award emoji' do
+ user = create(:user)
+ issue = create(:issue)
+ create(:award_emoji, user: user, awardable: issue)
+ new_award = build(:award_emoji, user: user, awardable: issue, importing: true)
+
+ expect(new_award).to be_valid
+ end
+ end
end
end