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