Sha256: db05cdde03495347c883539c62f36ca7856c4755fe590dc52056e4485f80d4ab

Contents?: true

Size: 497 Bytes

Versions: 7

Compression:

Stored size: 497 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class JSONSerializerTest < ActiveRecord::TestCase
  def setup
    @red = create_color(:name => 'red')
    @car = create_car(:name => 'Ford Mustang', :color => @red)
    @json = @car.to_json
  end
  
  def test_should_include_enumeration_in_json
    assert_match %r{"color": "red"}, @json
  end
  
  def test_should_render_other_attributes
    assert_match %r{"id": #{@car.id}}, @json
    assert_match %r{"name": "Ford Mustang"}, @json
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
mschuerig-enumerate_by-0.4.2 test/unit/json_serializer_test.rb
pluginaweek-enumerate_by-0.4.2 test/unit/json_serializer_test.rb
pluginaweek-enumerate_by-0.4.3 test/unit/json_serializer_test.rb
enumerate_by-0.4.0 test/unit/json_serializer_test.rb
enumerate_by-0.4.1 test/unit/json_serializer_test.rb
enumerate_by-0.4.3 test/unit/json_serializer_test.rb
enumerate_by-0.4.2 test/unit/json_serializer_test.rb