Sha256: db6ea25a80ab32792b1b0a331cf398513b61403d1f668a513c6081c308e2996d

Contents?: true

Size: 695 Bytes

Versions: 32

Compression:

Stored size: 695 Bytes

Contents

require 'test_helper'

module PushType
  class NumberFieldTest < ActiveSupport::TestCase

    class TestPage < PushType::Node
      field :foo, :number
      field :bar, :number
    end

    let(:node)  { TestPage.create FactoryGirl.attributes_for(:node, foo: 1, bar: 1.234) }
    let(:foo)   { node.fields[:foo] }
    let(:bar)   { node.fields[:bar] }

    
    it { foo.json_primitive.must_equal :number }
    it { foo.form_helper.must_equal :number_field }
    it { foo.json_value.must_equal 1 }
    it { foo.value.must_equal 1 }
    it { bar.json_value.must_equal 1.234 }
    it { bar.value.must_equal 1.234 }

    it { node.foo.must_equal 1 }
    it { node.bar.must_equal 1.234 }

  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

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