Permalink
Browse files

Support of duplicates removal

Signed-off-by: Aymeric Brisse <aymeric.brisse@perfect-memory.com>
  • Loading branch information...
abrisse committed Mar 5, 2012
1 parent 0dfc463 commit aa5739b08d71610bdbf2f693d5072a4f596a723b
Showing with 21 additions and 0 deletions.
  1. +5 −0 lib/allegro_graph/repository.rb
  2. +8 −0 spec/fake_transport.yml
  3. +8 −0 spec/lib/allegro_graph/repository_spec.rb
@@ -65,6 +65,11 @@ def size
response.to_i
end
+ def remove_duplicates(mode=:spog)
+ response = @server.request_http :delete, self.path + "/statements/duplicates", :parameters => {:mode => mode.to_s}, :expected_status_code => 200
+ response.to_i
+ end
+
def transaction(options={}, &block)
self.class.transaction self, options, &block
end
View
@@ -112,6 +112,14 @@
:response:
:code: "200"
:body: "3"
+-
+ :http_method: "delete"
+ :url: "http://localhost:10035/catalogs/test_catalog/repositories/test_repository/statements/duplicates"
+ :parameters:
+ :mode: "spog"
+ :response:
+ :code: "200"
+ :body: "27"
-
:http_method: "post"
:url: "http://localhost:10035/catalogs/test_catalog/repositories/test_repository/statements"
@@ -203,6 +203,14 @@
end
+ describe "remove_duplicates" do
+
+ it "should remove the duplicates" do
+ @repository.remove_duplicates.should == 27
+ end
+
+ end
+
describe "transaction" do
before :each do

0 comments on commit aa5739b

Please sign in to comment.