mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Configurator tests: work against test-local config
So tests pass when service configs aren't set up. References #28
This commit is contained in:
parent
bb2d7fcbf5
commit
4994e1aedd
1 changed files with 3 additions and 3 deletions
|
@ -2,13 +2,13 @@ require "service/shared_service_tests"
|
|||
|
||||
class ActiveStorage::Service::ConfiguratorTest < ActiveSupport::TestCase
|
||||
test "builds correct service instance based on service name" do
|
||||
service = ActiveStorage::Service::Configurator.build(:s3, SERVICE_CONFIGURATIONS)
|
||||
assert_instance_of ActiveStorage::Service::S3Service, service
|
||||
service = ActiveStorage::Service::Configurator.build(:foo, foo: { service: "Disk", root: "path" })
|
||||
assert_instance_of ActiveStorage::Service::DiskService, service
|
||||
end
|
||||
|
||||
test "raises error when passing non-existent service name" do
|
||||
assert_raise RuntimeError do
|
||||
ActiveStorage::Service::Configurator.build(:bigfoot, SERVICE_CONFIGURATIONS)
|
||||
ActiveStorage::Service::Configurator.build(:bigfoot, {})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue