Skip to content

Commit

Permalink
Use Poltergeist as a default driver for Capybara
Browse files Browse the repository at this point in the history
So that Travis build passes. Also don't use Function.bind because oddly
enough PhantomJS still barfs on it, not sure why though:
ariya/phantomjs#10522
  • Loading branch information
jgonera committed Nov 18, 2014
1 parent f53c767 commit 7540baa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ gem 'slim-rails', '~> 2.1.5'
group :development, :test do
gem 'rspec-rails', '~> 3.0.2'
gem 'capybara', '~> 2.4.1'
gem 'poltergeist', '~> 1.5.1'
gem 'factory_girl_rails', '~> 4.4.1'
gem 'selenium-webdriver', '~> 2.42.0'
gem 'database_cleaner', '~> 1.3.0'
Expand Down
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ GEM
xpath (~> 2.0)
childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
cliver (0.3.2)
coderay (1.1.0)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
Expand Down Expand Up @@ -126,6 +127,11 @@ GEM
mini_portile (= 0.6.0)
orm_adapter (0.5.0)
pg (0.17.1)
poltergeist (1.5.1)
capybara (~> 2.1)
cliver (~> 0.3.1)
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
polyamorous (1.1.0)
activerecord (>= 3.0)
polyglot (0.3.5)
Expand Down Expand Up @@ -234,6 +240,7 @@ GEM
warden (1.2.3)
rack (>= 1.0)
websocket (1.0.7)
websocket-driver (0.4.0)
xpath (2.0.0)
nokogiri (~> 1.3)

Expand All @@ -252,6 +259,7 @@ DEPENDENCIES
heroku-deflater
newrelic_rpm
pg (~> 0.17.1)
poltergeist (~> 1.5.1)
pry
pry-remote
puma (~> 2.9.0)
Expand Down
4 changes: 3 additions & 1 deletion app/assets/javascripts/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
this.setChart();
this.renderRows();

d3.select(window).on("resize", this.rescale.bind(this));
d3.select(window).on("resize", function() {
self.rescale();
});
}

Graph.prototype.rescale = function() {
Expand Down
3 changes: 2 additions & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'spec_helper'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'capybara/poltergeist'

# Requires supporting ruby files with custom matchers and macros, etc, in
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
Expand Down Expand Up @@ -64,5 +65,5 @@
Capybara::Selenium::Driver.new(app, browser: :chrome)
end

Capybara.javascript_driver = :chrome
Capybara.javascript_driver = ENV.has_key?('BROWSER') ? ENV['BROWSER'].to_sym : :poltergeist
end

0 comments on commit 7540baa

Please # to comment.