xebec 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
@@ -69,8 +69,8 @@ module Xebec
69
69
  def render_nav_item(item)
70
70
  text = text_for_nav_item item
71
71
  href = href_for_nav_item item
72
- klass = is_current_nav_item?(item, href) ? 'current' : ''
73
- helper.content_tag :li, :class => klass do
72
+ options = is_current_nav_item?(item, href) ? { :class => :current } : {}
73
+ helper.content_tag :li, options do
74
74
  helper.link_to_unless_current text, href
75
75
  end
76
76
  end
@@ -74,7 +74,22 @@ class NavBarProxyTest < Test::Unit::TestCase
74
74
  end
75
75
  end
76
76
  end
77
-
77
+
78
+ context 'with a NavBar that has a navigation item not set as current' do
79
+ setup do
80
+ @bar.nav_item :foo, '/foo'
81
+ @bar.current = :baz
82
+ end
83
+ should 'render a navigation bar with the item not marked as current' do
84
+ assert_select_from @proxy.to_s, 'ul.navbar' do
85
+ assert_select 'li', 'Foo'
86
+ assert_select 'li.current', { :count => 0, :text=> 'Foo' }
87
+ end
88
+ end
89
+ should 'not render an empty "class" attribute' do
90
+ assert(!(/class\s*=\s*["']\s*["']/ === @proxy.to_s))
91
+ end
92
+ end
78
93
 
79
94
  context 'with a NavBar that has a navigation item declared as a name and URL' do
80
95
  setup do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xebec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Rosen