Sha256: 70b49099a01c3cc4b0e230af931d77aa2241af54eb0729549d84638b1bd70193
Contents?: true
Size: 1.05 KB
Versions: 2
Compression:
Stored size: 1.05 KB
Contents
require "test_helper" module PushType describe Customizable do let(:page) { TestPage.new } let(:fields) { page.fields } it { TestPage.fields.must_be_instance_of ActiveSupport::OrderedHash } it { fields.must_be_instance_of ActiveSupport::OrderedHash } describe '.field' do before :all do TestPage.instance_variable_set '@fields', ActiveSupport::OrderedHash.new TestPage.field :foo TestPage.field :bar, :text TestPage.field :baz, validates: { presence: true } TestPage.field :qux, :rich_text, validates: { presence: true } end it { fields[:foo].must_be_instance_of StringField } it { fields[:bar].must_be_instance_of TextField } it { fields[:baz].must_be_instance_of StringField } it { TestPage.validators_on(:baz).map(&:class).must_include ActiveRecord::Validations::PresenceValidator } it { fields[:qux].must_be_instance_of RichTextField } it { TestPage.validators_on(:qux).map(&:class).must_include ActiveRecord::Validations::PresenceValidator } end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
push_type_core-0.1.1 | test/models/concerns/push_type/customizable_test.rb |
push_type_core-0.1.0 | test/models/concerns/push_type/customizable_test.rb |