Skip to content

Instantly share code, notes, and snippets.

@rodreegez
Created April 1, 2010 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodreegez/351900 to your computer and use it in GitHub Desktop.
Save rodreegez/351900 to your computer and use it in GitHub Desktop.
require 'pyrite_helper'
class SampleTest < Pyrite::PyriteTest
test "homepage" do
visit root_path # use rails roots, or "/some/path/to/page"
follow "A Link" # link label text
press "A Button" # press a button with the value "A Button"
click "#anything_else" # any other elements can be clicked using a CSS selector
wait_for :page_load # we don't wait automatically, because that causes problems
assert_text "some text you should see"
assert_no_text "some text you should not see"
assert_element "#h1:contains('something I should see')"
assert_no_element ".no_links_in_this_div_class a"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment