Sha256: a2ecca1b18f5b24b1284224efc3740ad385090020ddf8565cb282818928a67aa
Contents?: true
Size: 926 Bytes
Versions: 19
Compression:
Stored size: 926 Bytes
Contents
require 'test_helper' class EnabledForControllerTest < ActionController::TestCase tests ArticlesController context "`PaperTrail.enabled? == true`" do should 'enabled_for_controller?.should == true' do assert PaperTrail.enabled? post :create, :article => { :title => 'Doh', :content => Faker::Lorem.sentence } assert_not_nil assigns(:article) assert PaperTrail.enabled_for_controller? assert_equal 1, assigns(:article).versions.length end end context "`PaperTrail.enabled? == false`" do setup { PaperTrail.enabled = false } should 'enabled_for_controller?.should == false' do assert !PaperTrail.enabled? post :create, :article => { :title => 'Doh', :content => Faker::Lorem.sentence } assert !PaperTrail.enabled_for_controller? assert_equal 0, assigns(:article).versions.length end teardown { PaperTrail.enabled = true } end end
Version data entries
19 entries across 19 versions & 1 rubygems