Sha256: e3d50bf7f2e30792b57b056298573d2287da546128df3e12a7b526b9ed3390f4

Contents?: true

Size: 588 Bytes

Versions: 32

Compression:

Stored size: 588 Bytes

Contents

require 'test_helper'

module PushType
  class TimeFieldTest < ActiveSupport::TestCase

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

    let(:node)  { TestPage.create FactoryGirl.attributes_for(:node, foo: val) }
    let(:val)   { '15:00' }
    let(:field) { node.fields[:foo] }
    
    it { field.template.must_equal 'date' }
    it { field.form_helper.must_equal :time_field }
    it { field.json_value.must_equal val }
    it { field.value.must_equal val.to_time }

    it { node.foo.must_be_instance_of Time }
    it { node.foo.hour.must_equal 15 }

  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
push_type_core-0.11.2 test/fields/push_type/time_field_test.rb
push_type_core-0.11.1 test/fields/push_type/time_field_test.rb
push_type_core-0.11.0.beta.2 test/fields/push_type/time_field_test.rb
push_type_core-0.11.0.beta.1 test/fields/push_type/time_field_test.rb
push_type_core-0.10.4 test/fields/push_type/time_field_test.rb
push_type_core-0.10.3 test/fields/push_type/time_field_test.rb
push_type_core-0.10.2 test/fields/push_type/time_field_test.rb
push_type_core-0.10.1 test/fields/push_type/time_field_test.rb
push_type_core-0.10.0 test/fields/push_type/time_field_test.rb
push_type_core-0.10.0.beta.5 test/fields/push_type/time_field_test.rb
push_type_core-0.10.0.beta.3 test/fields/push_type/time_field_test.rb
push_type_core-0.9.5 test/fields/push_type/time_field_test.rb
push_type_core-0.9.3 test/fields/push_type/time_field_test.rb
push_type_core-0.9.2 test/fields/push_type/time_field_test.rb
push_type_core-0.9.1 test/fields/push_type/time_field_test.rb
push_type_core-0.9.0 test/fields/push_type/time_field_test.rb
push_type_core-0.9.0.beta.4 test/fields/push_type/time_field_test.rb
push_type_core-0.9.0.beta.3 test/fields/push_type/time_field_test.rb
push_type_core-0.9.0.beta.2 test/fields/push_type/time_field_test.rb
push_type_core-0.8.2 test/fields/push_type/time_field_test.rb