simple-navigation 3.10.0 → 3.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/VERSION +1 -1
- data/lib/simple_navigation/adapters/padrino.rb +2 -2
- data/lib/simple_navigation/rendering/renderer/breadcrumbs.rb +1 -1
- data/spec/lib/simple_navigation/adapters/padrino_spec.rb +3 -1
- data/spec/lib/simple_navigation/rails_controller_methods_spec.rb +1 -1
- data/spec/lib/simple_navigation/rendering/helpers_spec.rb +5 -5
- metadata +2 -2
data/CHANGELOG
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.10.
|
1
|
+
3.10.1
|
@@ -8,11 +8,11 @@ module SimpleNavigation
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def link_to(name, url, options={})
|
11
|
-
context.link_to
|
11
|
+
context.link_to(name, url, options)
|
12
12
|
end
|
13
13
|
|
14
14
|
def content_tag(type, content, options={})
|
15
|
-
context.content_tag
|
15
|
+
context.content_tag(type, content.html_safe, options)
|
16
16
|
end
|
17
17
|
|
18
18
|
end
|
@@ -22,7 +22,7 @@ module SimpleNavigation
|
|
22
22
|
def a_tags(item_container)
|
23
23
|
item_container.items.inject([]) do |list, item|
|
24
24
|
if item.selected?
|
25
|
-
list << tag_for(item)
|
25
|
+
list << tag_for(item)
|
26
26
|
if include_sub_navigation?(item)
|
27
27
|
list.concat a_tags(item.sub_navigation)
|
28
28
|
end
|
@@ -8,6 +8,7 @@ describe SimpleNavigation::Adapters::Padrino do
|
|
8
8
|
|
9
9
|
before(:each) do
|
10
10
|
@request = stub(:request)
|
11
|
+
@content = stub(:content)
|
11
12
|
@context = stub(:context, :request => @request)
|
12
13
|
@adapter = create_adapter
|
13
14
|
end
|
@@ -21,8 +22,9 @@ describe SimpleNavigation::Adapters::Padrino do
|
|
21
22
|
|
22
23
|
describe 'content_tag' do
|
23
24
|
it "should delegate to context" do
|
25
|
+
@content.should_receive(:html_safe).and_return('content')
|
24
26
|
@context.should_receive(:content_tag).with('type', 'content', :my_option => true)
|
25
|
-
@adapter.content_tag('type',
|
27
|
+
@adapter.content_tag('type', @content, :my_option => true)
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
@@ -53,7 +53,7 @@ describe 'explicit navigation in rails' do
|
|
53
53
|
end
|
54
54
|
it 'should create an instance-method "sn_set_navigation" when being called' do
|
55
55
|
call_navigation(:key)
|
56
|
-
@controller.respond_to?(:sn_set_navigation).should be_true
|
56
|
+
@controller.respond_to?(:sn_set_navigation, true).should be_true
|
57
57
|
end
|
58
58
|
it "the created method should not be public" do
|
59
59
|
call_navigation(:key)
|
@@ -89,10 +89,10 @@ describe SimpleNavigation::Helpers do
|
|
89
89
|
before(:each) do
|
90
90
|
select_item(:subnav1)
|
91
91
|
end
|
92
|
-
it {@controller.active_navigation_item(:level => 2).should
|
93
|
-
it {@controller.active_navigation_item.should
|
94
|
-
it {@controller.active_navigation_item(:level => 1).should
|
95
|
-
it {@controller.active_navigation_item(:level => :all).should
|
92
|
+
it {@controller.active_navigation_item(:level => 2).should eq(@subnav1_item)}
|
93
|
+
it {@controller.active_navigation_item.should eq(@subnav1_item)}
|
94
|
+
it {@controller.active_navigation_item(:level => 1).should eq(@invoices_item)}
|
95
|
+
it {@controller.active_navigation_item(:level => :all).should eq(@subnav1_item)}
|
96
96
|
end
|
97
97
|
context 'container does not have selected item' do
|
98
98
|
context 'return value defaults to nil' do
|
@@ -100,7 +100,7 @@ describe SimpleNavigation::Helpers do
|
|
100
100
|
end
|
101
101
|
context 'return value reflects passed in value' do
|
102
102
|
it {@controller.active_navigation_item({},'none').should == 'none'}
|
103
|
-
it {@controller.active_navigation_item({},@invoices_item).should
|
103
|
+
it {@controller.active_navigation_item({},@invoices_item).should eq(@invoices_item)}
|
104
104
|
end
|
105
105
|
end
|
106
106
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-navigation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.10.
|
4
|
+
version: 3.10.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-04-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|