about summary refs log tree commit diff
path: root/spec/helpers
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-04-15 21:40:33 -0400
committerEugen <eugen@zeonfederated.com>2017-04-16 03:40:33 +0200
commit3834e1e69b951d5b26768282bf3bd1aae8f45944 (patch)
tree1d795beeef04604fdf73d8c4484990900823a451 /spec/helpers
parent95bcbaa4340fe54954c2f15300cbc585d4468c8d (diff)
View spec fix (#1888)
* Add option to disable verify partial doubles

* Add show_landing_strip? helper method

* Use show_landing_strip? helper in accounts and stream entries views

* Fix naming in view specs
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/application_helper_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index a2eeb443c..81f38d0b0 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -16,4 +16,33 @@ describe ApplicationHelper do
       expect(result).to eq ""
     end
   end
+
+  describe 'show_landing_strip?', without_verify_partial_doubles: true do
+    describe 'when signed in' do
+      before do
+        allow(helper).to receive(:user_signed_in?).and_return(true)
+      end
+      it 'does not show landing strip' do
+        expect(helper.show_landing_strip?).to eq false
+      end
+    end
+
+    describe 'when signed out' do
+      before do
+        allow(helper).to receive(:user_signed_in?).and_return(false)
+      end
+
+      it 'does not show landing strip on single user instance' do
+        allow(helper).to receive(:single_user_mode?).and_return(true)
+
+        expect(helper.show_landing_strip?).to eq false
+      end
+
+      it 'shows landing strip on multi user instance' do
+        allow(helper).to receive(:single_user_mode?).and_return(false)
+
+        expect(helper.show_landing_strip?).to eq true
+      end
+    end
+  end
 end