Sha256: 45f13156da700f0fab3fb891d1f6139dca12df5b5afe01a74f043f0428ef285d

Contents?: true

Size: 1013 Bytes

Versions: 8

Compression:

Stored size: 1013 Bytes

Contents

require File.expand_path('../../spec_helper', __FILE__)

describe RightApi::Resources do
  context "given a logged in RightScale user" do
    before(:each) do
      given_user_facing_client
    end

    it "has the required methods for instances of the Resources class" do
      resource = RightApi::Resources.new(@client, '/api/deployments', 'deployments')
      resource.api_methods.sort.collect(&:to_s).should == %w[
        create index ]
    end

    it "has index even for instances of the Resources class that do not support it" do
      resource = RightApi::Resources.new(@client, '/api/tags', 'tags')
      resource.api_methods.sort.collect(&:to_s).should == %w[
        by_resource by_tag create index multi_add multi_delete ]
    end

    it "has resource-specific methods for instances of the Resources class" do
      resource = RightApi::Resources.new(@client, '/api/backups', 'backups')
      resource.api_methods.sort.collect(&:to_s).should == %w[
        cleanup create index ]
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
right_api_client-1.5.19 spec/unit/resources_spec.rb
right_api_client-1.5.18 spec/unit/resources_spec.rb
right_api_client-1.5.17 spec/unit/resources_spec.rb
right_api_client-1.5.16 spec/unit/resources_spec.rb
right_api_client-1.5.15 spec/unit/resources_spec.rb
right_api_client-1.5.14 spec/unit/resources_spec.rb
right_api_client-1.5.13 spec/unit/resources_spec.rb
right_api_client-1.5.12 spec/unit/resources_spec.rb