Sha256: bb7885eeca9c7c368ff57fd76aceab3f86f4f4d83d6095e267849aa13faa287b

Contents?: true

Size: 625 Bytes

Versions: 31

Compression:

Stored size: 625 Bytes

Contents

require 'test_helper'

class Superstore::ValidationsTest < Superstore::TestCase
  test 'create!' do
    begin
      Issue.validates(:description, presence: true)

      Issue.create!(description: 'lol')

      assert_raise(Superstore::RecordInvalid) { Issue.create!(description: '') }
    ensure
      Issue.reset_callbacks(:validate)
    end
  end

  test 'save!' do
    begin
      Issue.validates(:description, presence: true)

      Issue.new(description: 'lol').save!

      assert_raise(Superstore::RecordInvalid) { Issue.new(description: '').save! }
    ensure
      Issue.reset_callbacks(:validate)
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
superstore-2.4.4 test/unit/validations_test.rb
superstore-2.4.3 test/unit/validations_test.rb
superstore-2.4.2 test/unit/validations_test.rb
superstore-2.4.1 test/unit/validations_test.rb
superstore-2.4.0 test/unit/validations_test.rb
superstore-2.3.0 test/unit/validations_test.rb
superstore-2.2.0 test/unit/validations_test.rb
superstore-2.1.3 test/unit/validations_test.rb
superstore-2.1.2 test/unit/validations_test.rb
superstore-2.1.1 test/unit/validations_test.rb
superstore-2.1.0 test/unit/validations_test.rb
superstore-2.0.1 test/unit/validations_test.rb
superstore-2.0.0 test/unit/validations_test.rb
superstore-1.2.0 test/unit/validations_test.rb
superstore-1.1.4 test/unit/validations_test.rb
superstore-1.1.3 test/unit/validations_test.rb
superstore-1.1.2 test/unit/validations_test.rb
superstore-1.1.1 test/unit/validations_test.rb
superstore-1.1.0 test/unit/validations_test.rb
superstore-1.0.12 test/unit/validations_test.rb