From e29f4d6dc2194cd85dc05327cd3430fc2dc8d590 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Wed, 27 Sep 2017 14:58:54 -0400 Subject: [PATCH] Replace PhantomJS and Ruby version --- .ruby-version | 2 +- .travis.yml | 3 -- Dockerfile | 5 ++-- Gemfile | 2 +- Gemfile.lock | 68 +++++++++++++++++++++++---------------------- spec/spec_helper.rb | 8 +++--- 6 files changed, 43 insertions(+), 45 deletions(-) diff --git a/.ruby-version b/.ruby-version index b1b25a5..0bee604 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.2.2 +2.3.3 diff --git a/.travis.yml b/.travis.yml index 3a25690..cfd4ebe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,5 @@ language: ruby before_script: - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" - - sleep 3 - RACK_ENV=test bundle exec rake db:create - RACK_ENV=test bundle exec rake db:migrate script: diff --git a/Dockerfile b/Dockerfile index 78605a4..0761335 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,11 @@ -FROM alpine:latest +FROM ruby:2.4.2-alpine RUN export LANG=en_US.UTF-8 && \ export LANGUAGE=en_US.UTF-8 && \ export LC_ALL=en_US.UTF-8 RUN apk update \ - && apk add build-base ruby-dev sqlite-dev ca-certificates \ - && apk add ruby ruby-bundler ruby-io-console \ + && apk add build-base sqlite-dev \ && rm -rf /var/cache/apk* WORKDIR /app diff --git a/Gemfile b/Gemfile index ad74e44..d423050 100644 --- a/Gemfile +++ b/Gemfile @@ -20,7 +20,7 @@ gem 'tzinfo-data' group :development do gem 'rspec' - gem 'capybara-webkit' + gem 'poltergeist' gem 'factory_girl' gem 'database_cleaner' gem 'launchy' diff --git a/Gemfile.lock b/Gemfile.lock index e5ead35..4e535d1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,13 +1,13 @@ GEM remote: https://rubygems.org/ specs: - activemodel (5.1.3) - activesupport (= 5.1.3) - activerecord (5.1.3) - activemodel (= 5.1.3) - activesupport (= 5.1.3) + activemodel (5.1.4) + activesupport (= 5.1.4) + activerecord (5.1.4) + activemodel (= 5.1.4) + activesupport (= 5.1.4) arel (~> 8.0) - activesupport (5.1.3) + activesupport (5.1.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (~> 0.7) minitest (~> 5.1) @@ -15,26 +15,24 @@ GEM addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) arel (8.0.0) - aws-sdk (2.10.39) - aws-sdk-resources (= 2.10.39) - aws-sdk-core (2.10.39) + aws-sdk (2.10.53) + aws-sdk-resources (= 2.10.53) + aws-sdk-core (2.10.53) aws-sigv4 (~> 1.0) jmespath (~> 1.0) - aws-sdk-resources (2.10.39) - aws-sdk-core (= 2.10.39) + aws-sdk-resources (2.10.53) + aws-sdk-core (= 2.10.53) aws-sigv4 (1.0.2) backports (3.8.0) bigdecimal (1.3.2) - capybara (2.13.0) + capybara (2.15.1) addressable - mime-types (>= 1.16) + mini_mime (>= 0.1.3) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) - capybara-webkit (1.14.0) - capybara (>= 2.3.0, < 2.14.0) - json + cliver (0.3.2) coderay (1.1.2) concurrent-ruby (1.0.5) database_cleaner (1.6.1) @@ -45,33 +43,34 @@ GEM ffi (1.9.18) i18n (0.8.6) jmespath (1.3.1) - json (2.1.0) launchy (2.4.3) addressable (~> 2.3) - listen (3.1.1) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9.7) - method_source (0.8.2) - mime-types (3.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) - mini_portile2 (2.2.0) + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) + method_source (0.9.0) + mini_mime (0.1.4) + mini_portile2 (2.3.0) minitest (5.10.3) multi_json (1.12.2) mustermann (1.0.1) - nokogiri (1.8.0) - mini_portile2 (~> 2.2.0) - pry (0.10.4) + nokogiri (1.8.1) + mini_portile2 (~> 2.3.0) + poltergeist (1.16.0) + capybara (~> 2.1) + cliver (~> 0.3.1) + websocket-driver (>= 0.2.0) + pry (0.11.1) coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) + method_source (~> 0.9.0) public_suffix (3.0.0) rack (2.0.3) rack-protection (2.0.0) rack rack-test (0.7.0) rack (>= 1.0, < 3) - rake (12.0.0) + rake (12.1.0) rb-fsevent (0.10.2) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) @@ -90,6 +89,7 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.6.0) rspec-support (3.6.0) + ruby_dep (1.5.0) sinatra (2.0.0) mustermann (~> 1.0) rack (~> 2.0) @@ -110,7 +110,6 @@ GEM slim (3.0.8) temple (>= 0.7.6, < 0.9) tilt (>= 1.3.3, < 2.1) - slop (3.6.0) sqlite3 (1.3.13) temple (0.8.0) thread_safe (0.3.6) @@ -122,6 +121,9 @@ GEM validate_url (1.0.2) activemodel (>= 3.0.0) addressable + websocket-driver (0.7.0) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.2) xpath (2.1.0) nokogiri (~> 1.3) @@ -132,11 +134,11 @@ DEPENDENCIES activerecord aws-sdk (~> 2) bigdecimal - capybara-webkit database_cleaner dotenv factory_girl launchy + poltergeist pry rake rerun diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4f7ca7e..3120baf 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,7 @@ require 'rack/test' require 'rspec' require 'capybara/rspec' -require 'capybara/webkit' +require 'capybara/poltergeist' require 'factory_girl' require 'database_cleaner' @@ -18,7 +18,7 @@ module TestingMixin include FactoryGirl::Syntax::Methods Capybara.app = Sinatra::Application - Capybara.javascript_driver = :webkit + Capybara.javascript_driver = :poltergeist Capybara.asset_host = 'http://localhost:3000' FactoryGirl.definition_file_paths = %w{./factories ./test/factories ./spec/factories} @@ -39,8 +39,8 @@ module TestingMixin end end -Capybara::Webkit.configure do |config| - config.allow_unknown_urls +Capybara.register_driver :poltergeist do |app| + Capybara::Poltergeist::Driver.new(app, js_errors: false) end RSpec.configure do |config|