diff --git a/spec/features/calendar/google_calendar_widget_spec.rb b/spec/features/calendar/google_calendar_widget_spec.rb index 0c605a7..c9082fb 100644 --- a/spec/features/calendar/google_calendar_widget_spec.rb +++ b/spec/features/calendar/google_calendar_widget_spec.rb @@ -1,13 +1,7 @@ require 'spec_helper' feature 'Google Calendar widget', js: :true do - let(:events_list_json) { JSON.parse(File.read(Rails.root.join('spec/fixtures/google_calendar.json'))) } - before do - GoogleCalendar::Request.stub(:events_list) do - GoogleCalendar::EventList.new(events_list_json, Time.zone.name) - end - visit root_path end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e13b83b..e31306e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -31,4 +31,12 @@ RSpec.configure do |config| config.fixture_path = "#{::Rails.root}/spec/fixtures" config.order = 'random' config.use_transactional_fixtures = false + + config.before(:each) do + events_list_json = JSON.parse(File.read(Rails.root.join('spec/fixtures/google_calendar.json'))) + + GoogleCalendar::Request.stub(:events_list) do + GoogleCalendar::EventList.new(events_list_json, Time.zone.name) + end + end end