diff options
Diffstat (limited to 'spec/models/award_emoji_spec.rb')
-rw-r--r-- | spec/models/award_emoji_spec.rb | 16 |
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 |