summaryrefslogtreecommitdiff
path: root/t/25-2index.t
diff options
context:
space:
mode:
authorRobin Edwards <robin.ge@gmail.com>2013-03-01 02:04:58 -0800
committerRobin Edwards <robin.ge@gmail.com>2013-03-01 02:04:58 -0800
commit5f99cd866eb23113ea46ac78720f5608c54982ce (patch)
tree3c35ac04f3d748942c2e973e6f42164ff02e4316 /t/25-2index.t
parentUpdate changelog (diff)
parent*Added secondary index support using method names from the riak python (diff)
downloadnet-riak-5f99cd866eb23113ea46ac78720f5608c54982ce.tar.gz
Merge pull request #22 from Mainframe2008/master
Secondary index support
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