[groonga-commit:4190] ranguba/ranguba [master] test by find and assert_equal.

null+ranguba at clear-code.com null+ranguba at clear-code.com
Tue Jan 10 08:00:34 EST 2012


Kouhei Sutou	2012-01-10 22:00:34 +0900 (Tue, 10 Jan 2012)

  New Revision: cc0a1b68c4612da853c8a8897063c1152107e09d

  Log:
    test by find and assert_equal.

  Modified files:
    test/integration/search_test.rb

  Modified: test/integration/search_test.rb (+5 -14)
===================================================================
--- test/integration/search_test.rb    2012-01-10 21:49:31 +0900 (64fa673)
+++ test/integration/search_test.rb    2012-01-10 22:00:34 +0900 (fb89dc5)
@@ -516,20 +516,11 @@ class SearchTest < ActionDispatch::IntegrationTest
     assert page.has_no_selector?(".topic_path"), page.body
   end
 
-  def assert_pagination(pagenum)
-    assert page.has_selector?(".pagination"), page.body
-    pagenum = pagenum.split("/")
-    total = pagenum[1].to_i
-    current = pagenum[0].to_i
-
-    assert page.has_xpath?("/descendant::*[@class='pagination']"+
-                           "/descendant::em[text()='#{current}']"),
-           page.body
-    unless current == total
-      assert page.has_xpath?("/descendant::*[@class='pagination']"+
-                             "/descendant::a[last()-1][text()='#{total}']"),
-             page.body
-    end
+  def assert_pagination(pagination_label)
+    current, total = pagination_label.split("/")
+
+    pagination = find(".pagination")
+    assert_equal(current, pagination.find(".current").text)
   end
 
   def assert_no_pagination



More information about the groonga-commit mailing list