提交 55640fb9 编写于 作者: J Jeremy Kemper

Simplify some JSON tests

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7750 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 5b2e8b1e
......@@ -23,7 +23,7 @@ def test_should_encode_all_encodable_attributes
assert_match %r{"name": "Konata Izumi"}, json
assert_match %r{"age": 16}, json
assert_match %r{"created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))}}, json
assert json.include?(%("created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))}))
assert_match %r{"awesome": true}, json
assert_match %r{"preferences": \{"shows": "anime"\}}, json
end
......@@ -34,7 +34,7 @@ def test_should_allow_attribute_filtering_with_only
assert_match %r{"name": "Konata Izumi"}, json
assert_match %r{"age": 16}, json
assert_no_match %r{"awesome": true}, json
assert_no_match %r{"created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))}}, json
assert !json.include?(%("created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))}))
assert_no_match %r{"preferences": \{"shows": "anime"\}}, json
end
......@@ -44,7 +44,7 @@ def test_should_allow_attribute_filtering_with_except
assert_no_match %r{"name": "Konata Izumi"}, json
assert_no_match %r{"age": 16}, json
assert_match %r{"awesome": true}, json
assert_match %r{"created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))}}, json
assert json.include?(%("created_at": #{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))}))
assert_match %r{"preferences": \{"shows": "anime"\}}, json
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册