summaryrefslogtreecommitdiff
path: root/t/25-2index.t
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--t/25-2index.t17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/25-2index.t b/t/25-2index.t
new file mode 100644
index 0000000..c6d420c
--- /dev/null
+++ b/t/25-2index.t
@@ -0,0 +1,17 @@
+use lib 't/lib';
+use Test::More;
+use Test::Riak;
+
+test_riak_rest {
+ my ($client, $bucket_name) = @_;
+ my $content = { field => "2index" };
+ ok my $bucket = $client->bucket($bucket_name), 'got bucket test';
+ ok my $obj = $bucket->new_object('2ikey', $content),
+ 'created a new riak object for seconday index';
+ ok $obj->add_index('myindex_bin', 'value'), 'Secondary index created';
+
+ ok $obj->store, 'Object with secondary index stored';
+ ok my $newobj->get('2ikey'), 'Object with secondary index retrieved';
+ ok $newobj->remove_index('myindex_bin', 'value'), 'Secondary index removed';
+ ok $newobj->store, "Object without secondary index saved";
+} \ No newline at end of file