Sha256: 15168171cac36d20791f164d6c3d8ef8b07bf5ef57ce2c65d3b98cb5b91fe39a

Contents?: true

Size: 1.01 KB

Versions: 30

Compression:

Stored size: 1.01 KB

Contents

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

describe "RhosyncApiPushObjects" do
  it_should_behave_like "ApiHelper"
  
  it "should push new objects to rhosync's :md" do
    data = {'1' => @product1, '2' => @product2, '3' => @product3}
    post "/api/push_objects", :api_token => @api_token, 
      :user_id => @u.id, :source_id => @s_fields[:name], :objects => data
    last_response.should be_ok
    verify_result(@s.docname(:md) => data,@s.docname(:md_size)=>'3')
  end
  
  it "should push updates to existing objects to rhosync's :md" do
    data = {'1' => @product1, '2' => @product2, '3' => @product3}
    update = {'price' => '0.99', 'new_field' => 'value'}
    set_state(@s.docname(:md) => data)
    update.each do |key,value|
      data['2'][key] = value
    end
    post "/api/push_objects", :api_token => @api_token, 
      :user_id => @u.id, :source_id => @s_fields[:name], :objects => {'2'=>update}
    last_response.should be_ok
    verify_result(@s.docname(:md) => data,@s.docname(:md_size)=>'3')
  end
  
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
rhosync-2.1.3 spec/api/push_objects_spec.rb
rhosync-2.1.2 spec/api/push_objects_spec.rb
rhosync-2.1.1 spec/api/push_objects_spec.rb
rhosync-2.1.0 spec/api/push_objects_spec.rb
rhosync-2.1.0.beta.2 spec/api/push_objects_spec.rb
rhosync-2.1.0.beta.1 spec/api/push_objects_spec.rb
rhosync-2.0.9 spec/api/push_objects_spec.rb
rhosync-2.0.8 spec/api/push_objects_spec.rb
rhosync-2.0.7 spec/api/push_objects_spec.rb
rhosync-2.0.6 spec/api/push_objects_spec.rb
rhosync-2.0.5 spec/api/push_objects_spec.rb
rhosync-2.0.4 spec/api/push_objects_spec.rb
rhosync-2.0.3 spec/api/push_objects_spec.rb
rhosync-2.0.2 spec/api/push_objects_spec.rb
rhosync-2.0.1 spec/api/push_objects_spec.rb
rhosync-2.0.0 spec/api/push_objects_spec.rb
rhosync-2.0.0.rc2 spec/api/push_objects_spec.rb
rhosync-2.0.0.rc1 spec/api/push_objects_spec.rb
rhosync-2.0.0.beta13 spec/api/push_objects_spec.rb
rhosync-2.0.0.beta12 spec/api/push_objects_spec.rb