Sha256: d132d09655251fef7d86e9967e5b135b4b92043e1fd8d40d47a6067e64344505
Contents?: true
Size: 1.3 KB
Versions: 7
Compression:
Stored size: 1.3 KB
Contents
require File.join(File.dirname(__FILE__),'..','api_helper') describe "RhoconnectApiFastDelete" do it_should_behave_like "ApiHelper" do it "should delete an object from rhoconnect's :md" do data = {'1' => @product1, '2' => @product2, '3' => @product3} @s = Source.load(@s_fields[:name],@s_params) set_state(@s.docname(:md) => data,@s.docname(:md_size) => '3') post "/api/source/fast_delete", :api_token => @api_token, :user_id => @u.id, :source_id => @s_fields[:name], :data => {'3' => @product3} last_response.should be_ok data.delete('3') verify_result(@s.docname(:md) => data,@s.docname(:md_size)=>'2') end it "should not properly delete the object if fast_delete is called without all the attributes (because fast_delete doesn't ensure any data integrity)" do data = {'1' => @product1, '2' => @product2, '3' => @product3} delete_data = {'3' => {'price' => '1.99'}} @s = Source.load(@s_fields[:name],@s_params) set_state(@s.docname(:md) => data,@s.docname(:md_size) => '3') post "/api/source/fast_delete", :api_token => @api_token, :user_id => @u.id, :source_id => @s_fields[:name], :data => delete_data last_response.should be_ok verify_result(@s.docname(:md) => data,@s.docname(:md_size)=>'2') end end end
Version data entries
7 entries across 7 versions & 1 rubygems