Module: CustomValidations::Etest

Defined in:
lib/vex/active_record/custom_validations.rb

Defined Under Namespace

Classes: CVModel

Instance Method Summary collapse

Instance Method Details

#test_lite_tableObject


91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/vex/active_record/custom_validations.rb', line 91

def test_lite_table
  CVModel.lite_table do
    string :url
  end

  cv = CVModel.new :url => "http://xx.yy"
  assert cv.valid?

  cv = CVModel.new :url => "data://xx.yy"
  assert cv.valid?

  cv = CVModel.new :url => "file:xx.yy"
  assert cv.valid?

  cv = CVModel.new :url => "illegal"
  assert !cv.valid?
end