Sha256: d0013b4afd66a1ae0bc42e4cb138592500dee14472ff648cff2852b1279fe8fd

Contents?: true

Size: 549 Bytes

Versions: 2

Compression:

Stored size: 549 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
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cantango-core-0.1.5 spec/cantango/ability/executor/base_spec.rb
cantango-core-0.1.4 spec/cantango/ability/executor/base_spec.rb