diff options
author | Shel R <Yiskah.Raphen@gmail.com> | 2017-04-07 22:47:42 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-07 22:47:42 -0400 |
commit | d6827e38a6cc7f4639991384f097f37254de15be (patch) | |
tree | de5e1e93826fe049e0690e3ccb4ccdb3c1d20152 /spec/models/status_spec.rb | |
parent | 0c4e9fdda051d0322608c9abdaa158529c8feacd (diff) | |
parent | 29ed4484458fc62b423eeaef772ca0d67b27c4e4 (diff) |
Merge branch 'master' into patch-4
Diffstat (limited to 'spec/models/status_spec.rb')
-rw-r--r-- | spec/models/status_spec.rb | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/spec/models/status_spec.rb b/spec/models/status_spec.rb index b9d079521..000bee0f5 100644 --- a/spec/models/status_spec.rb +++ b/spec/models/status_spec.rb @@ -91,10 +91,31 @@ RSpec.describe Status, type: :model do end describe '#reblogs_count' do - pending + it 'is the number of reblogs' do + Fabricate(:status, account: bob, reblog: subject) + Fabricate(:status, account: alice, reblog: subject) + + expect(subject.reblogs_count).to eq 2 + end end describe '#favourites_count' do - pending + it 'is the number of favorites' do + Fabricate(:favourite, account: bob, status: subject) + Fabricate(:favourite, account: alice, status: subject) + + expect(subject.favourites_count).to eq 2 + end + end + + describe '#proper' do + it 'is itself for original statuses' do + expect(subject.proper).to eq subject + end + + it 'is the source status for reblogs' do + subject.reblog = other + expect(subject.proper).to eq other + end end end |