1use lib 't/lib';
2use Test::More;
3use Test::Riak;
4
5test_riak_rest {
6    my ($client, $bucket_name) = @_;
7    my $content = { field => "2index" };
8    ok my $bucket = $client->bucket($bucket_name), 'got bucket test';
9    ok my $obj = $bucket->new_object('2ikey', $content),
10        'created a new riak object for seconday index';
11    ok $obj->add_index('myindex_bin', 'value'), 'Secondary index created';
12
13    ok $obj->store, 'Object with secondary index stored';
14    ok my $newobj = $bucket->get('2ikey'), 'Object with secondary index retrieved';
15    ok $newobj->remove_index('myindex_bin', 'value'), 'Secondary index removed';
16    ok $newobj->store, "Object without secondary index saved";
17}
18