Sha256: 497d034bf6de8c658f602eb15debab991d91f6f01be0c41c0a50e82bafa9e5f6

Contents?: true

Size: 1.25 KB

Versions: 13

Compression:

Stored size: 1.25 KB

Contents

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

describe "RhoconnectApiSetDbDoc" do
  it_should_behave_like "ApiHelper" do
    it "should set db document by doc name and data" do
      data = {'1' => {'foo' => 'bar'}}
      post "/api/source/set_db_doc", :api_token => @api_token, :doc => 'abc:abc', :data => data
      last_response.should be_ok
      verify_result('abc:abc' => data)
    end

    it "should set db document by doc name, data type, and data" do
      data = 'some string'
      post "/api/source/set_db_doc", :api_token => @api_token, :doc => 'abc:abc:str', :data => data, :data_type => :string
      last_response.should be_ok
      verify_result('abc:abc:str' => data)
    end
    
    it "should append data in set db document by doc name and data" do
      data = {'1' => {'foo' => 'bar'}}
      data2 = {'2' => {'foo1' => 'bar1'}}
      data3 = data.merge(data2)
      post "/api/source/set_db_doc", :api_token => @api_token, :doc => 'abc:abc', :data => data
      last_response.should be_ok
      verify_result('abc:abc' => data)
      
      post "/api/source/set_db_doc", :api_token => @api_token, :doc => 'abc:abc', :data => data2, :append => true
      last_response.should be_ok
      verify_result('abc:abc' => data3)
    end
  end  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rhoconnect-3.2.1 spec/api/source/set_db_doc_spec.rb
rhoconnect-3.2.0 spec/api/source/set_db_doc_spec.rb
rhoconnect-3.2.0.beta5 spec/api/source/set_db_doc_spec.rb
rhoconnect-3.2.0.beta4 spec/api/source/set_db_doc_spec.rb
rhoconnect-3.2.0.beta3 spec/api/source/set_db_doc_spec.rb
rhoconnect-3.2.0.beta2 spec/api/source/set_db_doc_spec.rb
rhoconnect-3.2.0.beta1 spec/api/source/set_db_doc_spec.rb
rhoconnect-3.1.2 spec/api/source/set_db_doc_spec.rb
rhoconnect-3.1.1 spec/api/source/set_db_doc_spec.rb
rhoconnect-3.1.0 spec/api/source/set_db_doc_spec.rb
rhoconnect-3.1.0.beta2 spec/api/source/set_db_doc_spec.rb
rhoconnect-3.1.0.beta1 spec/api/source/set_db_doc_spec.rb
rhoconnect-3.0.6 spec/api/source/set_db_doc_spec.rb