diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4701ba7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: ruby -bundler_args: --jobs=3 --retry=3 -cache: - bundler: true -addons: - code_climate: - repo_token: b3db5b7df9a0a1d0fd3503e72d7431ffbfa172492c2840d590ccb2fafd9172d3 -rvm: - - 2.1.5 -env: - - MYSQL_USERNAME=travis - - APP_SECRET=2d3a08dfea079fe45bcb7f830b010eda -before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start -script: - - RAILS_ENV=test bundle exec rake db:create db:migrate db:test:prepare - - RAILS_ENV=test bundle exec rspec spec diff --git a/README.md b/README.md index 1165047..b7c9e71 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/ENSL/ensl.org.svg?branch=master)](https://travis-ci.org/ENSL/ensl.org) +[![Circle CI](https://circleci.com/gh/ENSL/ensl.org.svg?style=svg)](https://circleci.com/gh/ENSL/ensl.org) [![Code Climate](https://codeclimate.com/github/ENSL/ensl.org.png)](https://codeclimate.com/github/ENSL/ensl.org) [![Code Climate](https://codeclimate.com/github/ENSL/ensl.org/coverage.png)](https://codeclimate.com/github/ENSL/ensl.org) diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..4a2665c --- /dev/null +++ b/circle.yml @@ -0,0 +1,4 @@ +database: + override: + - mv config/database.circle.yml config/database.yml + - bundle exec rake db:create db:schema:load --trace diff --git a/config/database.circle.yml b/config/database.circle.yml new file mode 100644 index 0000000..59273a8 --- /dev/null +++ b/config/database.circle.yml @@ -0,0 +1,7 @@ +test: + socket: /var/run/mysqld/mysqld.sock + host: localhost + database: circle_ruby_test + adapter: mysql2 + encoding: utf8 + username: ubuntu diff --git a/spec/features/calendar/google_calendar_widget_spec.rb b/spec/features/calendar/google_calendar_widget_spec.rb index d0ed17f..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 @@ -75,7 +69,7 @@ feature 'Google Calendar widget', js: :true do end def timezone_adjusted - if Time.now.dst? + if Time.zone.now.dst? "14:30 EDT" else "15:30 EST" 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