Sha256: 0ac34cf42e029e6ca6203e1089411a22a5200ebff0e9be59d86da3e6b5f85241

Contents?: true

Size: 742 Bytes

Versions: 4

Compression:

Stored size: 742 Bytes

Contents

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

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

  config.accounts.register  :user,  UserAccount
  config.accounts.register  :admin, AdminAccount
end

require 'spec_helper'

class UserAccount
  tango_account
end

class AdminAccount
  tango_account
end

class Context
  include CanTango::Api::Model::Account
end

describe CanTango::Api::Model::Account do
  subject { Context.new }

  specify do
    CanTango.config.accounts.registered.should include(:admin, :user)
  end

  describe 'Model API included' do
    [:active_user, :can?, :cannot?].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/model/account_spec.rb
cantango-api-0.1.2 spec/cantango/api/model/account_spec.rb
cantango-api-0.1.1 spec/cantango/api/model/account_spec.rb
cantango-api-0.1.0 spec/cantango/api/model/account_spec.rb