1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Switch out Poltergeist for Capybara Webkit

This commit is contained in:
Daniel Barber 2017-08-09 19:30:50 +01:00
parent 5baaccfe47
commit 966b936d3e
3 changed files with 120 additions and 113 deletions

89
Gemfile
View File

@ -1,68 +1,69 @@
source 'http://rubygems.org' source "http://rubygems.org"
ruby '2.4.1' ruby "2.4.1"
gem 'dotenv-rails', :groups => [:development, :test] gem "dotenv-rails", :groups => [:development, :test]
gem 'rails', '~> 5.1' gem "rails", "~> 5.1"
# Bundle edge Rails instead: # Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git' # gem "rails", :git => "git://github.com/rails/rails.git"
gem 'sass-rails' gem "sass-rails"
gem 'coffee-rails' gem "coffee-rails"
gem 'uglifier' gem "uglifier"
gem 'bourbon' gem "bourbon"
gem 'jquery-rails' gem "jquery-rails"
gem 'aws-sdk' gem "aws-sdk"
# Bundle gems for the local environment. Make sure to # Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators # put test-only gems in this group so their generators
# and rake tasks are available in development mode: # and rake tasks are available in development mode:
group :development do group :development do
gem 'ruby_parser' gem "ruby_parser"
gem 'powder' gem "powder"
gem 'better_errors' gem "better_errors"
gem 'binding_of_caller' gem "binding_of_caller"
gem 'letter_opener' gem "letter_opener"
end end
group :test, :development do group :test, :development do
gem 'rspec-rails' gem "rspec-rails"
gem 'rails-controller-testing' gem "rails-controller-testing"
gem 'rubocop' gem "rubocop"
gem 'pry' gem "pry"
end end
group :test do group :test do
gem 'factory_girl_rails' gem "capybara-screenshot"
gem 'shoulda' gem "capybara-webkit"
gem 'shoulda-context' gem "database_cleaner"
gem 'shoulda-matchers' gem "factory_girl_rails"
gem 'poltergeist' gem "fivemat"
gem 'database_cleaner' gem "headless"
gem 'fivemat' gem "shoulda"
gem 'capybara-screenshot' gem "shoulda-context"
gem 'simplecov' gem "shoulda-matchers"
gem "simplecov"
end end
group :production do group :production do
gem 'puma' gem "puma"
gem 'rails_12factor' gem "rails_12factor"
end end
gem 'administrate' gem "administrate"
gem 'administrate-field-image' gem "administrate-field-image"
gem 'dragonfly' gem "dragonfly"
gem 'dragonfly-s3_data_store' gem "dragonfly-s3_data_store"
gem 'kaminari' gem "kaminari"
gem 'monban' gem "monban"
gem 'monban-generators' gem "monban-generators"
gem 'nokogiri' gem "nokogiri"
gem 'pg' gem "pg"
gem 'kramdown' gem "kramdown"
gem 'simple_form' gem "simple_form"
gem 'slugtastic' gem "slugtastic"
gem 'unf' gem "unf"

View File

@ -1,39 +1,39 @@
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
actioncable (5.1.2) actioncable (5.1.3)
actionpack (= 5.1.2) actionpack (= 5.1.3)
nio4r (~> 2.0) nio4r (~> 2.0)
websocket-driver (~> 0.6.1) websocket-driver (~> 0.6.1)
actionmailer (5.1.2) actionmailer (5.1.3)
actionpack (= 5.1.2) actionpack (= 5.1.3)
actionview (= 5.1.2) actionview (= 5.1.3)
activejob (= 5.1.2) activejob (= 5.1.3)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
actionpack (5.1.2) actionpack (5.1.3)
actionview (= 5.1.2) actionview (= 5.1.3)
activesupport (= 5.1.2) activesupport (= 5.1.3)
rack (~> 2.0) rack (~> 2.0)
rack-test (~> 0.6.3) rack-test (~> 0.6.3)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2) rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.1.2) actionview (5.1.3)
activesupport (= 5.1.2) activesupport (= 5.1.3)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.4) erubi (~> 1.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3) rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.1.2) activejob (5.1.3)
activesupport (= 5.1.2) activesupport (= 5.1.3)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (5.1.2) activemodel (5.1.3)
activesupport (= 5.1.2) activesupport (= 5.1.3)
activerecord (5.1.2) activerecord (5.1.3)
activemodel (= 5.1.2) activemodel (= 5.1.3)
activesupport (= 5.1.2) activesupport (= 5.1.3)
arel (~> 8.0) arel (~> 8.0)
activesupport (5.1.2) activesupport (5.1.3)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7) i18n (~> 0.7)
minitest (~> 5.1) minitest (~> 5.1)
@ -55,20 +55,20 @@ GEM
administrate (>= 0.2.0.rc1) administrate (>= 0.2.0.rc1)
arel (8.0.0) arel (8.0.0)
ast (2.3.0) ast (2.3.0)
autoprefixer-rails (7.1.2.3) autoprefixer-rails (7.1.2.4)
execjs execjs
aws-sdk (2.10.13) aws-sdk (2.10.22)
aws-sdk-resources (= 2.10.13) aws-sdk-resources (= 2.10.22)
aws-sdk-core (2.10.13) aws-sdk-core (2.10.22)
aws-sigv4 (~> 1.0) aws-sigv4 (~> 1.0)
jmespath (~> 1.0) jmespath (~> 1.0)
aws-sdk-resources (2.10.13) aws-sdk-resources (2.10.22)
aws-sdk-core (= 2.10.13) aws-sdk-core (= 2.10.22)
aws-sigv4 (1.0.1) aws-sigv4 (1.0.1)
bcrypt (3.1.11) bcrypt (3.1.11)
better_errors (2.1.1) better_errors (2.3.0)
coderay (>= 1.0.0) coderay (>= 1.0.0)
erubis (>= 2.6.6) erubi (>= 1.0.0)
rack (>= 0.9.0) rack (>= 0.9.0)
binding_of_caller (0.7.2) binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1) debug_inspector (>= 0.0.1)
@ -76,7 +76,7 @@ GEM
sass (~> 3.4) sass (~> 3.4)
thor (~> 0.19) thor (~> 0.19)
builder (3.2.3) builder (3.2.3)
capybara (2.14.4) capybara (2.13.0)
addressable addressable
mime-types (>= 1.16) mime-types (>= 1.16)
nokogiri (>= 1.3.3) nokogiri (>= 1.3.3)
@ -86,7 +86,9 @@ GEM
capybara-screenshot (1.0.17) capybara-screenshot (1.0.17)
capybara (>= 1.0, < 3) capybara (>= 1.0, < 3)
launchy launchy
cliver (0.3.2) capybara-webkit (1.14.0)
capybara (>= 2.3.0, < 2.14.0)
json
coderay (1.1.1) coderay (1.1.1)
coffee-rails (4.2.2) coffee-rails (4.2.2)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
@ -114,8 +116,7 @@ GEM
dragonfly (~> 1.0) dragonfly (~> 1.0)
fog-aws fog-aws
erubi (1.6.1) erubi (1.6.1)
erubis (2.7.0) excon (0.58.0)
excon (0.57.1)
execjs (2.7.0) execjs (2.7.0)
factory_girl (4.8.0) factory_girl (4.8.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
@ -129,9 +130,9 @@ GEM
fog-json (~> 1.0) fog-json (~> 1.0)
fog-xml (~> 0.1) fog-xml (~> 0.1)
ipaddress (~> 0.8) ipaddress (~> 0.8)
fog-core (1.44.3) fog-core (1.45.0)
builder builder
excon (~> 0.49) excon (~> 0.58)
formatador (~> 0.2) formatador (~> 0.2)
fog-json (1.0.2) fog-json (1.0.2)
fog-core (~> 1.0) fog-core (~> 1.0)
@ -142,6 +143,7 @@ GEM
formatador (0.2.5) formatador (0.2.5)
globalid (0.4.0) globalid (0.4.0)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
headless (2.3.1)
i18n (0.8.6) i18n (0.8.6)
ipaddress (0.8.3) ipaddress (0.8.3)
jmespath (1.3.1) jmespath (1.3.1)
@ -176,7 +178,7 @@ GEM
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521) mime-types-data (3.2016.0521)
mini_portile2 (2.2.0) mini_portile2 (2.2.0)
minitest (5.10.2) minitest (5.10.3)
momentjs-rails (2.17.1) momentjs-rails (2.17.1)
railties (>= 3.1) railties (>= 3.1)
monban (1.1.0) monban (1.1.0)
@ -189,14 +191,10 @@ GEM
nio4r (2.1.0) nio4r (2.1.0)
nokogiri (1.8.0) nokogiri (1.8.0)
mini_portile2 (~> 2.2.0) mini_portile2 (~> 2.2.0)
parallel (1.11.2) parallel (1.12.0)
parser (2.4.0.0) parser (2.4.0.0)
ast (~> 2.2) ast (~> 2.2)
pg (0.21.0) pg (0.21.0)
poltergeist (1.15.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
websocket-driver (>= 0.2.0)
powder (0.3.2) powder (0.3.2)
thor (>= 0.11.5) thor (>= 0.11.5)
powerpack (0.1.1) powerpack (0.1.1)
@ -209,17 +207,17 @@ GEM
rack (2.0.3) rack (2.0.3)
rack-test (0.6.3) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
rails (5.1.2) rails (5.1.3)
actioncable (= 5.1.2) actioncable (= 5.1.3)
actionmailer (= 5.1.2) actionmailer (= 5.1.3)
actionpack (= 5.1.2) actionpack (= 5.1.3)
actionview (= 5.1.2) actionview (= 5.1.3)
activejob (= 5.1.2) activejob (= 5.1.3)
activemodel (= 5.1.2) activemodel (= 5.1.3)
activerecord (= 5.1.2) activerecord (= 5.1.3)
activesupport (= 5.1.2) activesupport (= 5.1.3)
bundler (>= 1.3.0, < 2.0) bundler (>= 1.3.0)
railties (= 5.1.2) railties (= 5.1.3)
sprockets-rails (>= 2.0.0) sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.2) rails-controller-testing (1.0.2)
actionpack (~> 5.x, >= 5.0.1) actionpack (~> 5.x, >= 5.0.1)
@ -235,9 +233,9 @@ GEM
rails_stdout_logging rails_stdout_logging
rails_serve_static_assets (0.0.5) rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5) rails_stdout_logging (0.0.5)
railties (5.1.2) railties (5.1.3)
actionpack (= 5.1.2) actionpack (= 5.1.3)
activesupport (= 5.1.2) activesupport (= 5.1.3)
method_source method_source
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0) thor (>= 0.18.1, < 2.0)
@ -272,7 +270,7 @@ GEM
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1) unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.8.1) ruby-progressbar (1.8.1)
ruby_parser (3.10.0) ruby_parser (3.10.1)
sexp_processor (~> 4.9) sexp_processor (~> 4.9)
sass (3.5.1) sass (3.5.1)
sass-listen (~> 4.0.0) sass-listen (~> 4.0.0)
@ -312,7 +310,7 @@ GEM
sprockets (>= 3.0.0) sprockets (>= 3.0.0)
thor (0.19.4) thor (0.19.4)
thread_safe (0.3.6) thread_safe (0.3.6)
tilt (2.0.7) tilt (2.0.8)
tzinfo (1.2.3) tzinfo (1.2.3)
thread_safe (~> 0.1) thread_safe (~> 0.1)
uglifier (3.2.0) uglifier (3.2.0)
@ -340,6 +338,7 @@ DEPENDENCIES
binding_of_caller binding_of_caller
bourbon bourbon
capybara-screenshot capybara-screenshot
capybara-webkit
coffee-rails coffee-rails
database_cleaner database_cleaner
dotenv-rails dotenv-rails
@ -347,6 +346,7 @@ DEPENDENCIES
dragonfly-s3_data_store dragonfly-s3_data_store
factory_girl_rails factory_girl_rails
fivemat fivemat
headless
jquery-rails jquery-rails
kaminari kaminari
kramdown kramdown
@ -355,7 +355,6 @@ DEPENDENCIES
monban-generators monban-generators
nokogiri nokogiri
pg pg
poltergeist
powder powder
pry pry
puma puma
@ -379,4 +378,4 @@ RUBY VERSION
ruby 2.4.1p111 ruby 2.4.1p111
BUNDLED WITH BUNDLED WITH
1.14.6 1.15.3

View File

@ -1,20 +1,22 @@
# This file is copied to spec/ when you run 'rails generate rspec:install' # This file is copied to spec/ when you run "rails generate rspec:install"
ENV['RAILS_ENV'] ||= 'test' ENV["RAILS_ENV"] ||= "test"
require File.expand_path('../../config/environment', __FILE__) require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails' require "rspec/rails"
require 'capybara/rspec' require "headless"
require 'capybara/poltergeist' require "capybara/rspec"
# For code coverage # For code coverage
require 'simplecov' require "simplecov"
SimpleCov.start SimpleCov.start
headless = Headless.new
# Use Poltergeist # Use Poltergeist
Capybara.javascript_driver = :poltergeist Capybara.javascript_driver = :webkit
# Requires supporting ruby files with custom matchers and macros, etc, # Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories. # in spec/support/ and its subdirectories.
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
RSpec.configure do |config| RSpec.configure do |config|
# ## Mock Framework # ## Mock Framework
@ -29,10 +31,10 @@ RSpec.configure do |config|
config.include FactoryGirl::Syntax::Methods config.include FactoryGirl::Syntax::Methods
config.include Ajax, type: :feature config.include Ajax, type: :feature
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures # Remove this line if you"re not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures" config.fixture_path = "#{::Rails.root}/spec/fixtures"
# If you're not using ActiveRecord, or you'd prefer not to run each of your # If you"re not using ActiveRecord, or you"d prefer not to run each of your
# examples within a transaction, remove the following line or assign false # examples within a transaction, remove the following line or assign false
# instead of true. # instead of true.
config.use_transactional_fixtures = false config.use_transactional_fixtures = false
@ -46,10 +48,15 @@ RSpec.configure do |config|
# order dependency and want to debug it, you can fix the order by providing # order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run. # the seed, which is printed after each run.
# --seed 1234 # --seed 1234
config.order = 'random' config.order = "random"
config.before(:suite) do config.before(:suite) do
DatabaseCleaner.clean_with(:truncation) DatabaseCleaner.clean_with(:truncation)
headless.start
end
config.after(:suite) do
headless.destroy
end end
config.before(:each) do config.before(:each) do