diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-02-26 15:28:08 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-02-26 15:28:08 +0100 |
commit | f16b31f0773c2fd1122ff0ad98cb392e762f0d0b (patch) | |
tree | 24880b7ee107288e7acb540011281569e8502e96 /spec/models/stream_entry_spec.rb | |
parent | 44c5958203dd8d0f96f880a8014a3233719077a6 (diff) |
Adding a bunch of tests
Diffstat (limited to 'spec/models/stream_entry_spec.rb')
-rw-r--r-- | spec/models/stream_entry_spec.rb | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/spec/models/stream_entry_spec.rb b/spec/models/stream_entry_spec.rb index 6386cac0f..9ecf6412a 100644 --- a/spec/models/stream_entry_spec.rb +++ b/spec/models/stream_entry_spec.rb @@ -1,11 +1,43 @@ require 'rails_helper' RSpec.describe StreamEntry, type: :model do + let(:alice) { Fabricate(:account, username: 'alice') } + let(:bob) { Fabricate(:account, username: 'bob') } + let(:follow) { Fabricate(:follow, account: alice, target_account: bob) } + let(:status) { Fabricate(:status, account: alice) } + let(:reblog) { Fabricate(:status, account: bob, reblog: status) } + let(:reply) { Fabricate(:status, account: bob, thread: status) } + let(:favourite) { Fabricate(:favourite, account: alice, status: status) } + describe '#targeted?' do - pending + it 'returns true for a follow' do + expect(follow.stream_entry.targeted?).to be true + end + + it 'returns true for a favourite' do + expect(favourite.stream_entry.targeted?).to be true + end + + it 'returns true for a reblog' do + expect(reblog.stream_entry.targeted?).to be true + end + + it 'returns false otherwise' do + expect(status.stream_entry.targeted?).to be false + end end describe '#threaded?' do - pending + it 'returns true for a favourite' do + expect(favourite.stream_entry.threaded?).to be true + end + + it 'returns true for a reply' do + expect(reply.stream_entry.threaded?).to be true + end + + it 'returns false otherwise' do + expect(status.stream_entry.threaded?).to be false + end end end |