page_navigation 0.8 → 0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9fed5b23e25332d84fcbfea7eb49b03fb55e7a5
4
- data.tar.gz: 045317e8335c63ba4215b327bfe5b3bd24c3d105
3
+ metadata.gz: 4ebc2cb244eb336736f35d2bebd8ffe53070dd32
4
+ data.tar.gz: f04fc258fdb71e36343d247700258ad9da77cb40
5
5
  SHA512:
6
- metadata.gz: bb65f1c891e370783cb56234a0118088e1d737696f6ebc604e12b51cfa6eb5ea9a151189f84a349f72eb23581df9f4f3f1b3146e51416f897b7ec5d0cc0795a8
7
- data.tar.gz: 10b4624ea7f9ddc9c94561228b7e2c7fd42888e7246de65944a602dd52cf9f61ba62dffc30b0979994e52637f42e4ee9ddc18d4e79b5c94c344f50fcb85c6e9a
6
+ metadata.gz: f78f9d41851504fe576f033be34342b8d936449fd5a7460b064d353e22ecaedfbc3224391bf0c2e90928a73a1d98d72062413cd85fd66cef501a65cb4d48a124
7
+ data.tar.gz: d1d31040c6989a4d0a6029caa6f450a1a0363eed048984ae2c5a41c8b0d2685d639d71efd3d575476dcefcdefe3cc63c5a27cfc54bf7ba1f02b65623499927bf
data/ChangeLog CHANGED
@@ -1,4 +1,7 @@
1
- === Version 0.8 / 2013-4026
1
+ === Version 0.9 / 2013-05-03
2
+ * Added :from entry to navigate_to method call
3
+
4
+ === Version 0.8 / 2013-04-26
2
5
  * Added navigate_all method to navigate an entire route including the last page
3
6
 
4
7
  === Version 0.7 / 2013-2-27
@@ -55,12 +55,14 @@ module PageNavigation
55
55
  # @return [PageObject] the page you are navigating to
56
56
  #
57
57
  def navigate_to(page_cls, how = {:using => :default}, &block)
58
+ how[:using] = :default unless how[:using]
58
59
  path = path_for how
59
60
  to_index = find_index_for(path, page_cls)-1
60
61
  if to_index == -1
61
62
  return on(page_cls, &block)
62
63
  else
63
- navigate_through_pages(path[0..to_index])
64
+ start = how[:from] ? path.find_index { |entry| entry[0] == how[:from] } : 0
65
+ navigate_through_pages(path[start..to_index])
64
66
  end
65
67
  on(page_cls, &block)
66
68
  end
@@ -1,3 +1,3 @@
1
1
  module PageNavigation
2
- VERSION = "0.8"
2
+ VERSION = "0.9"
3
3
  end
@@ -145,4 +145,19 @@ describe PageNavigation do
145
145
  y_page.should_receive(:c_method)
146
146
  @navigator.navigate_all
147
147
  end
148
+
149
+ it "should be able to start in the middle of a route and proceed" do
150
+ TestNavigator.routes = {
151
+ :default => [[FactoryTestPage, :a_method],
152
+ [AnotherPage, :b_method],
153
+ [YetAnotherPage, :c_method]]
154
+ }
155
+ a_page = AnotherPage.new
156
+ y_page = YetAnotherPage.new
157
+ AnotherPage.should_receive(:new).and_return(a_page)
158
+ a_page.should_receive(:respond_to?).with(:b_method).and_return(true)
159
+ a_page.should_receive(:b_method)
160
+ YetAnotherPage.should_receive(:new).and_return(y_page)
161
+ @navigator.navigate_to(YetAnotherPage, :from => AnotherPage)
162
+ end
148
163
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: page_navigation
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.8'
4
+ version: '0.9'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey S. Morgan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-27 00:00:00.000000000 Z
11
+ date: 2013-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: data_magic