aboutsummaryrefslogtreecommitdiffstats
path: root/t/app
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2018-09-20 16:15:38 +0100
committerDave Arter <davea@mysociety.org>2018-09-28 16:19:47 +0100
commit07bc1188dc149e05b61e0d93ecf3ef1c26dc8690 (patch)
tree1ac3c9d0148b3f98ff29985e8c760740bb8d2548 /t/app
parent561e01b9b51b62e2566d80cd63d308f9a4f82822 (diff)
Add S3 photo storage backend
Diffstat (limited to 't/app')
-rw-r--r--t/app/model/photoset.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/app/model/photoset.t b/t/app/model/photoset.t
index 708bda891..29a28d232 100644
--- a/t/app/model/photoset.t
+++ b/t/app/model/photoset.t
@@ -72,4 +72,29 @@ subtest 'Photoset with 3 referenced photo' => sub {
};
+subtest 'Correct storage backends are instantiated' => sub {
+ FixMyStreet::override_config {
+ PHOTO_STORAGE_BACKEND => 'FileSystem'
+ }, sub {
+ my $photoset = FixMyStreet::App::Model::PhotoSet->new;
+ isa_ok $photoset->storage, 'FixMyStreet::PhotoStorage::FileSystem';
+ };
+
+ FixMyStreet::override_config {
+ PHOTO_STORAGE_BACKEND => undef
+ }, sub {
+ my $photoset = FixMyStreet::App::Model::PhotoSet->new;
+ isa_ok $photoset->storage, 'FixMyStreet::PhotoStorage::FileSystem';
+ };
+
+ FixMyStreet::override_config {
+ PHOTO_STORAGE_BACKEND => 'S3'
+ }, sub {
+ my $photoset = FixMyStreet::App::Model::PhotoSet->new;
+ isa_ok $photoset->storage, 'FixMyStreet::PhotoStorage::S3';
+ };
+
+};
+
+
done_testing();