mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
9330d01ada
git-subtree-dir: activestorage git-subtree-mainline:0d58e7e478
git-subtree-split:3f4a7218a4
14 lines
535 B
Ruby
14 lines
535 B
Ruby
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(: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, {})
|
|
end
|
|
end
|
|
end
|