Sha256: 7826ebab13b4cdf7c76db5577c07f54bbc01674d5a598b40537818915686a0ca

Contents?: true

Size: 542 Bytes

Versions: 5

Compression:

Stored size: 542 Bytes

Contents

require 'spec_helper'
require 'fixtures/models'

module CanTango::Ability
  class Base
    def calculate_rules
      puts "calc"
      can :edit, Project
      cannot :publish, Project
    end
  end
end

describe CanTango::Ability::Base do
  before do
    @user = User.new 'krisy', 'krisy@gmail.com'
  end

  subject { CanTango::Ability::Base.new @user }

  specify { subject.can?(:edit, Project).should be_true }
  specify { subject.cannot?(:publish, Project).should be_true }

  specify { subject.should be_allowed_to(:edit, Project) }
end

Version data entries

5 entries across 5 versions & 1 rubygems

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