Skip to content

Commit

Permalink
Configurator tests: work against test-local config
Browse files Browse the repository at this point in the history
So tests pass when service configs aren't set up.

References #28
  • Loading branch information
jeremy committed Jul 9, 2017
1 parent bb2d7fc commit 4994e1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/service/configurator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

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
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, SERVICE_CONFIGURATIONS)
ActiveStorage::Service::Configurator.build(:bigfoot, {})
end
end
end
Expand Down

0 comments on commit 4994e1a

Please sign in to comment.