Last active
December 12, 2015 06:18
-
-
Save bramhaghosh/4727857 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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