Sha256: 640f3f7817f645497d99553ca6d57f6826858f7ac88e2e38de3121c22b72f5f7

Contents?: true

Size: 1.57 KB

Versions: 12

Compression:

Stored size: 1.57 KB

Contents

require 'minitest_helper'

describe Fog::Compute::XenServer::Models::Role do
  let(:role_class) do
    class Fog::Compute::XenServer::Models::Role
      def self.read_identity
        instance_variable_get('@identity')
      end
    end
    Fog::Compute::XenServer::Models::Role
  end

  it 'should associate to a provider class' do
    role_class.provider_class.must_equal('role')
  end

  it 'should have a collection name' do
    role_class.collection_name.must_equal(:roles)
  end

  it 'should have an unique id' do
    role_class.read_identity.must_equal(:reference)
  end

  it 'should have 4 attributes' do
    role_class.attributes.must_equal([ :reference,
                                       :description,
                                       :name,
                                       :uuid ])
  end

  it 'should have 1 association' do
    role_class.associations.must_equal(:subroles => :roles)
  end

  it 'should have 5 masks' do
    role_class.masks.must_equal(:reference => :reference, 
                                :description => :description, 
                                :name => :name, 
                                :uuid => :uuid, 
                                :subroles => :subroles)
  end

  it 'should have 2 aliases' do
    role_class.aliases.must_equal({ :name_description => :description,
                                    :name_label => :name })
  end

  it "shouldn't have default values" do
    role_class.default_values.must_equal({})
  end

  it "shouldn't require attributes before save" do
    role_class.require_before_save.must_equal([])
  end
end

Version data entries

12 entries across 10 versions & 2 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-xenserver-0.3.0/spec/fog/compute/xen_server/models/role_spec.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-xenserver-0.3.0/spec/fog/compute/xen_server/models/role_spec.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-xenserver-0.3.0/spec/fog/compute/xen_server/models/role_spec.rb
fog-xenserver-0.3.0 spec/fog/compute/xen_server/models/role_spec.rb
fog-xenserver-0.2.3 spec/fog/compute/xen_server/models/role_spec.rb
fog-xenserver-0.2.2 spec/fog/compute/xen_server/models/role_spec.rb
fog-xenserver-0.2.1 spec/fog/compute/xen_server/models/role_spec.rb
fog-xenserver-0.2.0 spec/fog/compute/xen_server/models/role_spec.rb
fog-xenserver-0.1.2 spec/fog/compute/xen_server/models/role_spec.rb
fog-xenserver-0.1.1 spec/fog/compute/xen_server/models/role_spec.rb
fog-xenserver-0.1.0 spec/fog/compute/xen_server/models/role_spec.rb
fog-xenserver-0.0.1.beta2 spec/fog/compute/xen_server/models/role_spec.rb