Sha256: 3cf0bdd4df7abdde61759c1571d1c40728a5018dd8b773d2dcb186c5cd6297d1

Contents?: true

Size: 1.13 KB

Versions: 20

Compression:

Stored size: 1.13 KB

Contents

require 'spec_helper'

class Menu
end

class WaiterRolePermit < CanTango::RolePermit
  def initialize ability
    super
  end

  protected

  def permit_rules
    can :read, Menu
    cannot :write, Menu
  end
end

class ChefRolePermit < CanTango::RolePermit
  def initialize ability
    super
  end

  protected

  def permit_rules
    can :publish, Menu
    can :write, Menu
  end
end

class Context
  include CanTango::Api::User::Ability
end

# Note: This config feature is currently not used, but could potentially be of use in the future
describe CanTango::Configuration::Debug do
  let(:context) { Context.new }
  subject       { CanTango.config.debug }

  describe 'should set debug mode :on' do
    before do
      subject.set :on
    end

    its(:on?) { should be_true }
    its(:off?) { should be_false }
  end

  describe 'should set debug mode :off' do
    before do
      subject.set :on
    end

    its(:on?)   { should be_true  }
    its(:off?)  { should be_false }
  end

  describe 'debug! should set debug mode :on' do
    before do
      CanTango.debug!
    end

    its(:on?) { should be_true }
    its(:off?) { should be_false }
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
cantango-0.9.4.7 spec/cantango/configuration/debug_spec.rb
cantango-0.9.4.6 spec/cantango/configuration/debug_spec.rb
cantango-0.9.4.5 spec/cantango/configuration/debug_spec.rb
cantango-0.9.4.3 spec/cantango/configuration/debug_spec.rb
cantango-0.9.4.2 spec/cantango/configuration/debug_spec.rb
cantango-0.9.4.1 spec/cantango/configuration/debug_spec.rb
cantango-0.9.4 spec/cantango/configuration/debug_spec.rb
cantango-0.9.3.2 spec/cantango/configuration/debug_spec.rb
cantango-0.8.9.5 spec/cantango/configuration/debug_spec.rb
cantango-0.8.9.4 spec/cantango/configuration/debug_spec.rb
cantango-0.8.9.3 spec/cantango/configuration/debug_spec.rb
cantango-0.8.9.2 spec/cantango/configuration/debug_spec.rb
cantango-0.8.9.1 spec/cantango/configuration/debug_spec.rb
cantango-0.8.9 spec/cantango/configuration/debug_spec.rb
cantango-0.8.8.1 spec/cantango/configuration/debug_spec.rb
cantango-0.8.8 spec/cantango/configuration/debug_spec.rb
cantango-0.8.7 spec/cantango/configuration/debug_spec.rb
cantango-0.8.6.2 spec/cantango/configuration/debug_spec.rb
cantango-0.8.6.1 spec/cantango/configuration/debug_spec.rb
cantango-0.8.6 spec/cantango/configuration/debug_spec.rb