diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-11-24 11:25:23 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-11-25 13:45:34 +0100 |
commit | 0ba03d7eb1d80e019b9b8266f0e14356d32e7d69 (patch) | |
tree | 32d52b34bc6bf447d45bc8c19bd1e7bd4fb422a1 /spec/models/event_spec.rb | |
parent | 5371da341e9d7768ebab8e159b3e2cc8fad1d827 (diff) | |
download | gitlab-ce-0ba03d7eb1d80e019b9b8266f0e14356d32e7d69.tar.gz |
Removed data-user-is view codeevents-cache-invalidation
With events no longer being cached this is no longer needed.
Diffstat (limited to 'spec/models/event_spec.rb')
-rw-r--r-- | spec/models/event_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb index b684053cd02..f8660da031d 100644 --- a/spec/models/event_spec.rb +++ b/spec/models/event_spec.rb @@ -260,6 +260,24 @@ describe Event, models: true do end end + describe '#authored_by?' do + let(:event) { build(:event) } + + it 'returns true when the event author and user are the same' do + expect(event.authored_by?(event.author)).to eq(true) + end + + it 'returns false when passing nil as an argument' do + expect(event.authored_by?(nil)).to eq(false) + end + + it 'returns false when the given user is not the author of the event' do + user = double(:user, id: -1) + + expect(event.authored_by?(user)).to eq(false) + end + end + def create_event(project, user, attrs = {}) data = { before: Gitlab::Git::BLANK_SHA, |