From 978f02083396c6408747b8d4e016629cd42d58c9 Mon Sep 17 00:00:00 2001 From: Luke Barratt Date: Sun, 12 Oct 2014 11:46:58 +0100 Subject: [PATCH] Remove hacky before hook. Specify js: :true for javascript driver tests explicitly. Attempt to cache bundler on travis again. --- .travis.yml | 8 +++----- spec/features/articles/new_article_spec.rb | 2 +- spec/features/calendar/google_calendar_widget_spec.rb | 2 +- spec/features/users/case_insensitive_login_spec.rb | 2 +- spec/features/users/user_signs_up_spec.rb | 2 +- spec/spec_helper.rb | 10 +--------- 6 files changed, 8 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index cb23732..4d1053c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,7 @@ language: ruby -cache: bundler -install: bundle install --jobs=3 --retry=3 +bundler_args: --jobs=3 --retry=3 cache: - directories: - - vendor/bundle + bundler: true addons: code_climate: repo_token: b3db5b7df9a0a1d0fd3503e72d7431ffbfa172492c2840d590ccb2fafd9172d3 @@ -15,4 +13,4 @@ before_script: - export DISPLAY=:99.0 script: - RAILS_ENV=test bundle exec rake db:create db:migrate db:test:prepare - - RAILS_ENV=test xvfb-run --server-args="-screen 0 1280x1024x24" bundle exec rspec spec \ No newline at end of file + - RAILS_ENV=test xvfb-run --server-args="-screen 0 1280x1024x24" bundle exec rspec spec diff --git a/spec/features/articles/new_article_spec.rb b/spec/features/articles/new_article_spec.rb index 4bcceae..d213833 100644 --- a/spec/features/articles/new_article_spec.rb +++ b/spec/features/articles/new_article_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'User creates new article' do +feature 'User creates new article', js: :true do let!(:category) { create(:category, domain: Category::DOMAIN_NEWS) } let(:article) { attributes_for(:article) } diff --git a/spec/features/calendar/google_calendar_widget_spec.rb b/spec/features/calendar/google_calendar_widget_spec.rb index feeca4c..d0ed17f 100644 --- a/spec/features/calendar/google_calendar_widget_spec.rb +++ b/spec/features/calendar/google_calendar_widget_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'Google Calendar widget' do +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 diff --git a/spec/features/users/case_insensitive_login_spec.rb b/spec/features/users/case_insensitive_login_spec.rb index 60806ae..e9c9ea1 100644 --- a/spec/features/users/case_insensitive_login_spec.rb +++ b/spec/features/users/case_insensitive_login_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'Case insensitive login' do +feature 'Case insensitive login', js: :true do let(:username) { "CaSe_InSeNsItIvE" } let(:password) { "passwordABC123" } let!(:user) { create(:user, username: username, raw_password: password) } diff --git a/spec/features/users/user_signs_up_spec.rb b/spec/features/users/user_signs_up_spec.rb index e871888..e73e0e3 100644 --- a/spec/features/users/user_signs_up_spec.rb +++ b/spec/features/users/user_signs_up_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -feature 'Visitor signs up' do +feature 'Visitor signs up', js: :true do let(:user) { attributes_for(:user) } before do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e8161f3..e13b83b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -18,7 +18,7 @@ Capybara.register_driver :poltergeist do |app| ) end -Capybara.javascript_driver = :selenium +Capybara.javascript_driver = :poltergeist Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } @@ -31,12 +31,4 @@ RSpec.configure do |config| config.fixture_path = "#{::Rails.root}/spec/fixtures" config.order = 'random' config.use_transactional_fixtures = false - - config.before(:each) do - if example.metadata[:type] == :feature - Capybara.current_driver = :poltergeist - else - Capybara.use_default_driver - end - end end