diff options
author | Joel Taylor <joel@glassbreakers.co> | 2018-08-06 18:17:49 -0700 |
---|---|---|
committer | Joel Taylor <joel@glassbreakers.co> | 2018-08-06 18:17:49 -0700 |
commit | 3082786be616173f28488e89b7d8b9bfc5cd0f97 (patch) | |
tree | 955033c82128a98024294e002dc90f4d11491728 /activestorage/test | |
parent | 53ec6cdf7ade942b2589bf8295246f7bc98c850a (diff) | |
download | rails-3082786be616173f28488e89b7d8b9bfc5cd0f97.tar.gz rails-3082786be616173f28488e89b7d8b9bfc5cd0f97.tar.bz2 rails-3082786be616173f28488e89b7d8b9bfc5cd0f97.zip |
Improve ActiveStorage service adapter error handling
Diffstat (limited to 'activestorage/test')
-rw-r--r-- | activestorage/test/service/configurator_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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, {}) |