Note we're changing the parent strategy because its default value changed in Factory Bot 5. We're keeping the old one so it's compatible with our test suite. We're also removing the rubocop rule for static attributes because in factory bot 5 this syntax is invalid and will raise an error, so there's no need for rubocop to remind us about it. Bumps [factory_bot_rails](https://github.com/thoughtbot/factory_bot_rails) from 4.8.2 to 6.2.0. - [Release notes](https://github.com/thoughtbot/factory_bot_rails/releases) - [Changelog](https://github.com/thoughtbot/factory_bot_rails/blob/master/NEWS.md) - [Commits](https://github.com/thoughtbot/factory_bot_rails/compare/v4.8.2...v6.2.0) --- updated-dependencies: - dependency-name: factory_bot_rails dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
55 lines
1.3 KiB
Ruby
55 lines
1.3 KiB
Ruby
ENV["RAILS_ENV"] ||= "test"
|
|
if ENV["COVERALLS_REPO_TOKEN"]
|
|
require "coveralls"
|
|
Coveralls.wear!("rails")
|
|
end
|
|
require File.expand_path("../../config/environment", __FILE__)
|
|
abort("The Rails environment is running in production mode!") if Rails.env.production?
|
|
|
|
require "rspec/rails"
|
|
require "spec_helper"
|
|
require "capybara/rails"
|
|
require "capybara/rspec"
|
|
require "selenium/webdriver"
|
|
require "view_component/test_helpers"
|
|
|
|
RSpec.configure do |config|
|
|
config.include ViewComponent::TestHelpers, type: :component
|
|
end
|
|
|
|
Rails.application.load_tasks if Rake::Task.tasks.empty?
|
|
|
|
include Warden::Test::Helpers
|
|
Warden.test_mode!
|
|
|
|
ActiveRecord::Migration.maintain_test_schema!
|
|
|
|
RSpec.configure do |config|
|
|
config.infer_spec_type_from_file_location!
|
|
config.after do
|
|
Warden.test_reset!
|
|
end
|
|
end
|
|
|
|
FactoryBot.use_parent_strategy = false
|
|
|
|
Capybara.register_driver :headless_chrome do |app|
|
|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
|
|
"goog:chromeOptions" => {
|
|
args: %W[headless no-sandbox window-size=1200,800 proxy-server=#{Capybara.app_host}:#{Capybara::Webmock.port_number}]
|
|
}
|
|
)
|
|
|
|
Capybara::Selenium::Driver.new(
|
|
app,
|
|
browser: :chrome,
|
|
desired_capabilities: capabilities
|
|
)
|
|
end
|
|
|
|
Capybara.exact = true
|
|
Capybara.enable_aria_label = true
|
|
Capybara.disable_animation = true
|
|
|
|
OmniAuth.config.test_mode = true
|