aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/service/configurator_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activestorage/test/service/configurator_test.rb')
-rw-r--r--activestorage/test/service/configurator_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/activestorage/test/service/configurator_test.rb b/activestorage/test/service/configurator_test.rb
new file mode 100644
index 0000000000..c69b8d5087
--- /dev/null
+++ b/activestorage/test/service/configurator_test.rb
@@ -0,0 +1,14 @@
+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