1
0
Fork 0
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:
Jeremy Daer 2017-07-09 13:21:14 -07:00
parent bb2d7fcbf5
commit 4994e1aedd
No known key found for this signature in database
GPG key ID: AB8F6399D5C60664

View file

@ -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