about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorysksn <bluewhale1982@gmail.com>2018-12-21 16:59:56 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-12-21 08:59:56 +0100
commit1bc78ec50e1ce80ce0b5dea5fb98ba812852c6b5 (patch)
tree86d302df692bc51ce7e8e0c13e03b96d739bbb0b /spec
parent240c1227671f5b6e269f82754cd5bacada07a005 (diff)
Add specs for InstancePresenter (#9596)
Diffstat (limited to 'spec')
-rw-r--r--spec/presenters/instance_presenter_spec.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/presenters/instance_presenter_spec.rb b/spec/presenters/instance_presenter_spec.rb
index 006403925..0babc1b0c 100644
--- a/spec/presenters/instance_presenter_spec.rb
+++ b/spec/presenters/instance_presenter_spec.rb
@@ -111,4 +111,37 @@ describe InstancePresenter do
       expect(instance_presenter.domain_count).to eq(345)
     end
   end
+
+  describe '#version_number' do
+    it 'returns Mastodon::Version' do
+      expect(instance_presenter.version_number).to be(Mastodon::Version)
+    end
+  end
+
+  describe '#source_url' do
+    it 'returns "https://github.com/tootsuite/mastodon"' do
+      expect(instance_presenter.source_url).to eq('https://github.com/tootsuite/mastodon')
+    end
+  end
+
+  describe '#thumbnail' do
+    it 'returns SiteUpload' do
+      thumbnail = Fabricate(:site_upload, var: 'thumbnail')
+      expect(instance_presenter.thumbnail).to eq(thumbnail)
+    end
+  end
+
+  describe '#hero' do
+    it 'returns SiteUpload' do
+      hero = Fabricate(:site_upload, var: 'hero')
+      expect(instance_presenter.hero).to eq(hero)
+    end
+  end
+
+  describe '#mascot' do
+    it 'returns SiteUpload' do
+      mascot = Fabricate(:site_upload, var: 'mascot')
+      expect(instance_presenter.mascot).to eq(mascot)
+    end
+  end
 end