diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-05-09 09:44:08 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-05-09 09:44:08 +0100 |
commit | c25332f3c0a6201726882c9d5b69bf314b5d061d (patch) | |
tree | 71a047bf42a22fab0ea3dd076490ef45510605c3 /t/app/model | |
parent | 47b754d7a8dd1114eb745efcaf1495fb27f0c1d8 (diff) | |
parent | 332c92ead825503c0540f805a0fdb39c64212c15 (diff) |
Merge branch 'photo-caching'
Diffstat (limited to 't/app/model')
-rw-r--r-- | t/app/model/user.t | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/t/app/model/user.t b/t/app/model/user.t index 5a9c898a2..cbc0fe6cf 100644 --- a/t/app/model/user.t +++ b/t/app/model/user.t @@ -1,5 +1,8 @@ use FixMyStreet::TestMech; use FixMyStreet::DB; +use Catalyst::Test 'FixMyStreet::App'; +use HTTP::Request::Common; +use Test::Exception; my $mech = FixMyStreet::TestMech->new(); $mech->log_in_ok('test@example.com'); @@ -63,9 +66,16 @@ FixMyStreet::override_config { $mech->content_like(qr/may_show_name[^>c]*>/); }; -END { - done_testing(); -} +subtest 'Check non-existent methods on user object die' => sub { + my $c = ctx_request(POST '/auth', { username => 'test@example.com', password_sign_in => 'secret' }); + throws_ok( + sub { $c->user->is_super_user }, + qr/Can't locate object method 'is_super_user'/, + 'attempt to call non-existent method' + ); +}; + +done_testing(); sub create_update { my ($problem, %params) = @_; |