Created
September 5, 2010 17:32
-
-
Save evanfarrar/566187 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
class Main < Shoes | |
url '/', :index | |
url '/foo', :foo | |
url '/bar', :bar | |
def index | |
if !owner && !@child #If I am the parent and I have no child | |
@child = window(:title => 'child') | |
end | |
sync_child | |
para 'in index' | |
button 'go to foo' do | |
visit '/foo' | |
end | |
button 'go to bar' do | |
visit '/bar' | |
end | |
end | |
def foo | |
sync_child | |
para 'in foo' | |
button 'go to index' do | |
visit '/' | |
end | |
button 'go to bar' do | |
visit '/bar' | |
end | |
end | |
def bar | |
sync_child | |
para 'in bar' | |
button 'go to index' do | |
visit '/' | |
end | |
button 'go to foo' do | |
visit '/foo' | |
end | |
end | |
def sync_child | |
if !owner && @child | |
@child.sync_with_owner! | |
end | |
end | |
end | |
class Shoes::App | |
def sync_with_owner! | |
visit owner.location | |
end | |
end | |
Shoes.app(:title => 'parent') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment