Sha256: d93779256738287c73664ecd94d5fb2685cec880dab3b1090848f4fe386c8d2a

Contents?: true

Size: 859 Bytes

Versions: 1

Compression:

Stored size: 859 Bytes

Contents

require 'spec_helper'

CanTango.config.permits.types.register :user_type
CanTango.config.debug.set :on

module AdminAccountPermits
  class PublisherPermit < CanTango::Permit::UserType
  end
end

describe CanTango::Finder::Permit::Account do
  subject do
    CanTango::Finder::Permit::Account.new :publisher, :type => :user_type, :account => :admin
  end
  
  describe '#account_registry' do
    it 'should return the permits registry for the given ccount' do
      subject.account_registry.should be_a CanTango::Registry::Permit::Base
    end
  end
  
  describe '#permits' do
    it 'should return the account permits for a given type' do
      subject.permits.should be_a CanTango::Registry::Hash
      subject.permits.registered.should be_a Hashie::Mash
    end
  end
  
  specify { subject.find_permit.should == AdminAccountPermits::PublisherPermit }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cantango-permits-0.1.1 spec/cantango/finder/account_permit_spec.rb