One commonly seen pattern with PageObjects is to check that the WebDriver is on the correct page when we instantiate the PageObject.
With the current approach, this is not possible. One of the reason is that the path method is a instance method instead of a class method. Otherwise, we could do modifications as such (draft):
def initialize
self.source.current_path.should == self.prefix + self.path
self
end
def self.visit(attr={})
Capybara.current_session.visit visit_path(attr)
new
end
One commonly seen pattern with PageObjects is to check that the WebDriver is on the correct page when we instantiate the PageObject.
With the current approach, this is not possible. One of the reason is that the path method is a instance method instead of a class method. Otherwise, we could do modifications as such (draft):
Ref: http://code.google.com/p/selenium/wiki/PageObjects