Sha256: 822d002bffd1944dba8397965505816cd5b29470a390840499aa0255041e322d

Contents?: true

Size: 887 Bytes

Versions: 20

Compression:

Stored size: 887 Bytes

Contents

module Duracloud
  RSpec.describe Store do

    let(:url) { "https://example.com/durastore/stores" }

    let(:body) { <<-EOS
<?xml version="1.0" encoding="UTF-8"?>
<storageProviderAccounts>
  <storageAcct ownerId="0" isPrimary="0">
    <id>1</id>
    <storageProviderType>AMAZON_GLACIER</storageProviderType>
  </storageAcct>
  <storageAcct ownerId="0" isPrimary="1">
    <id>2</id>
    <storageProviderType>AMAZON_S3</storageProviderType>
  </storageAcct>
</storageProviderAccounts>
EOS
    }

    before {
      stub_request(:get, url).to_return(body: body)
    }

    describe ".all" do
      subject { Store.all }
      specify {
        expect(subject.map(&:provider_type)).to contain_exactly("AMAZON_GLACIER", "AMAZON_S3")
      }
    end

    describe ".primary" do
      subject { Store.primary }
      specify {
        expect(subject.id).to eq("2")
      }
    end

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
duracloud-client-0.10.2 spec/unit/store_spec.rb
duracloud-client-0.10.1 spec/unit/store_spec.rb
duracloud-client-0.10.0 spec/unit/store_spec.rb
duracloud-client-0.9.1 spec/unit/store_spec.rb
duracloud-client-0.9.0 spec/unit/store_spec.rb
duracloud-client-0.8.0 spec/unit/store_spec.rb
duracloud-client-0.7.2 spec/unit/store_spec.rb
duracloud-client-0.7.1 spec/unit/store_spec.rb
duracloud-client-0.7.0 spec/unit/store_spec.rb
duracloud-client-0.6.0 spec/unit/store_spec.rb
duracloud-client-0.5.0 spec/unit/store_spec.rb
duracloud-client-0.4.0 spec/unit/store_spec.rb
duracloud-client-0.3.0 spec/unit/store_spec.rb
duracloud-client-0.2.0 spec/unit/store_spec.rb
duracloud-client-0.1.5 spec/unit/store_spec.rb
duracloud-client-0.1.4 spec/unit/store_spec.rb
duracloud-client-0.1.3 spec/unit/store_spec.rb
duracloud-client-0.1.2 spec/unit/store_spec.rb
duracloud-client-0.1.1 spec/unit/store_spec.rb
duracloud-client-0.1.0 spec/unit/store_spec.rb