From 1d5f4f77bc209bf205a754289020560a00a1d5bc Mon Sep 17 00:00:00 2001 From: Manager Bot Date: Thu, 24 Nov 2022 08:58:08 +0000 Subject: [PATCH] Remove extra file. --- Web/t/01_endpoints/01_auth/01_register_open.t | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 Web/t/01_endpoints/01_auth/01_register_open.t diff --git a/Web/t/01_endpoints/01_auth/01_register_open.t b/Web/t/01_endpoints/01_auth/01_register_open.t deleted file mode 100644 index 052e644..0000000 --- a/Web/t/01_endpoints/01_auth/01_register_open.t +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env perl -use MJB::Web::Test; - -my $t = Test::Mojo::MJB->new('MJB::Web'); - -# Make sure that this registration method is enabled. -$t->app->config->{register}{enable_open} = 1; - -# Try creating an account with an error, ensure we get the error. -$t->post_ok( '/register/open', form => { - name => 'fred', - email => 'fred@blog.com', - password => 'SuperSecure', - password_confirm => 'SuperFail', - })->status_is( 302 - )->code_block( sub { - is( shift->stash->{errors}->[0], 'Password and confirm password must match', 'Expected error thrown' ); - })->code_block( sub { - is( shift->app->db->resultset('Person')->search( { name => 'fred'})->count, 0, 'No user created.'); - }); - -## Try creating a valid account, ensure it exists in the DB. -$t->post_ok( '/register/open', form => { - name => 'fred', - email => 'fred@blog.com', - password => 'SuperSecure', - password_confirm => 'SuperSecure', - })->status_is( 302 - )->code_block( sub { - is( scalar(@{shift->stash->{errors}}), 0, 'No errors' ); - })->code_block( sub { - is( shift->app->db->resultset('Person')->search( { name => 'fred'})->count, 1, 'User created.'); - })->get_ok( '/' - )->code_block( sub { - is(shift->stash->{person}->name, 'fred', 'Got the fred after login...'); - }); - -done_testing();