Sha256: 99e1e8197c125e6be4312ef4e7719356419445e0967f8a200a2b04aea6adcd43

Contents?: true

Size: 887 Bytes

Versions: 4

Compression:

Stored size: 887 Bytes

Contents

require 'cantango/config'
require 'fixtures/models'

CanTango.configure do |config|
  config.users.register :user, User
end

require 'spec_helper'

class UserContext
  include CanTango::Api::User
end

describe CanTango::Api::User do
  subject { UserContext.new }

  describe 'Ability API included' do
    [:user_ability, :current_user_ability].each do |name|
      specify { subject.should respond_to name }
    end
  end

  describe 'Can API included' do
    [:user_can?, :user_cannot?].each do |name|
      specify { subject.should respond_to name }
    end
  end

  describe 'Scope API included' do
    [:scope_user, :user_scope, :real_user].each do |name|
      specify { subject.should respond_to name }
    end
  end

  describe 'Session API included' do
    [:any_user, :active_user, :active_user=].each do |name|
      specify { subject.should respond_to name }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cantango-api-0.1.3 spec/cantango/api/user_spec.rb
cantango-api-0.1.2 spec/cantango/api/user_spec.rb
cantango-api-0.1.1 spec/cantango/api/user_spec.rb
cantango-api-0.1.0 spec/cantango/api/user_spec.rb