diff --git a/Gemfile b/Gemfile index 88ab7025..83f5395c 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index 129fa41c..f4a3d54f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 73f6fee2..6380ac98 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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