get for add page works
[scpubgit/Commentry.git] / t / comment_store.t
index 2dcb5ba..2ab2197 100644 (file)
@@ -1,5 +1,6 @@
 use strictures 1;
 use Test::More;
+use File::Path;
 use aliased 'App::Commentry::CommentStore';
 use aliased 'App::Commentry::Comment';
 
@@ -16,4 +17,22 @@ is_deeply(
   'Existing set loads ok'
 );
 
+my $create = { title => 'Created title', body => 'Created body' };
+
+is_deeply(
+  $store->get({ path => 'create/new' })->add($create),
+  my $new = Comment->new($create),
+  'Create new ok'
+);
+
+$store->clear_cache;
+
+is_deeply(
+  [ $store->get({ path => 'create/new' })->flatten ],
+  [ $new ],
+  'Reload ok'
+);
+
+rmtree('t/var/exstore/create');
+
 done_testing;