about summary refs log tree commit diff
path: root/spec/models/status_spec.rb
diff options
context:
space:
mode:
authorShel R <Yiskah.Raphen@gmail.com>2017-04-07 22:35:45 -0400
committerGitHub <noreply@github.com>2017-04-07 22:35:45 -0400
commitc945f29e96d537a827b95b3efb035ec8084576a1 (patch)
treedac7e26c482f0a69e00f031e771e58858e64b054 /spec/models/status_spec.rb
parentc62696bc467133869f6b1d39b923135b0e64900f (diff)
parent0d4d42dce6e7b0856469317da9e039ec5dc431b1 (diff)
Merge branch 'master' into patch-1
Diffstat (limited to 'spec/models/status_spec.rb')
-rw-r--r--spec/models/status_spec.rb25
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