aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test
diff options
context:
space:
mode:
authorJoel Taylor <joel@glassbreakers.co>2018-08-06 18:17:49 -0700
committerJoel Taylor <joel@glassbreakers.co>2018-08-06 18:17:49 -0700
commit3082786be616173f28488e89b7d8b9bfc5cd0f97 (patch)
tree955033c82128a98024294e002dc90f4d11491728 /activestorage/test
parent53ec6cdf7ade942b2589bf8295246f7bc98c850a (diff)
downloadrails-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.rb6
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, {})