File tree Expand file tree Collapse file tree 4 files changed +28
-24
lines changed
Expand file tree Collapse file tree 4 files changed +28
-24
lines changed Original file line number Diff line number Diff line change @@ -4,16 +4,15 @@ source 'https://rubygems.org'
44gemspec
55
66group :test do
7- gem 'sprockets-rails' , '3.2.0'
8- gem 'rails' , '5.1.1'
7+ gem 'rails' , '~> 5.1.6'
98 gem 'turbolinks'
109 gem 'rspec-rails'
11- gem 'activeadmin' , '1.0 .0'
10+ gem 'activeadmin' , '~> 1.1 .0'
1211 gem 'sass-rails'
1312 gem 'sqlite3'
1413 gem 'launchy'
1514 gem 'database_cleaner'
1615 gem 'capybara'
1716 gem 'selenium-webdriver'
18- gem 'poltergeist '
17+ gem 'chromedriver-helper '
1918end
Original file line number Diff line number Diff line change 2727ActiveAdmin . application . current_user_method = false
2828
2929require 'rspec/rails'
30- require 'support/admin'
3130require 'capybara/rails'
3231require 'capybara/rspec'
33- require 'capybara/poltergeist '
32+ require 'selenium-webdriver '
3433
34+ require 'support/admin'
35+ require 'support/capybara'
3536
3637RSpec . configure do |config |
3738 config . use_transactional_fixtures = false
4950 end
5051
5152end
52-
53- # RSpec.configure do |config|
54- # config.before(:each, js: true) do
55- # page.driver.browser.manage.window.maximize if page.driver.browser.respond_to?(:manage)
56- # end
57- # end
58- # Capybara.javascript_driver = :selenium
59-
60- Capybara . register_driver :poltergeist do |app |
61- Capybara ::Poltergeist ::Driver . new ( app , {
62- js_errors : true ,
63- timeout : 80 ,
64- debug : true ,
65- :phantomjs_options => [ '--debug=no' , '--load-images=no' ]
66- } )
67- end
68- Capybara . javascript_driver = :poltergeist
Original file line number Diff line number Diff line change 1+ Capybara . configure do |config |
2+ config . match = :prefer_exact
3+ end
4+
5+ Capybara . register_driver :selenium_chrome do |app |
6+ options = Selenium ::WebDriver ::Chrome ::Options . new (
7+ args : %w[ headless disable-gpu no-sandbox ]
8+ )
9+ Capybara ::Selenium ::Driver . new ( app , browser : :chrome , options : options )
10+ end
11+
12+ Capybara . server = :webrick
13+ Capybara . javascript_driver = :selenium_chrome
Original file line number Diff line number Diff line change @@ -2,5 +2,13 @@ desc "Creates a test rails app for the specs to run against"
22task :setup do
33 require 'rails/version'
44 system ( "mkdir spec/rails" ) unless File . exists? ( "spec/rails" )
5- system "bundle exec rails new spec/rails/rails-#{ Rails ::VERSION ::STRING } -m spec/support/rails_template.rb --skip-spring"
5+
6+ rails_new_opts = %w(
7+ --skip-turbolinks
8+ --skip-spring
9+ --skip-bootsnap
10+ -m
11+ spec/support/rails_template.rb
12+ )
13+ system "bundle exec rails new spec/rails/rails-#{ Rails ::VERSION ::STRING } #{ rails_new_opts . join ( ' ' ) } "
614end
You can’t perform that action at this time.
0 commit comments