Sha256: b1fe0ec1c971a40267da6ce9f036b339860af17a6f6f5886c2d89718adfb405a
Contents?: true
Size: 576 Bytes
Versions: 2
Compression:
Stored size: 576 Bytes
Contents
require 'spec_helper' describe LatitudeValidator do context "Latitude has a valid value" do let(:klass) do Class.new do include ActiveModel::Validations attr_accessor :lat validates :lat, latitude: true end end subject { klass.new } it { should allow_value(-90).for(:lat) } it { should allow_value(90).for(:lat) } it { should allow_value(0).for(:lat) } it { should allow_value(9.33).for(:lat) } it { should_not allow_value(-90.1).for(:lat) } it { should_not allow_value(90.1).for(:lat) } end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
missing_validators-0.8.1 | spec/validators/latitude_validator_spec.rb |
missing_validators-0.8.0 | spec/validators/latitude_validator_spec.rb |