Sha256: 0d4296bd32634ca1c8ffef8740a7fabc4006076cf1df5f4580c630cfa3a7a4f6

Contents?: true

Size: 515 Bytes

Versions: 24

Compression:

Stored size: 515 Bytes

Contents

require 'spec_helper'

module Engine
  extend Chili::Activatable
end

class DummyController
  def logged_in? ; true end
  def admin? ; false end
end

describe Chili::Activatable do
  describe '#active_if & #active?' do
    it "evaluates the active_if block within the context of the instance" do
      Engine.active_if { logged_in? }
      Engine.active?(DummyController.new).should be_true
      Engine.active_if { logged_in? && admin? }
      Engine.active?(DummyController.new).should be_false
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
chili-4.0.1 spec/chili/activatable_spec.rb
chili-4.0.0 spec/chili/activatable_spec.rb
chili-3.1.1 spec/chili/activatable_spec.rb
chili-3.1.0 spec/chili/activatable_spec.rb
chili-3.0.0 spec/chili/activatable_spec.rb
chili-2.0.1 spec/lib/chili/activatable_spec.rb
chili-2.0.0 spec/lib/chili/activatable_spec.rb
chili-1.0.1 spec/lib/chili/activatable_spec.rb
chili-1.0.0 spec/lib/chili/activatable_spec.rb
chili-0.3.5 spec/lib/chili/activatable_spec.rb
chili-0.3.4 spec/lib/chili/activatable_spec.rb
chili-0.3.3 spec/lib/chili/activatable_spec.rb
chili-0.3.2 spec/lib/chili/activatable_spec.rb
chili-0.3.1 spec/lib/chili/activatable_spec.rb
chili-0.3.0 spec/lib/chili/activatable_spec.rb
chili-0.2.2 spec/lib/chili/activatable_spec.rb
chili-0.2.1 spec/lib/chili/activatable_spec.rb
chili-0.2.0 spec/lib/chili/activatable_spec.rb
chili-0.1.0 spec/lib/chili/activatable_spec.rb
chili-0.0.9 spec/lib/chili/activatable_spec.rb