Sha256: 775bda1eccbcb6d9e8708885919d7a7ff226440b3a713d186814c78f20f86b6c

Contents?: true

Size: 970 Bytes

Versions: 1

Compression:

Stored size: 970 Bytes

Contents

require 'rspec'
require 'cantango'
require 'fixtures/models'

@user = User.new('kris', 'kris@gmail.com')

class CanTango::CustomAbility < CanTango::Ability
  def initialize candidate, options = {}
    'custom'
  end
end

describe CanTango::Configuration do
  describe 'clear!' do
    subject { CanTango.config }

    before do
      subject.roles.exclude :user
      subject.role_groups.exclude :admins

      subject.clear!
    end

    specify { subject.roles.excluded.should be_empty }
    specify { subject.role_groups.excluded.should be_empty }
  end

  describe "configure DSL" do
    before(:all) {
      CanTango.configure do |config|
        CanTango.config.engines.available.each do |name|
          config.engine(name).set :off
        end
     end
    }

    CanTango.config.engines.available.each do |name|
      specify { CanTango.config.engine(name).on?.should be_false}
      specify { CanTango.config.engine(name).off?.should be_true}
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cantango-0.8.0 spec/cantango/configuration_spec.rb