Skip to content

Instantly share code, notes, and snippets.

@mostlyobvious
Created June 30, 2011 11:02
Show Gist options
  • Save mostlyobvious/1056013 to your computer and use it in GitHub Desktop.
Save mostlyobvious/1056013 to your computer and use it in GitHub Desktop.
class WidgetsTest < Bbq::TestCase
scenario "old school" do
user = TestUser.new
user.visit root_url
user.within "#foo" do
user.see! "bar"
end
end
scenario "page components wrapped as widgets for the glory!" do
user = TestUser.new
user.visit root_url do |page|
widget = page.widget("#foo", Widget, :param => 'value')
assert widget.has?('stuff')
user.click(widget.last_element) # tricky, can redirect to new page
# where widget is not available
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment