Sha256: 2a6e86052ba730079164b626aed69fa0c483a14d55f9594c96446c75cef6c63c

Contents?: true

Size: 591 Bytes

Versions: 2

Compression:

Stored size: 591 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.candidate.should == @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

2 entries across 2 versions & 1 rubygems

Version Path
cantango-core-0.1.9.3 spec/cantango/ability/base_spec.rb
cantango-core-0.1.9.2 spec/cantango/ability/base_spec.rb