File tree Expand file tree Collapse file tree 7 files changed +63
-28
lines changed
Expand file tree Collapse file tree 7 files changed +63
-28
lines changed Original file line number Diff line number Diff line change 1+ sudo : required
2+ language : ruby
3+ addons :
4+ chrome : stable
5+
6+ before_install : gem install bundler -v 1.17.1
7+
8+ script : bundle exec rspec
9+
10+ env :
11+ matrix :
12+ - RAILS=5.1.6 AA=1.1.0
13+ - RAILS=5.1.6 AA=1.2.1
14+ - RAILS=5.2.1 AA=1.3.1
15+ - RAILS=5.2.1 AA=1-4-stable
16+
17+ rvm :
18+ - 2.3
19+ - 2.5
Original file line number Diff line number Diff line change @@ -4,16 +4,18 @@ source 'https://rubygems.org'
44gemspec
55
66group :test do
7- gem 'sprockets-rails' , '3.2.0'
8- gem 'rails' , '5.1.1'
9- gem 'turbolinks'
7+ gem 'rails' , "#{ ENV [ 'RAILS' ] || '5.2.1' } "
8+ if ENV [ 'AA' ] == '1-4-stable'
9+ gem 'activeadmin' , git : 'https://github.com/activeadmin/activeadmin.git' , branch : '1-4-stable'
10+ else
11+ gem 'activeadmin' , "#{ ENV [ 'AA' ] || '1.3.1' } "
12+ end
13+
1014 gem 'rspec-rails'
11- gem 'activeadmin' , '1.0.0'
12- gem 'sass-rails'
1315 gem 'sqlite3'
14- gem 'launchy'
1516 gem 'database_cleaner'
1617 gem 'capybara'
1718 gem 'selenium-webdriver'
18- gem 'poltergeist'
19+ gem 'chromedriver-helper'
20+ gem 'byebug'
1921end
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ module ActiveAdminSidebar
77 module Rails
88 class Engine < ::Rails ::Engine
99 config . after_initialize do
10+ ActiveAdmin ::Views ::Pages ::Base . prepend ActiveAdminSidebar ::ActiveAdminViewsPagesBase
1011 ActiveAdmin ::BaseController . send :include , ActiveAdminSidebar ::Positions
1112 end
1213 end
Original file line number Diff line number Diff line change 1- class ActiveAdmin :: Views :: Pages :: Base < Arbre :: HTML :: Document
1+ module ActiveAdminSidebar :: ActiveAdminViewsPagesBase
22
33 def build_page_content
44 build_flash_messages
@@ -9,6 +9,14 @@ def build_page_content
99 end
1010 end
1111
12+ def build_sidebar
13+ if defined? ( super )
14+ super
15+ else
16+ sidebar sidebar_sections_for_action , id : 'sidebar'
17+ end
18+ end
19+
1220 def left_sidebar?
1321 assigns [ :sidebar_options ] . try! ( :[] , :position ) == :left
1422 end
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