Sha256: c626052efb00c6295bc2825a2facc93a6875f2f8c03a21183cf1af9b27847108

Contents?: true

Size: 939 Bytes

Versions: 3

Compression:

Stored size: 939 Bytes

Contents

describe Unidom::Authorization::Permission, type: :model do

  before :each do
  end

  after :each do
  end

  context do

    model_attributes = {
      name: 'User Management',
      path: 'users'
    }

    it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes

    it_behaves_like 'validates text', model_attributes, :name,
      length: 2..described_class.columns_hash['name'].limit
    it_behaves_like 'validates text', model_attributes, :path,
      length: 2..described_class.columns_hash['path'].limit

    it_behaves_like 'scope', :path_is, [
      { attributes_collection: [ model_attributes ], count_diff: 1, args: [ model_attributes[:path]           ] },
      { attributes_collection: [ model_attributes ], count_diff: 0, args: [ "/#{model_attributes[:path]}"     ] },
      { attributes_collection: [ model_attributes ], count_diff: 0, args: [ "#{model_attributes[:path]}.html" ] }
    ]

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
unidom-authorization-2.0 lib/rspec/models/unidom/authorization/permission_spec.rb
unidom-authorization-1.6.10 lib/rspec/models/unidom/authorization/permission_spec.rb
unidom-authorization-1.6.9 lib/rspec/models/unidom/authorization/permission_spec.rb