mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-26 12:30:48 +00:00
Fixes weird inconsistency causing a failed test using poltergeist on timecop
This commit is contained in:
parent
15763ae538
commit
b798c5b117
1 changed files with 4 additions and 3 deletions
|
@ -2,7 +2,6 @@ require 'spec_helper'
|
||||||
|
|
||||||
feature 'Google Calendar widget' do
|
feature 'Google Calendar widget' do
|
||||||
let(:events_list_json) { JSON.parse(File.read(Rails.root.join('spec/fixtures/google_calendar.json'))) }
|
let(:events_list_json) { JSON.parse(File.read(Rails.root.join('spec/fixtures/google_calendar.json'))) }
|
||||||
let!(:user) { create(:user) }
|
|
||||||
|
|
||||||
before do
|
before do
|
||||||
GoogleCalendar::Request.stub(:events_list) do
|
GoogleCalendar::Request.stub(:events_list) do
|
||||||
|
@ -56,10 +55,12 @@ feature 'Google Calendar widget' do
|
||||||
|
|
||||||
scenario 'when a user is logged in, their local timezone is used' do
|
scenario 'when a user is logged in, their local timezone is used' do
|
||||||
time = Time.zone.local(2014, 4, 1, 12, 0, 0)
|
time = Time.zone.local(2014, 4, 1, 12, 0, 0)
|
||||||
|
user = create(:user)
|
||||||
|
|
||||||
|
sign_in_as(user)
|
||||||
|
change_timezone_for(user, timezone_us_east)
|
||||||
|
|
||||||
Timecop.travel(time) do
|
Timecop.travel(time) do
|
||||||
sign_in_as(user)
|
|
||||||
change_timezone_for(user, timezone_us_east)
|
|
||||||
visit root_path
|
visit root_path
|
||||||
|
|
||||||
expect(first_event).to have_content(timezone_adjusted)
|
expect(first_event).to have_content(timezone_adjusted)
|
||||||
|
|
Loading…
Reference in a new issue