page_navigation 0.5 → 0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +3 -0
- data/lib/page_navigation/version.rb +1 -1
- data/lib/page_navigation.rb +1 -1
- data/spec/lib/page_navigation_spec.rb +11 -4
- metadata +4 -4
data/ChangeLog
CHANGED
data/lib/page_navigation.rb
CHANGED
@@ -77,7 +77,7 @@ module PageNavigation
|
|
77
77
|
#
|
78
78
|
def continue_navigation_to(page_cls, how = {:using => :default}, &block)
|
79
79
|
path = path_for how
|
80
|
-
from_index = find_index_for(path, @current_page.class)
|
80
|
+
from_index = find_index_for(path, @current_page.class)
|
81
81
|
to_index = find_index_for(path, page_cls)-1
|
82
82
|
if from_index == to_index
|
83
83
|
navigate_through_pages([path[from_index]])
|
@@ -81,6 +81,9 @@ describe PageNavigation do
|
|
81
81
|
@navigator.current_page = FactoryTestPage.new
|
82
82
|
f_page = FactoryTestPage.new
|
83
83
|
a_page = AnotherPage.new
|
84
|
+
FactoryTestPage.should_receive(:new).and_return(f_page)
|
85
|
+
f_page.should_receive(:respond_to?).with(:a_method).and_return(true)
|
86
|
+
f_page.should_receive(:a_method)
|
84
87
|
AnotherPage.should_receive(:new).and_return(a_page)
|
85
88
|
a_page.should_receive(:respond_to?).with(:b_method).and_return(true)
|
86
89
|
a_page.should_receive(:b_method)
|
@@ -94,10 +97,14 @@ describe PageNavigation do
|
|
94
97
|
[YetAnotherPage, :c_method]]
|
95
98
|
}
|
96
99
|
@navigator.current_page = FactoryTestPage.new
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
100
|
+
f_page = FactoryTestPage.new
|
101
|
+
FactoryTestPage.should_receive(:new).and_return(f_page)
|
102
|
+
f_page.should_receive(:respond_to?).with(:a_method).and_return(true)
|
103
|
+
f_page.should_receive(:a_method)
|
104
|
+
a_page = AnotherPage.new
|
105
|
+
AnotherPage.should_receive(:new).and_return(a_page)
|
106
|
+
a_page.should_receive(:respond_to?).with(:b_method).and_return(true)
|
107
|
+
a_page.should_receive(:b_method)
|
101
108
|
@navigator.continue_navigation_to(YetAnotherPage).class.should == YetAnotherPage
|
102
109
|
end
|
103
110
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: page_navigation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.6'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -64,7 +64,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
64
64
|
version: '0'
|
65
65
|
segments:
|
66
66
|
- 0
|
67
|
-
hash:
|
67
|
+
hash: 1167974702660734402
|
68
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
69
|
none: false
|
70
70
|
requirements:
|
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
73
|
version: '0'
|
74
74
|
segments:
|
75
75
|
- 0
|
76
|
-
hash:
|
76
|
+
hash: 1167974702660734402
|
77
77
|
requirements: []
|
78
78
|
rubyforge_project: page_naigation
|
79
79
|
rubygems_version: 1.8.24
|