New TODO and some tests for Flagging
This commit is contained in:
parent
5153da02f9
commit
787cfc9bb1
|
@ -32,6 +32,7 @@ Run the tests locally (against development environment):
|
|||
|
||||
## TODOs
|
||||
|
||||
1. Consolidate routes
|
||||
1. Implement flag post button
|
||||
1. Implement
|
||||
[bcrypt](https://metacpan.org/pod/Mojolicious::Plugin::BcryptSecure)
|
||||
|
|
|
@ -78,6 +78,11 @@ sub startup($self) {
|
|||
->to('thread#by_id')
|
||||
->name('single_thread');
|
||||
|
||||
my $bump_thread = $r->under('/bump');
|
||||
$bump_thread->get('/:thread_id', [thread_id => qr/[0-9]+/])
|
||||
->to('thread#bump')
|
||||
->name('bump_thread');
|
||||
|
||||
# Remark
|
||||
my $post_remark = $r->under('/post');
|
||||
$post_remark
|
||||
|
@ -89,12 +94,6 @@ sub startup($self) {
|
|||
$single_remark->get('/:remark_id', [remark_id => qr/[0-9]+/])
|
||||
->to('remark#by_id')
|
||||
->name('single_remark');
|
||||
|
||||
# Bump
|
||||
my $bump_thread = $r->under('/bump');
|
||||
$bump_thread->get('/:thread_id', [thread_id => qr/[0-9]+/])
|
||||
->to('thread#bump')
|
||||
->name('bump_thread');
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
1
t/.#remark.t
Symbolic link
1
t/.#remark.t
Symbolic link
|
@ -0,0 +1 @@
|
|||
daniel@graymember.98268
|
|
@ -17,6 +17,12 @@ subtest 'View single remark', sub {
|
|||
$t->get_ok('/remark/1')->status_is(200)->text_like(h2 => qr/Remark #1/);
|
||||
};
|
||||
|
||||
subtest 'Flagging remark', sub {
|
||||
$t->get_ok('/remark/1')->status_is(200)
|
||||
->element_exists('a[href*="flag"]')
|
||||
->text_like(h2 => qr/Thread #1/);
|
||||
}
|
||||
|
||||
$t->ua->max_redirects(1);
|
||||
|
||||
subtest 'Post new remark', sub {
|
||||
|
|
10
t/thread.t
10
t/thread.t
|
@ -67,4 +67,14 @@ subtest 'Bumping thread', sub {
|
|||
->text_like(p => qr/Thread #[0-9]+ has been bumped/);
|
||||
};
|
||||
|
||||
subtest 'Flagging thread', sub {
|
||||
$t->get_ok('/list')->status_is(200)
|
||||
->element_exists('a[href*="flag"]')
|
||||
->text_like(h2 => qr/Threads List/);
|
||||
|
||||
$t->get_ok('/thread/1')->status_is(200)
|
||||
->element_exists('a[href*="flag"]')
|
||||
->text_like(h2 => qr/Thread #1/);
|
||||
}
|
||||
|
||||
done_testing();
|
||||
|
|
Loading…
Reference in a new issue