Skip to content

Instantly share code, notes, and snippets.

@creich
Created October 25, 2012 14:58
Show Gist options
  • Save creich/3953095 to your computer and use it in GitHub Desktop.
Save creich/3953095 to your computer and use it in GitHub Desktop.
should "stop a TT correctly" do
assert_difference 'TimeTracker.count', -1 do
get :stop, {}, {"HTTP_REFERER" => "where_i_came_from"}
end
end
one:
id: 1
user_id: 2
started_on: 2012-10-25 11:47:03
comments: original comment
project_id: 1
issue_id: 1
round: false
two:
id: 2
user_id: 3
started_on: 2012-10-25 11:47:03 +0
comments: original comment
project_id: 1
issue_id: 1
round: false
should "stop a TT correctly" do
TimeTracker.delete_all
get :start
assert_equal(1, TimeTracker.count, "TimeTracker.count is 1")
tt = TimeTracker.first
assert_equal(2, tt.user_id, "user_id = 2")
assert_difference 'TimeTracker.count', -1 do
get :stop
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment