about summary refs log tree commit diff
path: root/spec/models
diff options
context:
space:
mode:
authorJoël Quenneville <joelq@thoughtbot.com>2017-04-07 15:30:36 -0400
committerJoël Quenneville <joelq@thoughtbot.com>2017-04-07 15:36:06 -0400
commit4fdeac21f4520c5fffb06b1143bf4b1ac88d8533 (patch)
treed44b76eecc069e7860453d2a46ffdf4cdaa34cbc /spec/models
parent4e41cd9ab8f51120d558b70528b163c98993be53 (diff)
Implement pending specs on Status
Implement the two pending specs on `Status`: `reblogs_count` and
`favourites_count`.
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/status_spec.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/models/status_spec.rb b/spec/models/status_spec.rb
index b9d079521..675e18418 100644
--- a/spec/models/status_spec.rb
+++ b/spec/models/status_spec.rb
@@ -91,10 +91,20 @@ 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
 end