Sha256: a35a3d0f5f90e41dc7e8e3d2640ec9953f158477c07d155d659fa30e5b1c0d9e

Contents?: true

Size: 1.83 KB

Versions: 21

Compression:

Stored size: 1.83 KB

Contents

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

describe "RhoconnectApiListSourceDocs" do
  it_should_behave_like "ApiHelper" do
    it "should list of shared source documents" do
      sourcename = "SimpleAdapter"
      user_id = '*'
      get "/rc/#{Rhoconnect::API_VERSION}/users/#{user_id}/sources/#{sourcename}/docnames", {}, {Rhoconnect::API_TOKEN_HEADER => @api_token}
      JSON.parse(last_response.body).should == {
        "md"=>"source:application:__shared__:SimpleAdapter:md", 
        "errors"=>"source:application:__shared__:SimpleAdapter:errors", 
        "md_size"=>"source:application:__shared__:SimpleAdapter:md_size", 
        "md_copy"=>"source:application:__shared__:SimpleAdapter:md_copy"}
    end
    
    it "should list of shared source documents with old route and deprecation warning" do
      post "/api/list_source_docs", {:source_id => "SimpleAdapter", :user_id => '*'}, {Rhoconnect::API_TOKEN_HEADER => @api_token}
      JSON.parse(last_response.body).should == {
        "md"=>"source:application:__shared__:SimpleAdapter:md", 
        "errors"=>"source:application:__shared__:SimpleAdapter:errors", 
        "md_size"=>"source:application:__shared__:SimpleAdapter:md_size", 
        "md_copy"=>"source:application:__shared__:SimpleAdapter:md_copy"}
    end

    it "should list user source documents" do
      sourcename = "SampleAdapter"
      get "/rc/#{Rhoconnect::API_VERSION}/users/#{@u.id}/sources/#{sourcename}/docnames", {}, {Rhoconnect::API_TOKEN_HEADER => @api_token}
      JSON.parse(last_response.body).should == {
        "md"=>"source:application:testuser:SampleAdapter:md", 
        "errors"=>"source:application:testuser:SampleAdapter:errors", 
        "md_size"=>"source:application:testuser:SampleAdapter:md_size", 
        "md_copy"=>"source:application:testuser:SampleAdapter:md_copy"}
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

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