tracks/test/fixtures/projects.yml
Reinier Balt e58379e81f This fixes failing tests when the timezone is different than utc
There were several problems:
* Time.now returns the systems time, not the users time
* fixtures do not translate dates from timezone to utc, but stores the
  date verbatim
* calling a controller will set the timezone to the preference of the
  current_user. So it could be changed while you do not realize this. I
  fixed the failing test, but problems could be elsewhere
2015-08-05 11:50:33 +02:00

50 lines
1,015 B
YAML

# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
# Please note that dates in yml are not converted to utc timezone like
# rails does automatically in models or controllers! Convert to utc manually!
<%
def today
Time.zone.now.utc.beginning_of_day.to_s(:db)
end
%>
timemachine:
id: 1
name: Build a working time machine
description: ''
position: 1
state: 'active'
user_id: 1
created_at: <%= today %>
updated_at: <%= today %>
default_context_id: 5
moremoney:
id: 2
name: Make more money than Billy Gates
description: ''
position: 2
state: 'active'
user_id: 1
created_at: <%= today %>
updated_at: <%= today %>
gardenclean:
id: 3
name: Evict dinosaurs from the garden
description: ''
position: 3
state: 'active'
user_id: 1
created_at: <%= today %>
updated_at: <%= today %>
attendrailsconf:
id: 4
name: Attend RailsConf
description: ''
position: 1
state: 'active'
user_id: 2
created_at: <%= today %>
updated_at: <%= today %>