mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Replace assert with assert_equal in some test cases
[#4654 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
048cf9e922
commit
1bc6b43f53
2 changed files with 5 additions and 5 deletions
|
@ -65,7 +65,7 @@ class ValidationsTest < ActiveRecord::TestCase
|
|||
def test_error_on_given_context
|
||||
r = WrongReply.new
|
||||
assert !r.valid?(:special_case)
|
||||
assert "Invalid", r.errors[:title].join
|
||||
assert_equal "Invalid", r.errors[:title].join
|
||||
|
||||
r.title = "secret"
|
||||
r.content = "Good"
|
||||
|
@ -73,7 +73,7 @@ class ValidationsTest < ActiveRecord::TestCase
|
|||
|
||||
r.title = nil
|
||||
assert !r.save(:context => :special_case)
|
||||
assert "Invalid", r.errors[:title].join
|
||||
assert_equal "Invalid", r.errors[:title].join
|
||||
|
||||
r.title = "secret"
|
||||
assert r.save(:context => :special_case)
|
|
@ -1017,7 +1017,7 @@ class BaseTest < Test::Unit::TestCase
|
|||
encode = matz.encode
|
||||
xml = matz.to_xml
|
||||
|
||||
assert encode, xml
|
||||
assert_equal encode, xml
|
||||
assert xml.include?('<?xml version="1.0" encoding="UTF-8"?>')
|
||||
assert xml.include?('<name>Matz</name>')
|
||||
assert xml.include?('<id type="integer">1</id>')
|
||||
|
@ -1030,7 +1030,7 @@ class BaseTest < Test::Unit::TestCase
|
|||
encode = matz.encode
|
||||
xml = matz.to_xml
|
||||
|
||||
assert encode, xml
|
||||
assert_equal encode, xml
|
||||
assert xml.include?('<?xml version="1.0" encoding="UTF-8"?>')
|
||||
assert xml.include?('<ruby-creator>')
|
||||
assert xml.include?('<name>Matz</name>')
|
||||
|
@ -1065,7 +1065,7 @@ class BaseTest < Test::Unit::TestCase
|
|||
json = joe.to_json
|
||||
Person.format = :xml
|
||||
|
||||
assert encode, json
|
||||
assert_equal encode, json
|
||||
assert_match %r{^\{"ruby_creator":\{"person":\{}, json
|
||||
assert_match %r{"id":6}, json
|
||||
assert_match %r{"name":"Joe"}, json
|
Loading…
Reference in a new issue