spec/spec_helper.rb in pwb-1.3.0 vs spec/spec_helper.rb in pwb-1.4.0
- old
+ new
@@ -24,12 +24,29 @@
# Configure capybara for integration testing
# Capybara.default_driver = :rack_test
# Capybara.default_selector = :css
# js_options = {js_errors: false}
# above is sometimes useful to troubleshoot errors with tests
-js_options = {}
Capybara.register_driver :poltergeist do |app|
+ # set the timeout to a minute because it seems the first
+ # capybara tests were running in travis before assets
+ # had recompiled
+ js_options = {
+ debug: true,
+ # timeout: 30,
+ timeout: 1.minute,
+ window_size: [1280, 1440],
+ port: 44678 + ENV['TEST_ENV_NUMBER'].to_i,
+ phantomjs_options: [
+ '--proxy-type=none',
+ '--load-images=no',
+ '--ignore-ssl-errors=yes',
+ '--ssl-protocol=any',
+ '--web-security=false', '--debug=true'
+ ]
+ }
+
Capybara::Poltergeist::Driver.new(app, js_options)
end
Capybara.javascript_driver = :poltergeist
# Capybara.ignore_hidden_elements = false
@@ -43,17 +60,18 @@
Rails.backtrace_cleaner.remove_silencers!
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
-ActionController::Base.prepend_view_path "#{Pwb::Engine.root}/app/themes/default/views/"
+# ActionController::Base.prepend_view_path "#{Pwb::Engine.root}/app/themes/default/views/"
+# replaced above with below in view specs so I can test diff themes
+# @controller.prepend_view_path "#{Pwb::Engine.root}/app/themes/berlin/views/"
RSpec.configure do |config|
-
- # TODO - consider precompiling assets to speed up tests
+ # TODO: - consider precompiling assets to speed up tests
# config.before(:suite) do
# Rails.application.load_tasks
# Rake::Task["assets:precompile"].invoke
# end
@@ -69,10 +87,10 @@
config.use_transactional_fixtures = false
#
# Make sure the database is clean and ready for test
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
- Pwb::Seeder.seed!
+ # Pwb::Seeder.seed!
end
config.after(:all) do
# http://renderedtext.com/blog/2012/10/10/cleaning-up-after-before-all-blocks/
DatabaseCleaner.clean_with(:truncation)