Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Last active August 29, 2015 14:08
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 practicingruby/fedf66069761d01be216 to your computer and use it in GitHub Desktop.
Save practicingruby/fedf66069761d01be216 to your computer and use it in GitHub Desktop.
# this code fills out a login form,
# finds and clicks a "clock in" button on the user's dashboard
# and then inspects an HTML table representing a week calendar
# view and ensures the right time shows up in the right place
scenario "clocking in" do
timestamp = Time.now.noon
day = timestamp.to_date.cwday
simulator.log_in(employee)
simulator.timesheet[day, 1].must_be :empty?
simulator.clock_in(timestamp)
simulator.timesheet[day, 1]
.must_equal(Formatter.time(timestamp).strip)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment