Sha256: f27d14c901bb3da0ef75a26dad93cf854f4a211ad0756464fb39d4def7123c82
Contents?: true
Size: 1023 Bytes
Versions: 1
Compression:
Stored size: 1023 Bytes
Contents
require File.join(File.dirname(__FILE__), 'helper') class TestTriggerCallbackMatcher < Test::Unit::TestCase context "doing nothing to a record" do subject { Blog.new :title => 'blog title' } should_not trigger_callbacks end context "creating a record" do subject { Blog.create! :title => 'blog title' } should trigger_callbacks.for :create should_not trigger_callbacks.for :update, :destroy end context "updating a record" do subject do Blog.create!( :title => 'blog title').tap do |b| b.reset_callback_flags! b.update_attribute :title, 'new blog title' end end should trigger_callbacks.for :update should_not trigger_callbacks.for :create, :destroy end context "destroying a record" do subject do Blog.create!( :title => 'blog title').tap do |b| b.reset_callback_flags! b.destroy end end should trigger_callbacks.for :destroy should_not trigger_callbacks.for :create, :update end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
socialcast_shoulda_ext-0.1.2 | test/test_trigger_callback_matcher.rb |