Sha256: 80edcc4fa858c270bcf3f8052ab40acdd11a88303d1ddc39af367c28315b9a89

Contents?: true

Size: 666 Bytes

Versions: 1

Compression:

Stored size: 666 Bytes

Contents

require 'spec_helper'
require 'fixtures/models'

class AdminAccountPermit < CanTango::Permit::AccountType
  def initialize ability
    super
  end

  protected

  def static_rules
    can :read, Article
  end
end

describe CanTango::Permit::AccountType do
  before do
    @user = SimpleUser.new
    @ability = CanTango::Ability::Base.new @user
    @permit = AdminAccountPermit.new @ability
  end

  subject { @permit }

  describe 'attributes' do
    it "should be the permit for the :admin account" do
      subject.account_type.should == :admin
    end

    it "should have an ability" do
      subject.ability.should be_a CanTango::Ability::Base
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cantango-permits-0.1.1 spec/cantango/permit/account_type_spec.rb