Sha256: f9ea82504f8c4243f770aa699aa2eb3bf6187f2ff989eb39bf5671ac6bc3ccf0

Contents?: true

Size: 588 Bytes

Versions: 1

Compression:

Stored size: 588 Bytes

Contents

require "test_helper"
require "active_record"

class BoundMapperTest < TestCase

  def setup
    @bound_mapper = Valle::BoundMapper.new
  end

  def test_should_return_bound
    column = ::ActiveRecord::ConnectionAdapters::Column.new("test_column", "")
    assert @bound_mapper.bound(column), "Bound for column '#{column.name}' not found"
  end

  def test_should_return_maximum_for_column_with_type_string
    column = ::ActiveRecord::ConnectionAdapters::Column.new("test_column", "", "string(255)")
    bound = @bound_mapper.bound(column)

    assert_equal 255, bound.maximum
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
valle-0.0.1 test/lib/bound_mapper_test.rb