forked from joemasilotti/railsdevs.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_helper.rb
55 lines (42 loc) · 1.42 KB
/
test_helper.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
ENV["RAILS_ENV"] ||= "test"
require_relative "../config/environment"
require "minitest/autorun"
require "minitest/mock"
require "rails/test_help"
require "capybara"
require "minitest/reporters"
require "minitest/reporters/pride_reporter"
require "webmock/minitest"
Dir[Rails.root.join("test/support/**/*.rb")].each { |f| require f }
options = ENV["REPORTER"].to_s.downcase == "slow" ? {fast_fail: true, slow_count: 5} : {}
Minitest::Reporters.use!([Minitest::Reporters::PrideReporter.new(options)])
WebMock.disable_net_connect!({
allow_localhost: true,
allow: "chromedriver.storage.googleapis.com"
})
class ActiveSupport::TestCase
include GeocoderHelper
EASTERN_UTC_OFFSET = -5 * 60 * 60
PACIFIC_UTC_OFFSET = -8 * 60 * 60
# Run tests in parallel with specified workers
parallelize(workers: :number_of_processors)
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
setup do
ActiveStorage::Current.url_options = {protocol: "https://", host: "example.com", port: nil}
end
teardown do
ActiveStorage::Current.reset
end
def default_url_options
Rails.application.routes.default_url_options
end
end
class ActionDispatch::IntegrationTest
include Devise::Test::IntegrationHelpers
end
class ViewComponent::TestCase
include FileTagsHelper
include MetaTagsHelper
end
ActiveStorage::FixtureSet.file_fixture_path = File.expand_path("fixtures/files", __dir__)