Sha256: f1f182a8c13be3da58587f88530b0dfa6b89aac98373453a11fc7c6b45f9161f

Contents?: true

Size: 744 Bytes

Versions: 10

Compression:

Stored size: 744 Bytes

Contents

require 'spec_helper'

describe Spectifly::Json::Field do
  describe '#to_h' do
    it 'returns hash format of field' do
      expected = {
        :a_field => {
          :type => 'people',
          :multiple => false,
          :required => true,
          :description => "People who don't worry about longevity",
          :example => 'children',
          :validations => ['Must be young', 'Must love eating mud']
        }
      }

      field = described_class.new('A Field*', {
        'Description' => "People who don't worry about longevity",
        'Type' => 'people',
        'Example' => 'children',
        'Validations' => ['Must be young', 'Must love eating mud']
      })
      field.to_h.should == expected
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spectifly-0.0.10 spec/spectifly/json/field_spec.rb
spectifly-0.0.9 spec/spectifly/json/field_spec.rb
spectifly-0.0.8 spec/spectifly/json/field_spec.rb
spectifly-0.0.7 spec/spectifly/json/field_spec.rb
spectifly-0.0.6 spec/spectifly/json/field_spec.rb
spectifly-0.0.5 spec/spectifly/json/field_spec.rb
spectifly-0.0.4 spec/spectifly/json/field_spec.rb
spectifly-0.0.3 spec/spectifly/json/field_spec.rb
spectifly-0.0.2 spec/spectifly/json/field_spec.rb
spectifly-0.0.1 spec/spectifly/json/field_spec.rb