This project is archived and is in readonly mode.

#4636 ✓resolved
Neeraj Singh

assert should be replaced with assert_equal in a particular test case

Reported by Neeraj Singh | May 18th, 2010 @ 03:54 AM

Here is a test case from ActiveResource.

  def test_to_json
    Person.include_root_in_json = true
    Person.format = :json
    joe = Person.find(6)
    encode = joe.encode
    json = joe.to_json
    Person.format = :xml

    assert encode, json
    assert_match %r{^\{"person":\{"person":\{}, json
    assert_match %r{"id":6}, json
    assert_match %r{"name":"Joe"}, json
    assert_match %r{\}\}\}$}, json
  end

In the above test case 'assert' should be replaced by 'assert_equal'.

Patch will be attached through comment.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Referenced by

Pages