aboutsummaryrefslogtreecommitdiffstats
path: root/t/fakeq.t
diff options
context:
space:
mode:
Diffstat (limited to 't/fakeq.t')
-rw-r--r--t/fakeq.t24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/fakeq.t b/t/fakeq.t
new file mode 100644
index 000000000..ae7c6d98b
--- /dev/null
+++ b/t/fakeq.t
@@ -0,0 +1,24 @@
+use strict;
+use warnings;
+
+use Test::More;
+
+use_ok 'FixMyStreet::FakeQ';
+
+# create a new object and check that it returns what we want.
+my $fake_q = FixMyStreet::FakeQ->new(
+ {
+ params => { foo => 'bar' }, #
+ site => 'boing'
+ }
+);
+
+is $fake_q->{site}, 'boing', 'got site verbatim';
+is $fake_q->param('foo'), 'bar', 'got set param';
+is $fake_q->param('not_set'), undef, 'got undef for not set param';
+
+# check that setting site to 'default' gets translated to fixmystreet
+is FixMyStreet::FakeQ->new( { site => 'default' } )->{site}, 'fixmystreet',
+ "'default' site becomes 'fixmystreet'";
+
+done_testing();