Sha256: fb8107d9dd7ecc33006e07e677cb2b5dd5a9a04f6c3129f8079701c832c023de

Contents?: true

Size: 590 Bytes

Versions: 7

Compression:

Stored size: 590 Bytes

Contents

require 'spec_helper'

module CanTango::Ability
  class Base
    include CanTango::Ability::Helper::Account
    
    def permit_rules
      can :edit, Project
    end
  end
end

class MyAccount
end

class User
  attr_accessor :account
end

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

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cantango-core-0.1.9 spec/cantango/ability/helper/account_spec.rb
cantango-core-0.1.8 spec/cantango/ability/helper/account_spec.rb
cantango-core-0.1.7 spec/cantango/ability/helper/account_spec.rb
cantango-core-0.1.6 spec/cantango/ability/helper/account_spec.rb
cantango-core-0.1.5 spec/cantango/ability/helper/account_spec.rb
cantango-core-0.1.4 spec/cantango/ability/helper/account_spec.rb
cantango-core-0.1.3 spec/cantango/ability/helper/account_spec.rb