From 3082786be616173f28488e89b7d8b9bfc5cd0f97 Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Mon, 6 Aug 2018 18:17:49 -0700 Subject: Improve ActiveStorage service adapter error handling --- activestorage/test/service/configurator_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activestorage/test') diff --git a/activestorage/test/service/configurator_test.rb b/activestorage/test/service/configurator_test.rb index 1c9c5c3aa0..3ef9cf9fb6 100644 --- a/activestorage/test/service/configurator_test.rb +++ b/activestorage/test/service/configurator_test.rb @@ -9,6 +9,12 @@ class ActiveStorage::Service::ConfiguratorTest < ActiveSupport::TestCase assert_equal "path", service.root end + test "builds correct service instance based on lowercase service name" do + service = ActiveStorage::Service::Configurator.build(:foo, foo: { service: "disk", root: "path" }) + assert_instance_of ActiveStorage::Service::DiskService, service + assert_equal "path", service.root + end + test "raises error when passing non-existent service name" do assert_raise RuntimeError do ActiveStorage::Service::Configurator.build(:bigfoot, {}) -- cgit v1.2.3