Use phantomjs gem to demonstrate phantomjs is a dependency, and autoinstall phantomjs.

This commit is contained in:
James Mason 2014-08-19 08:47:28 -07:00
parent 89c77fa33b
commit 2b0d7b880b
3 changed files with 5 additions and 1 deletions

View file

@ -130,6 +130,7 @@ group :test do
gem 'capybara'
gem 'database_cleaner'
gem 'poltergeist'
gem 'phantomjs', :require => 'phantomjs/poltergeist'
# Set of rails validations matchers to describe models
gem 'shoulda'
# Extracted from RSpec 3 stub_model and mock_model

View file

@ -241,6 +241,7 @@ GEM
ast (>= 1.1, < 3.0)
slop (~> 3.4, >= 3.4.5)
pdf-core (0.2.5)
phantomjs (1.9.7.1)
poltergeist (1.5.1)
capybara (~> 2.1)
cliver (~> 0.3.1)
@ -443,6 +444,7 @@ DEPENDENCIES
omniauth-openid
paper_trail
paperclip
phantomjs
poltergeist
prawn_rails
protected_attributes

View file

@ -19,6 +19,7 @@ ActiveRecord::Migration.maintain_test_schema!
# Add poltergeist to use it as JS driver
require 'capybara/poltergeist'
require 'phantomjs'
# Requires supporting ruby files with custom matchers and macros, etc, in
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
@ -65,7 +66,7 @@ RSpec.configure do |config|
Capybara.javascript_driver = :poltergeist
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, js_errors: false)
Capybara::Poltergeist::Driver.new(app, phantomjs: Phantomjs.path, js_errors: false)
end
# Includes helpers and connect them to specific types of tests