Sha256: 080342920ea322b0621ee7d0d5430c45a45ff8850008e5346842d43f2feee84a
Contents?: true
Size: 674 Bytes
Versions: 6
Compression:
Stored size: 674 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) } it { should_not allow_value(nil).for(:lat) } it { should_not allow_value('').for(:lat) } end end
Version data entries
6 entries across 6 versions & 1 rubygems