Sha256: 786c9609242e5acdfbf1997913b442d3e0040d1d7f39995d0067d9bcc54bdf43

Contents?: true

Size: 669 Bytes

Versions: 1

Compression:

Stored size: 669 Bytes

Contents

require 'test_helper'

class UserTest < ActiveSupport::TestCase
  test "defining a callback should fail" do
    assert_raises(RuntimeError, "❨╯°□°❩╯︵sʞɔɐqllɐɔ") do
      class Fake < ActiveRecord::Base
        before_save :fail_one
        after_update :fail_two
      end
    end
  end

  test "not defining callbacks should still succeed" do
    assert_nothing_raised do
      class Fake < ActiveRecord::Base
        def initialize
          @thing = "one"
        end
      end
    end
  end

  test "using callbacks should fail" do
    assert_raises(RuntimeError, "❨╯°□°❩╯︵sʞɔɐqllɐɔ") { User.new(name: "Test").save }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
moms_spaghetti-1.0.0 test/dummy/test/models/user_test.rb