Sha256: 478f74b885ebfadaf62a18886408139bd58ccfdf27f53bf1157def5ed6bfa4e3

Contents?: true

Size: 1.82 KB

Versions: 17

Compression:

Stored size: 1.82 KB

Contents

ENV['RAILS_ENV'] ||= 'test'
ENV['TZ'] ||= 'America/Los_Angeles'

require 'dummy/config/application'
require 'rspec/rails'
require 'database_cleaner'

support = Pathname.new(__FILE__).parent.to_s + '/support'
require "#{support}/suite"
require "#{support}/shared_connection"

Dummy::Application.initialize! unless Dummy::Application.initialized?

ActiveRecord::Migrator.migrate File.expand_path('../../db/migrate/', __FILE__)
ActiveRecord::Migrator.migrate File.expand_path('../dummy/db/migrate/', __FILE__)

RSpec.configure do |config|
  config.include Marty::RSpec::Suite
  config.include Marty::RSpec::SharedConnection
  config.include Marty::RSpec::SharedConnectionDbHelpers

  # RspecMarty::SharedConnection.classes_to_exclude_shared = ['Marty::Log']
  Capybara.default_max_wait_time = 3

  # TODO: Continue to remove should syntax from specs - remove this line to see
  # errors
  config.expect_with(:rspec) { |c| c.syntax = [:should, :expect] }

  config.run_all_when_everything_filtered = true
  config.filter_run :focus

  config.order = 'random'

  config.example_status_persistence_file_path = '.rspec-results'

  config.before(:suite) do
    DatabaseCleaner.clean_with(:truncation)
    Rails.application.load_seed
  end

  config.before(:each) do
    marty_whodunnit
  end

  config.after(:each, :js => true) do |example|
    # save a screenshot on js failures for CI server testing
    if example.exception
      meta = example.metadata
      filename = File.basename(meta[:file_path])
      line_number = meta[:line_number]
      screenshot_name = "screenshot-#{filename}-#{line_number}.png"
      screenshot_path = "#{Rails.root.join("tmp")}/#{screenshot_name}"
      page.save_screenshot(screenshot_path)
     end
  end

  config.infer_spec_type_from_file_location!
  config.use_transactional_fixtures = true

  Netzke::Testing.rspec_init(config)
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
marty-2.7.1 spec/spec_helper.rb
marty-2.7.0 spec/spec_helper.rb
marty-2.6.8 spec/spec_helper.rb
marty-2.6.7 spec/spec_helper.rb
marty-2.6.6 spec/spec_helper.rb
marty-2.6.5 spec/spec_helper.rb
marty-2.6.4 spec/spec_helper.rb
marty-2.6.3 spec/spec_helper.rb
marty-2.6.2 spec/spec_helper.rb
marty-2.6.1 spec/spec_helper.rb
marty-2.6.0 spec/spec_helper.rb
marty-2.5.9 spec/spec_helper.rb
marty-2.5.8 spec/spec_helper.rb
marty-2.5.7 spec/spec_helper.rb
marty-2.5.6 spec/spec_helper.rb
marty-2.5.5 spec/spec_helper.rb
marty-2.5.4 spec/spec_helper.rb