"should be valid" do User.new(@attributes).should be_valid end end # Test::Unit class UserTest < Test::Unit::Case def test_user_validity assert User.new(@attributes).valid? end end
after_save :deliver_notification, :unless => :admin? end # NoDSL class User < ActiveRecord::Base def save(*) if super deliver_notification unless admin? end end end