Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-03 23:05:11 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-03 23:05:11 +0300
commitded30e3efe78360bd310be604d7723638c039a17 (patch)
tree78a6bf4f3bca115fd6e641ff7df17e780d047a72 /spec
parent8618277f24e9adeef28fe93dc23b39f7a5357c52 (diff)
parentee955d7a125f9d18ac7ae334542ae68dd8d5114c (diff)
Merge branch 'collapseable-nav' of https://github.com/jasonblanchard/gitlabhq into jasonblanchard-collapseable-nav
Diffstat (limited to 'spec')
-rw-r--r--spec/helpers/nav_helper_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/helpers/nav_helper_spec.rb b/spec/helpers/nav_helper_spec.rb
new file mode 100644
index 00000000000..e4d18d8bfc6
--- /dev/null
+++ b/spec/helpers/nav_helper_spec.rb
@@ -0,0 +1,25 @@
+require 'spec_helper'
+
+# Specs in this file have access to a helper object that includes
+# the NavHelper. For example:
+#
+# describe NavHelper do
+# describe "string concat" do
+# it "concats two strings with spaces" do
+# expect(helper.concat_strings("this","that")).to eq("this that")
+# end
+# end
+# end
+describe NavHelper do
+ describe '#nav_menu_collapsed?' do
+ it 'returns true when the nav is collapsed in the cookie' do
+ helper.request.cookies[:collapsed_nav] = 'true'
+ expect(helper.nav_menu_collapsed?).to eq true
+ end
+
+ it 'returns false when the nav is not collapsed in the cookie' do
+ helper.request.cookies[:collapsed_nav] = 'false'
+ expect(helper.nav_menu_collapsed?).to eq false
+ end
+ end
+end