Sha256: 3f487a86a1be626628b299abcc2d65cee75ebf34051906f242314fc7ec8faa40

Contents?: true

Size: 547 Bytes

Versions: 3

Compression:

Stored size: 547 Bytes

Contents

require 'test_helper'

module PushType
  class DateFieldTest < ActiveSupport::TestCase

    class TestPage < PushType::Node
      field :foo, :date
    end

    let(:node)  { TestPage.create FactoryBot.attributes_for(:node, foo: date.to_s) }
    let(:date)  { Date.today }
    let(:field) { node.fields[:foo] }
    
    it { field.template.must_equal 'date' }
    it { field.form_helper.must_equal :date_field }
    it { field.json_value.must_equal date.to_s }
    it { field.value.must_equal date }

    it { node.foo.must_equal date }

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
push_type_core-0.12.1 test/fields/push_type/date_field_test.rb
push_type_core-0.12.0 test/fields/push_type/date_field_test.rb
push_type_core-0.12.0.beta.1 test/fields/push_type/date_field_test.rb