Sha256: 066d5078eaf0af4524617beb0b74ce811ceea02a3df02817a985fabcc42d0f06

Contents?: true

Size: 618 Bytes

Versions: 7

Compression:

Stored size: 618 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 permit_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

7 entries across 7 versions & 1 rubygems

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