diff options
author | Dino Maric <dino.onex@gmail.com> | 2017-07-09 18:31:27 +0200 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2017-07-09 18:31:27 +0200 |
commit | 18720bc8fbf269184ac6f183a82ed045cc0c1965 (patch) | |
tree | d92fc063030bbb6f9c7b3a0df95afd8691994062 | |
parent | f2f5c7979022863d02c706b685ee1233e5fdf5bb (diff) | |
download | rails-18720bc8fbf269184ac6f183a82ed045cc0c1965.tar.gz rails-18720bc8fbf269184ac6f183a82ed045cc0c1965.tar.bz2 rails-18720bc8fbf269184ac6f183a82ed045cc0c1965.zip |
Add basic tests to the Configurator#build (#28)
-rw-r--r-- | test/service/configurator_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/service/configurator_test.rb b/test/service/configurator_test.rb new file mode 100644 index 0000000000..f033fc7d20 --- /dev/null +++ b/test/service/configurator_test.rb @@ -0,0 +1,15 @@ +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(:s3, SERVICE_CONFIGURATIONS) + assert_instance_of ActiveStorage::Service::S3Service, service + end + + test "raises error when passing non-existent service name" do + assert_raise RuntimeError do + ActiveStorage::Service::Configurator.build(:bigfoot, SERVICE_CONFIGURATIONS) + end + end +end + |