Sha256: 9f6f57d39d67261f63a0118748a58d720dcac0198dd7c58c97cda3f8eaeeedbf

Contents?: true

Size: 1.24 KB

Versions: 21

Compression:

Stored size: 1.24 KB

Contents

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

describe "RhoconnectApiGetDbDoc" do
  it_should_behave_like "ApiHelper" do
    it "should return db document by name" do
      data = {'1' => {'foo' => 'bar'}}
      set_state('abc:abc' => data)
      dockey = 'abc:abc'
      get "/rc/#{Rhoconnect::API_VERSION}/store/#{dockey}", {}, {Rhoconnect::API_TOKEN_HEADER => @api_token}
      last_response.should be_ok
      JSON.parse(last_response.body).should == data
    end
    
    it "should return db document by name and print deprecation warning with old route" do
      data = {'1' => {'foo' => 'bar'}}
      set_state('abc:abc' => data)
      post "/api/get_db_doc", {:doc => 'abc:abc'}, {Rhoconnect::API_TOKEN_HEADER => @api_token}
      last_response.should be_ok
      last_response.headers["Warning"].index('deprecated').should_not == nil
      JSON.parse(last_response.body).should == data
    end

    it "should return db document by name and data_type" do
      data = 'some string'
      set_state('abc:abc' => data)
      dockey = 'abc:abc'
      get "/rc/#{Rhoconnect::API_VERSION}/store/#{dockey}", {}, {Rhoconnect::API_TOKEN_HEADER => @api_token}
      last_response.should be_ok
      last_response.body.should == data
    end
  end  
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rhoconnect-4.0.4 spec/api/store/get_db_doc_spec.rb
rhoconnect-4.0.3 spec/api/store/get_db_doc_spec.rb
rhoconnect-4.0.2 spec/api/store/get_db_doc_spec.rb
rhoconnect-4.0.1 spec/api/store/get_db_doc_spec.rb
rhoconnect-4.0.0 spec/api/store/get_db_doc_spec.rb
rhoconnect-4.0.0.beta.24 spec/api/store/get_db_doc_spec.rb
rhoconnect-3.4.5 spec/api/store/get_db_doc_spec.rb
rhoconnect-4.0.0.beta.10 spec/api/store/get_db_doc_spec.rb
rhoconnect-4.0.0.beta.12 spec/api/store/get_db_doc_spec.rb
rhoconnect-3.4.4 spec/api/store/get_db_doc_spec.rb
rhoconnect-3.4.3 spec/api/store/get_db_doc_spec.rb
rhoconnect-3.4.2 spec/api/store/get_db_doc_spec.rb
rhoconnect-3.3.6 spec/api/store/get_db_doc_spec.rb
rhoconnect-3.3.5 spec/api/store/get_db_doc_spec.rb
rhoconnect-3.3.4 spec/api/store/get_db_doc_spec.rb
rhoconnect-3.3.3 spec/api/store/get_db_doc_spec.rb
rhoconnect-3.3.2 spec/api/store/get_db_doc_spec.rb
rhoconnect-3.3.1 spec/api/store/get_db_doc_spec.rb
rhoconnect-3.3.1.beta4 spec/api/store/get_db_doc_spec.rb
rhoconnect-3.3.1.beta3 spec/api/store/get_db_doc_spec.rb