Sha256: 910b0034f2895d8f64744a31647e353127411491f8e6a307589de0e052e6fd1d

Contents?: true

Size: 1.24 KB

Versions: 10

Compression:

Stored size: 1.24 KB

Contents

require File.join(File.dirname(__FILE__),'api_helper')

describe "RhoconnectApiFastDelete" do
  it_should_behave_like "ApiHelper"
  
  it "should delete an object from rhosync'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/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/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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rhosync-2.1.18.beta2 spec/api/fast_delete_spec.rb
rhosync-2.1.18.beta1 spec/api/fast_delete_spec.rb
rhosync-2.1.17 spec/api/fast_delete_spec.rb
rhosync-2.1.17.beta7 spec/api/fast_delete_spec.rb
rhosync-2.1.17.beta6 spec/api/fast_delete_spec.rb
rhosync-2.1.17.beta5 spec/api/fast_delete_spec.rb
rhosync-2.1.17.beta4 spec/api/fast_delete_spec.rb
rhosync-2.1.17.beta3 spec/api/fast_delete_spec.rb
rhosync-2.1.17.beta2 spec/api/fast_delete_spec.rb
rhosync-2.1.17.beta1 spec/api/fast_delete_spec.rb