Sha256: 6390dc9ed569c63d8d4bbb90791c06b4f360d706483d3db8cd939b54cafb7f08

Contents?: true

Size: 1.36 KB

Versions: 13

Compression:

Stored size: 1.36 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 "/app/#{Rhoconnect::API_VERSION}/#{@s_fields[:name]}/fast_delete", 
        {:user_id => @u.id, :data => {'3' => @product3}}, {Rhoconnect::API_TOKEN_HEADER => @api_token}
      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 "/app/#{Rhoconnect::API_VERSION}/#{@s_fields[:name]}/fast_delete", 
        {:user_id => @u.id, :data => delete_data}, {Rhoconnect::API_TOKEN_HEADER => @api_token}
      last_response.should be_ok
      verify_result(@s.docname(:md) => data,@s.docname(:md_size)=>'2')
    end
  end  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rhoconnect-3.4.5 spec/api/app/fast_delete_spec.rb
rhoconnect-3.4.4 spec/api/app/fast_delete_spec.rb
rhoconnect-3.4.3 spec/api/app/fast_delete_spec.rb
rhoconnect-3.4.2 spec/api/app/fast_delete_spec.rb
rhoconnect-3.3.6 spec/api/app/fast_delete_spec.rb
rhoconnect-3.3.5 spec/api/app/fast_delete_spec.rb
rhoconnect-3.3.4 spec/api/app/fast_delete_spec.rb
rhoconnect-3.3.3 spec/api/app/fast_delete_spec.rb
rhoconnect-3.3.2 spec/api/app/fast_delete_spec.rb
rhoconnect-3.3.1 spec/api/app/fast_delete_spec.rb
rhoconnect-3.3.1.beta4 spec/api/app/fast_delete_spec.rb
rhoconnect-3.3.1.beta3 spec/api/app/fast_delete_spec.rb
rhoconnect-3.3.1.beta2 spec/api/app/fast_delete_spec.rb