Sha256: 6a618210d1402826a63923cba4f82aa23c1c76ce65872087133219be42f339f0

Contents?: true

Size: 621 Bytes

Versions: 3

Compression:

Stored size: 621 Bytes

Contents

require 'spec_helper'

class MyAccount
end

class User
  attr_accessor :account
end

module CanTango::Ability
  class Base
    include CanTango::Ability::Helper::User
    
    def calculate_rules
      can :edit, Project
    end
  end
end

describe CanTango::Ability::Helper::User do
  before do
    @user = User.new
  end
  
  subject do
    CanTango::Ability::Base.new @user
  end

  context 'Ability should have' do  
    describe '#user method' do
      specify { subject.user.should == @user }
    end

    describe '#user_key_field' do
      specify { subject.should respond_to(:user_key_field) }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cantango-core-0.1.9.3 spec/cantango/ability/helper/user_spec.rb
cantango-core-0.1.9.2 spec/cantango/ability/helper/user_spec.rb
cantango-core-0.1.9.1 spec/cantango/ability/helper/user_spec.rb