diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-05-08 21:15:58 +0400 |
---|---|---|
committer | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-05-31 01:19:50 +0400 |
commit | 2314438925af827b694fbaaf59c31c49dd2c0c31 (patch) | |
tree | d3c49a849926d88ff963a98dcb8a9e6597b85f19 | |
parent | d54d3324b1ae46a60712dbb974214e41fca5b93b (diff) |
Fix for failing specs
-rw-r--r-- | .travis.yml | 3 | ||||
-rw-r--r-- | Gemfile | 4 | ||||
-rw-r--r-- | Gemfile.lock | 24 | ||||
-rw-r--r-- | features/support/env.rb | 2 | ||||
-rw-r--r-- | spec/support/db_cleaner.rb | 31 |
5 files changed, 30 insertions, 34 deletions
diff --git a/.travis.yml b/.travis.yml index 9bab337f336..055a5217111 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,9 +15,6 @@ env: - TASK=jasmine:ci DB=postgresql before_install: - sudo apt-get install libicu-dev -y -branches: - only: - - 'master' rvm: - 2.0.0 services: @@ -199,7 +199,7 @@ group :development, :test do # gem 'rails-dev-tweaks' gem 'spinach-rails' gem "rspec-rails" - gem "capybara" + gem "capybara", '~> 2.2.1' gem "pry" gem "awesome_print" gem "database_cleaner" @@ -222,7 +222,7 @@ group :development, :test do gem 'rb-inotify', require: linux_only('rb-inotify') # PhantomJS driver for Capybara - gem 'poltergeist', '~> 1.4.1' + gem 'poltergeist', '~> 1.5.1' gem 'jasmine', '2.0.0.rc5' diff --git a/Gemfile.lock b/Gemfile.lock index 3def12c053c..7a72d3c3e82 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -47,7 +47,7 @@ GEM bootstrap-sass (3.0.3.0) sass (~> 3.2) builder (3.1.4) - capybara (2.1.0) + capybara (2.2.1) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) @@ -60,7 +60,7 @@ GEM celluloid (0.15.2) timers (~> 1.1.0) charlock_holmes (0.6.9.4) - cliver (0.2.2) + cliver (0.3.2) code_analyzer (0.4.3) sexp_processor coderay (1.1.0) @@ -281,9 +281,9 @@ GEM treetop (~> 1.4.8) method_source (0.8.2) mime-types (1.25.1) - mini_portile (0.5.3) + mini_portile (0.6.0) minitest (4.7.5) - multi_json (1.10.0) + multi_json (1.10.1) multi_xml (0.5.5) multipart-post (1.2.0) mysql2 (0.3.11) @@ -291,8 +291,8 @@ GEM net-scp (1.1.2) net-ssh (>= 2.6.5) net-ssh (2.8.0) - nokogiri (1.6.1) - mini_portile (~> 0.5.0) + nokogiri (1.6.2.1) + mini_portile (= 0.6.0) nprogress-rails (0.1.2.3) oauth (0.4.7) oauth2 (0.8.1) @@ -324,9 +324,9 @@ GEM orm_adapter (0.5.0) pg (0.15.1) phantomjs (1.9.2.0) - poltergeist (1.4.1) - capybara (~> 2.1.0) - cliver (~> 0.2.1) + poltergeist (1.5.1) + capybara (~> 2.1) + cliver (~> 0.3.1) multi_json (~> 1.0) websocket-driver (>= 0.2.0) polyglot (0.3.4) @@ -557,7 +557,7 @@ GEM webmock (1.16.0) addressable (>= 2.2.7) crack (>= 0.3.2) - websocket-driver (0.3.1) + websocket-driver (0.3.3) xpath (2.0.0) nokogiri (~> 1.3) @@ -573,7 +573,7 @@ DEPENDENCIES better_errors binding_of_caller bootstrap-sass (~> 3.0) - capybara + capybara (~> 2.2.1) carrierwave coffee-rails colored @@ -630,7 +630,7 @@ DEPENDENCIES omniauth-twitter org-ruby pg - poltergeist (~> 1.4.1) + poltergeist (~> 1.5.1) protected_attributes pry quiet_assets (~> 1.0.1) diff --git a/features/support/env.rb b/features/support/env.rb index a5b297775db..3ab2ce0a3e6 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -28,7 +28,7 @@ WebMock.allow_net_connect! require 'capybara/poltergeist' Capybara.javascript_driver = :poltergeist Capybara.register_driver :poltergeist do |app| - Capybara::Poltergeist::Driver.new(app, :js_errors => false, :timeout => 60) + Capybara::Poltergeist::Driver.new(app, js_errors: false, timeout: 90) end Spinach.hooks.on_tag("javascript") do ::Capybara.current_driver = ::Capybara.javascript_driver diff --git a/spec/support/db_cleaner.rb b/spec/support/db_cleaner.rb index 8c9c74f14bd..f2b310245bd 100644 --- a/spec/support/db_cleaner.rb +++ b/spec/support/db_cleaner.rb @@ -1,22 +1,21 @@ -require 'database_cleaner' - RSpec.configure do |config| - config.before do - if example.metadata[:js] - DatabaseCleaner.strategy = :truncation - Capybara::Selenium::Driver::DEFAULT_OPTIONS[:resynchronize] = true - else - DatabaseCleaner.strategy = :transaction - end + config.around(:each) do + DatabaseCleaner.clean_with(:truncation) + end + + config.around(:each) do + DatabaseCleaner.strategy = :transaction + end + + config.around(:each, js: true) do + DatabaseCleaner.strategy = :truncation + end - unless example.metadata[:no_db] - DatabaseCleaner.start - end + config.before(:each) do + DatabaseCleaner.start end - config.after do - unless example.metadata[:no_db] - DatabaseCleaner.clean - end + config.after(:each) do + DatabaseCleaner.clean end end |