Sha256: b6dc57c08da618e9d1d72f4a347e771ae72bd2590b9666c77219d3fec06850cc

Contents?: true

Size: 972 Bytes

Versions: 2

Compression:

Stored size: 972 Bytes

Contents

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

describe "RhosyncApiListSources" do
  it_should_behave_like "ApiHelper"
  
  it "should list all application sources" do
    post "/api/list_sources", {:api_token => @api_token}
    JSON.parse(last_response.body).should == ["SimpleAdapter", "SampleAdapter"]
  end

  it "should list all application sources using partition_type param" do
    post "/api/list_sources", 
      {:api_token => @api_token, :partition_type => 'all'}
    JSON.parse(last_response.body).should == ["SimpleAdapter", "SampleAdapter"]
  end
  
  it "should list app partition sources" do
    post "/api/list_sources", {:api_token => @api_token, :partition_type => :app}
    JSON.parse(last_response.body).should == ["SimpleAdapter"]
  end

  it "should list user partition sources" do
    post "/api/list_sources", {:api_token => @api_token, :partition_type => :user}
    JSON.parse(last_response.body).should == ["SampleAdapter"]
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rhosync-2.0.0.beta3 spec/api/list_sources_spec.rb
rhosync-2.0.0.beta2 spec/api/list_sources_spec.rb