summaryrefslogtreecommitdiff
path: root/spec/helpers/tab_helper_spec.rb
diff options
context:
space:
mode:
authorJob van der Voort <jobvandervoort@gmail.com>2015-04-21 16:21:51 +0200
committerJob van der Voort <jobvandervoort@gmail.com>2015-04-21 16:21:51 +0200
commita8e93b7f51d968c1380ed210499869b62b07fd15 (patch)
treec864e80dfd9cf4f83fcede678acc986e3a125bf5 /spec/helpers/tab_helper_spec.rb
parent0625b15a481b3a3edd88110b3c18031ad9068d2f (diff)
downloadgitlab-ce-7.10.0.rc5.tar.gz
Version 7.10.0.rc5v7.10.0.rc5
Diffstat (limited to 'spec/helpers/tab_helper_spec.rb')
-rw-r--r--spec/helpers/tab_helper_spec.rb44
1 files changed, 0 insertions, 44 deletions
diff --git a/spec/helpers/tab_helper_spec.rb b/spec/helpers/tab_helper_spec.rb
deleted file mode 100644
index fc0ceecfbe7..00000000000
--- a/spec/helpers/tab_helper_spec.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require 'spec_helper'
-
-describe TabHelper do
- include ApplicationHelper
-
- describe 'nav_link' do
- before do
- allow(controller).to receive(:controller_name).and_return('foo')
- allow(self).to receive(:action_name).and_return('foo')
- end
-
- it "captures block output" do
- expect(nav_link { "Testing Blocks" }).to match(/Testing Blocks/)
- end
-
- it "performs checks on the current controller" do
- expect(nav_link(controller: :foo)).to match(/<li class="active">/)
- expect(nav_link(controller: :bar)).not_to match(/active/)
- expect(nav_link(controller: [:foo, :bar])).to match(/active/)
- end
-
- it "performs checks on the current action" do
- expect(nav_link(action: :foo)).to match(/<li class="active">/)
- expect(nav_link(action: :bar)).not_to match(/active/)
- expect(nav_link(action: [:foo, :bar])).to match(/active/)
- end
-
- it "performs checks on both controller and action when both are present" do
- expect(nav_link(controller: :bar, action: :foo)).not_to match(/active/)
- expect(nav_link(controller: :foo, action: :bar)).not_to match(/active/)
- expect(nav_link(controller: :foo, action: :foo)).to match(/active/)
- end
-
- it "accepts a path shorthand" do
- expect(nav_link(path: 'foo#bar')).not_to match(/active/)
- expect(nav_link(path: 'foo#foo')).to match(/active/)
- end
-
- it "passes extra html options to the list element" do
- expect(nav_link(action: :foo, html_options: {class: 'home'})).to match(/<li class="home active">/)
- expect(nav_link(html_options: {class: 'active'})).to match(/<li class="active">/)
- end
- end
-end