Sha256: 8c06bbb909e611b843bc16a0c6de0395e2f3b5349929fc216f8174277ff4fe9b

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

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

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

    it "Should have the required methods for instances of the Resources class" do
      resource = RightApi::Resources.new(@client, '/api/deployments', 'deployments')
      resource.api_methods.sort.collect{|s| s.to_s}.should == ["create", "index"]
    end

    it "Should have 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{|s| s.to_s}.should == ["by_resource", "by_tag", "create", "index", "multi_add", "multi_delete"]
    end

    it "Should have resource-specific methods for instances of the Resources class" do
      resource = RightApi::Resources.new(@client, '/api/backups', 'backups')
      resource.api_methods.sort.collect{|s| s.to_s}.should == ["cleanup", "create", "index"]
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
right_api_client-1.5.9 spec/resources_spec.rb
right_api_client-1.5.8 spec/resources_spec.rb
right_api_client-1.5.7 spec/resources_spec.rb
right_api_client-1.5.6 spec/resources_spec.rb