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 CHANGED
@@ -1,3 +1,6 @@
1
+ === Version 0.6 / 2013-2-19
2
+ * Fixed continue_navigation_to to always start with @current_page
3
+
1
4
  === Version 0.5 / 2013-2-1
2
5
  * Fixed with continue_navigation_to not picking the page after @current_page
3
6
 
@@ -1,3 +1,3 @@
1
1
  module PageNavigation
2
- VERSION = "0.5"
2
+ VERSION = "0.6"
3
3
  end
@@ -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)+1
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
- fake_page = AnotherPage.new
98
- AnotherPage.should_receive(:new).and_return(fake_page)
99
- fake_page.should_receive(:respond_to?).with(:b_method).and_return(true)
100
- fake_page.should_receive(:b_method)
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.5'
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-02 00:00:00.000000000 Z
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: -3548323590874822099
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: -3548323590874822099
76
+ hash: 1167974702660734402
77
77
  requirements: []
78
78
  rubyforge_project: page_naigation
79
79
  rubygems_version: 1.8.24