[groonga-commit:4222] ranguba/ranguba [master] [test] cleanup topic path test.

null+ranguba at clear-code.com null+ranguba at clear-code.com
Sat Jan 14 10:55:56 EST 2012


Kouhei Sutou	2012-01-15 00:55:56 +0900 (Sun, 15 Jan 2012)

  New Revision: 11574de68837a1d7c4ef6780847b5210a34fdd36

  Log:
    [test] cleanup topic path test.

  Modified files:
    test/integration/search_test.rb

  Modified: test/integration/search_test.rb (+20 -22)
===================================================================
--- test/integration/search_test.rb    2012-01-15 00:09:33 +0900 (bde97a4)
+++ test/integration/search_test.rb    2012-01-15 00:55:56 +0900 (e0c9c45)
@@ -148,34 +148,33 @@ class SearchTest < ActionDispatch::IntegrationTest
     def test_step_by_step
       assert_visit("/search/query/HTML+entry/type/html/category/test")
 
-      find(:xpath, "/descendant::li[@class='topic_path_item']"+
-                                  "[@data-key='query']"+
-                                  "[@data-value='entry']"+
-                   "/child::a[@class='topic_path_reduce_link']").click
-      assert_equal("/search/query/HTML/type/html/category/test", current_path)
+      within(".topic_path") do
+        assert_all(".topic_path_reduce_link").last.click
+      end
+      assert_equal("/search/query/HTML+entry/type/html", current_path)
       assert_found(:total_count => 1,
                    :entries_count => 1,
                    :topic_path => [["query", "HTML"],
-                                   ["type", "html"],
-                                   ["category", "test"]],
+                                   ["query", "entry"],
+                                   ["type", "html"]],
+                   :drilldown => {:category => ["test"]},
                    :pagination => "1/1")
 
-      find(:xpath, "/descendant::li[@class='topic_path_item']"+
-                                  "[@data-key='type']"+
-                                  "[@data-value='html']"+
-                   "/child::a[@class='topic_path_reduce_link']").click
-      assert_equal("/search/query/HTML/category/test", current_path)
+      within(".topic_path") do
+        assert_all(".topic_path_reduce_link").last.click
+      end
+      assert_equal("/search/query/HTML+entry", current_path)
       assert_found(:total_count => 1,
                    :entries_count => 1,
                    :topic_path => [["query", "HTML"],
-                                   ["category", "test"]],
-                   :drilldown => {:type => ["html"]},
+                                   ["query", "entry"]],
+                   :drilldown => {:type => ["html"],
+                                  :category => ["test"]},
                    :pagination => "1/1")
 
-      find(:xpath, "/descendant::li[@class='topic_path_item']"+
-                                  "[@data-key='category']"+
-                                  "[@data-value='test']"+
-                   "/child::a[@class='topic_path_reduce_link']").click
+      within(".topic_path") do
+        assert_all(".topic_path_reduce_link").last.click
+      end
       assert_equal("/search/query/HTML", current_path)
       assert_found(:total_count => 1,
                    :entries_count => 1,
@@ -184,10 +183,9 @@ class SearchTest < ActionDispatch::IntegrationTest
                                   :category => ["test"]},
                    :pagination => "1/1")
 
-      find(:xpath, "/descendant::li[@class='topic_path_item']"+
-                                  "[@data-key='query']"+
-                                  "[@data-value='HTML']"+
-                   "/child::a[@class='topic_path_reduce_link']").click
+      within(".topic_path") do
+        assert_all(".topic_path_reduce_link").last.click
+      end
       assert_equal("/search", current_path)
       assert_initial_view
     end



More information about the groonga-commit mailing list