Sha256: c65665ec39a229fb73316aa19fdee599f78d111f843217fa222c69f476b1ca4e
Contents?: true
Size: 499 Bytes
Versions: 2
Compression:
Stored size: 499 Bytes
Contents
require 'spec_helper' describe ColorValidator do context "Color has a valid value" do let(:klass) do Class.new do include ActiveModel::Validations attr_accessor :color validates :color, color: true end end subject { klass.new } it { should allow_value("#000000").for(:color) } it { should allow_value("#ab00FF").for(:color) } it { should_not allow_value("kk").for(:color) } it { should_not allow_value(0).for(:color) } end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
missing_validators-1.1.0 | spec/validators/color_validator_spec.rb |
missing_validators-1.0.1 | spec/validators/color_validator_spec.rb |