Commit b7f8b7cc650e13bb02d1a8d72eca1892f9ed150b

Authored by Joenio Costa
1 parent ef962840

using Date.current to take into account the Rails timezone

we must avoid using Date.today and DateTime.now in tests cases, they can
return yesterday or tomorrow depending on the machine's time zone and
ignores the configured Rails timezone

reference:
http://www.elabs.se/blog/36-working-with-time-zones-in-ruby-on-rails
Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
test/unit/person_test.rb
... ... @@ -1932,7 +1932,7 @@ class PersonTest < ActiveSupport::TestCase
1932 1932 community.add_member person
1933 1933  
1934 1934 assert !person.member_relation_of(community).empty?, "Person '#{person.identifier}' is not a member of Community '#{community.identifier}'"
1935   - assert person.member_since_date(community) == Date.today,"Person '#{person.identifier}' is not added like a member of Community '#{community.identifier}' today"
  1935 + assert_equal Date.current, person.member_since_date(community), "Person '#{person.identifier}' is not added like a member of Community '#{community.identifier}' today"
1936 1936 end
1937 1937  
1938 1938 should 'a person follows many articles' do
... ...