Skip to content

Commit

Permalink
Ignore nanoseconds when comparing times in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Byron committed Jan 11, 2012
1 parent d4c93ec commit cff9f8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions test/unit/assignment/exporter_test.rb
Expand Up @@ -34,9 +34,9 @@ class Assignment::ExporterTest < ActiveSupport::TestCase
data = @exporter.export
comment_data = data[:submissions].first[:comments].first

assert_equal comment.updated_at, comment_data[:updated_at]
assert_equal comment.user.name, comment_data[:user]
assert_equal comment.comment_text, comment_data[:comment_text]
assert_equal comment.updated_at.to_i, comment_data[:updated_at].to_i
assert_equal comment.user.name, comment_data[:user]
assert_equal comment.comment_text, comment_data[:comment_text]
end

test "exports activity details" do
Expand All @@ -46,9 +46,9 @@ class Assignment::ExporterTest < ActiveSupport::TestCase
data = @exporter.export
activity_data = data[:submissions].first[:activities].first

assert_equal activity.updated_at, activity_data[:updated_at]
assert_equal activity.user.name, activity_data[:user]
assert_equal activity.description, activity_data[:description]
assert_equal activity.updated_at.to_i, activity_data[:updated_at].to_i
assert_equal activity.user.name, activity_data[:user]
assert_equal activity.description, activity_data[:description]
end
end
end
4 changes: 2 additions & 2 deletions test/unit/assignment/submission_test.rb
Expand Up @@ -43,8 +43,8 @@ class Assignment::SubmissionTest < ActiveSupport::TestCase

activity = @submission.activities.last
assert_equal "committed: commit message", activity.description
assert_equal "commit id-commit message", activity.context
assert_equal @now, activity.created_at
assert_equal "commit id-commit message", activity.context
assert_equal @now.to_i, activity.created_at.to_i
end

end
Expand Down

0 comments on commit cff9f8c

Please sign in to comment.