Skip to content

Instantly share code, notes, and snippets.

@bramhaghosh
Last active December 12, 2015 06:18
Show Gist options
  • Save bramhaghosh/4727857 to your computer and use it in GitHub Desktop.
Save bramhaghosh/4727857 to your computer and use it in GitHub Desktop.
def current_page
#figure out where we currently are and return it
end
def on(page_class, &block=nil)
page_object = page_class.new
page_object.visit unless page_object.url.match(current_page) #or something...
block.call(page_object) if block
end
#allows you to do this
on Model::Page::Plugins::RawText::Editor do |editor|
editor.raw_text_value.set 'some value'
editor.save_changes.click
end
#instead of
@editor = Model::Page::Plugins::RawText::Editor.new
@editor.raw_text_value.set sharing_label
@editor.save_changes.click
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment