test/test_post_form.rb in mechanize-2.0 vs test/test_post_form.rb in mechanize-2.0.1

- old
+ new

@@ -1,20 +1,18 @@ require "helper" -class PostForm < Test::Unit::TestCase +class PostForm < MiniTest::Unit::TestCase def setup @agent = Mechanize.new end def test_post_form page = @agent.post("http://localhost/form_post", 'gender' => 'female' ) - assert_not_nil( - page.links.find { |l| l.text == "gender:female" }, - "gender field missing" - ) + assert(page.links.find { |l| l.text == "gender:female" }, + "gender field missing") end def test_post_form_json page = @agent.post "http://localhost/form_post", 'json' => '["&quot;"]' @@ -26,16 +24,14 @@ page = @agent.post("http://localhost/form_post", [ ['gender', 'female'], ['gender', 'male'] ] ) - assert_not_nil( - page.links.find { |l| l.text == "gender:female" }, - "gender field missing" - ) - assert_not_nil( - page.links.find { |l| l.text == "gender:male" }, - "gender field missing" - ) + assert(page.links.find { |l| l.text == "gender:female" }, + "gender field missing") + + assert(page.links.find { |l| l.text == "gender:male" }, + "gender field missing") + assert_equal(2, page.links.length) end end