Sha256: 4c361bbfb5dd6071375dc3f9968bcf28d6735c92a3683a4e7ce9495dfccf56d3

Contents?: true

Size: 671 Bytes

Versions: 7

Compression:

Stored size: 671 Bytes

Contents

require 'spec_helper'
require 'fixtures/models'

module CanTango::Ability::Executor
  class Base
    def calculate_rules
      puts "calculate_rules"
      can :write, Post
    end
  end
end

describe CanTango::Ability::Executor::Base do
  before do
    @user = User.new 'admin', 'admin@mail.ru'
    @ability = CanTango::Ability::Base.new @user
  end

  subject do 
    CanTango::Ability::Executor::Base.new @ability
  end

  describe 'should not be executable' do
    specify do
      lambda { subject.execute }.should raise_error
    end
  end

  describe 'should not have ability' do
    specify do
      lambda { subject.ability }.should raise_error
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cantango-core-0.1.9.3 spec/cantango/ability/executor/base_spec.rb
cantango-core-0.1.9.2 spec/cantango/ability/executor/base_spec.rb
cantango-core-0.1.9.1 spec/cantango/ability/executor/base_spec.rb
cantango-core-0.1.9 spec/cantango/ability/executor/base_spec.rb
cantango-core-0.1.8 spec/cantango/ability/executor/base_spec.rb
cantango-core-0.1.7 spec/cantango/ability/executor/base_spec.rb
cantango-core-0.1.6 spec/cantango/ability/executor/base_spec.rb