Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed issue when passing symbol to page_url and invoking multiple times

  • Loading branch information...
commit 9b6b112bc5484458b4552c448d884962d333d3f8 1 parent bdad691
@cheezy authored
View
4 ChangeLog
@@ -1,3 +1,7 @@
+=== Version 0.7.5.1
+* Fixes
+ * Fixed issue when passing symbol to page_url and calling multiple times
+
=== Version 0.7.5 / 2012-10-14
* Enhancements
* Enhanced TabeleCell to return nil when there is no corresponding cell for a referenced column
View
4 lib/page-object/accessors.rb
@@ -38,8 +38,8 @@ def params
#
def page_url(url)
define_method("goto") do
- url = url.kind_of?(Symbol) ? self.send(url) : url
- erb = ERB.new(%Q{#{url}})
+ lookup = url.kind_of?(Symbol) ? self.send(url) : url
+ erb = ERB.new(%Q{#{lookup}})
merged_params = self.class.instance_variable_get("@merged_params")
params = merged_params ? merged_params : self.class.params
platform.navigate_to erb.result(binding)
View
12 spec/page-object/watir_accessors_spec.rb
@@ -147,12 +147,18 @@ class WatirBlockPageObject
class SymbolPageUrl
include PageObject
page_url :custom_url
- def custom_url
- "custom"
+
+ attr_reader :custom_url
+ def initialize(b, v, url)
+ @custom_url = url
+ super(b, v)
end
end
watir_browser.should_receive(:goto).with('custom')
- SymbolPageUrl.new(watir_browser, true)
+ SymbolPageUrl.new(watir_browser, true, 'custom')
+
+ watir_browser.should_receive(:goto).with('different')
+ SymbolPageUrl.new(watir_browser, true, 'different')
end
it "should not navigate to a page when not requested" do
Please sign in to comment.
Something went wrong with that request. Please try again.