Fix timezones
This commit is contained in:
@@ -196,13 +196,13 @@ describe 'ConsulSchema' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'only returns date and hour for created_at' do
|
it 'only returns date and hour for created_at' do
|
||||||
created_at = Time.new(2017, 12, 31, 9, 30, 15).in_time_zone(Time.zone)
|
created_at = Time.zone.parse("2017-12-31 9:30:15")
|
||||||
create(:proposal, created_at: created_at)
|
create(:proposal, created_at: created_at)
|
||||||
|
|
||||||
response = execute('{ proposals { edges { node { public_created_at } } } }')
|
response = execute('{ proposals { edges { node { public_created_at } } } }')
|
||||||
received_timestamps = extract_fields(response, 'proposals', 'public_created_at')
|
received_timestamps = extract_fields(response, 'proposals', 'public_created_at')
|
||||||
|
|
||||||
expect(received_timestamps.first).to include('09:00:00')
|
expect(Time.zone.parse(received_timestamps.first)).to eq Time.zone.parse("2017-12-31 9:00:00")
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'only retruns tags with kind nil or category' do
|
it 'only retruns tags with kind nil or category' do
|
||||||
@@ -258,13 +258,13 @@ describe 'ConsulSchema' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'only returns date and hour for created_at' do
|
it 'only returns date and hour for created_at' do
|
||||||
created_at = Time.new(2017, 12, 31, 9, 30, 15).in_time_zone(Time.zone)
|
created_at = Time.zone.parse("2017-12-31 9:30:15")
|
||||||
create(:debate, created_at: created_at)
|
create(:debate, created_at: created_at)
|
||||||
|
|
||||||
response = execute('{ debates { edges { node { public_created_at } } } }')
|
response = execute('{ debates { edges { node { public_created_at } } } }')
|
||||||
received_timestamps = extract_fields(response, 'debates', 'public_created_at')
|
received_timestamps = extract_fields(response, 'debates', 'public_created_at')
|
||||||
|
|
||||||
expect(received_timestamps.first).to include('09:00:00')
|
expect(Time.zone.parse(received_timestamps.first)).to eq Time.zone.parse("2017-12-31 9:00:00")
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'only retruns tags with kind nil or category' do
|
it 'only retruns tags with kind nil or category' do
|
||||||
@@ -378,13 +378,13 @@ describe 'ConsulSchema' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'only returns date and hour for created_at' do
|
it 'only returns date and hour for created_at' do
|
||||||
created_at = Time.new(2017, 12, 31, 9, 30, 15).in_time_zone(Time.zone)
|
created_at = Time.zone.parse("2017-12-31 9:30:15")
|
||||||
create(:comment, created_at: created_at)
|
create(:comment, created_at: created_at)
|
||||||
|
|
||||||
response = execute('{ comments { edges { node { public_created_at } } } }')
|
response = execute('{ comments { edges { node { public_created_at } } } }')
|
||||||
received_timestamps = extract_fields(response, 'comments', 'public_created_at')
|
received_timestamps = extract_fields(response, 'comments', 'public_created_at')
|
||||||
|
|
||||||
expect(received_timestamps.first).to include('09:00:00')
|
expect(Time.zone.parse(received_timestamps.first)).to eq Time.zone.parse("2017-12-31 9:00:00")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -426,13 +426,13 @@ describe 'ConsulSchema' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'only returns date and hour for created_at' do
|
it 'only returns date and hour for created_at' do
|
||||||
created_at = Time.new(2017, 12, 31, 9, 30, 15).in_time_zone(Time.zone)
|
created_at = Time.zone.parse("2017-12-31 9:30:15")
|
||||||
create(:proposal_notification, created_at: created_at)
|
create(:proposal_notification, created_at: created_at)
|
||||||
|
|
||||||
response = execute('{ proposal_notifications { edges { node { public_created_at } } } }')
|
response = execute('{ proposal_notifications { edges { node { public_created_at } } } }')
|
||||||
received_timestamps = extract_fields(response, 'proposal_notifications', 'public_created_at')
|
received_timestamps = extract_fields(response, 'proposal_notifications', 'public_created_at')
|
||||||
|
|
||||||
expect(received_timestamps.first).to include('09:00:00')
|
expect(Time.zone.parse(received_timestamps.first)).to eq Time.zone.parse("2017-12-31 9:00:00")
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'only links proposal if public' do
|
it 'only links proposal if public' do
|
||||||
@@ -660,13 +660,13 @@ describe 'ConsulSchema' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'only returns date and hour for created_at' do
|
it 'only returns date and hour for created_at' do
|
||||||
created_at = Time.new(2017, 12, 31, 9, 30, 15).in_time_zone(Time.zone)
|
created_at = Time.zone.parse("2017-12-31 9:30:15")
|
||||||
create(:vote, created_at: created_at)
|
create(:vote, created_at: created_at)
|
||||||
|
|
||||||
response = execute('{ votes { edges { node { public_created_at } } } }')
|
response = execute('{ votes { edges { node { public_created_at } } } }')
|
||||||
received_timestamps = extract_fields(response, 'votes', 'public_created_at')
|
received_timestamps = extract_fields(response, 'votes', 'public_created_at')
|
||||||
|
|
||||||
expect(received_timestamps.first).to include('09:00:00')
|
expect(Time.zone.parse(received_timestamps.first)).to eq Time.zone.parse("2017-12-31 9:00:00")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user