{"action":"created","comment":{"url":"https://api.github.com/repos/bm-sms/daimon-news/pulls/comments/70384088","id":70384088,"diff_hunk":"@@ -62,11 +62,47 @@ class SearchTest < ActionDispatch::IntegrationTest\n \n     click_on \"検索\"\n \n+    within('main') do\n+      # NOTE: 記事が公開されてから非公開になった場合、Groongaのデータベースが更新されるまでは件数がずれる。\n+      # ref: https://github.com/bm-sms/daimon-news-multi-tenant/pull/365#issuecomment-200634038\n+\n+      within('ul.search-result-list') do\n+        assert has_content?('post1 is published')\n+        assert has_no_content?('post2 is not published')\n+        assert has_content?('post3 is published')\n+      end\n+    end\n+  end\n+\n+  test 'the highest score post should appear in the top' do\n+    create_post(site: @current_site,\n+                title: 'post1 BBB',\n+                body: 'AAA...',\n+                published_at: 1.hour.ago)\n+    create_post(site: @current_site,\n+                title: 'post2 AAA',\n+                body: 'AAA...',\n+                published_at: 2.hour.ago)\n+    create_post(site: @current_site,\n+                title: 'post3 AAA',\n+                body: 'BBB...',\n+                published_at: 3.hour.ago)\n+\n+    visit '/'\n+\n+    fill_in 'query[keywords]', with: 'AAA'\n+\n+    click_on '検索'\n+\n     within(\"main\") do\n-      assert_equal \"「body」を含む記事は2件見つかりました。\", find(\".message\").text\n-      within(\"ul\") do\n-        assert find_link(\"post1 is published\")\n-        assert find_link(\"post3 is published\")\n+      assert_equal '「AAA」を含む記事が3件見つかりました。', find('.message').text","path":"test/integration/search_test.rb","position":50,"original_position":50,"commit_id":"1f88b6d79fa02d8d3c9229a29881a8b4917fb7a3","original_commit_id":"1f88b6d79fa02d8d3c9229a29881a8b4917fb7a3","user":{"login":"okkez-bot","id":18323547,"avatar_url":"https://avatars.githubusercontent.com/u/18323547?v=3","gravatar_id":"","url":"https://api.github.com/users/okkez-bot","html_url":"https://github.com/okkez-bot","followers_url":"https://api.github.com/users/okkez-bot/followers","following_url":"https://api.github.com/users/okkez-bot/following{/other_user}","gists_url":"https://api.github.com/users/okkez-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/okkez-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okkez-bot/subscriptions","organizations_url":"https://api.github.com/users/okkez-bot/orgs","repos_url":"https://api.github.com/users/okkez-bot/repos","events_url":"https://api.github.com/users/okkez-bot/events{/privacy}","received_events_url":"https://api.github.com/users/okkez-bot/received_events","type":"User","site_admin":false},"body":"__[rubocop]__\n* Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. [:ref](https://github.com/bbatsov/ruby-style-guide#consistent-string-literals)","created_at":"2016-07-12T06:37:51Z","updated_at":"2016-07-12T06:37:51Z","html_url":"https://github.com/bm-sms/daimon-news/pull/561#discussion_r70384088","pull_request_url":"https://api.github.com/repos/bm-sms/daimon-news/pulls/561","_links":{"self":{"href":"https://api.github.com/repos/bm-sms/daimon-news/pulls/comments/70384088"},"html":{"href":"https://github.com/bm-sms/daimon-news/pull/561#discussion_r70384088"},"pull_request":{"href":"https://api.github.com/repos/bm-sms/daimon-news/pulls/561"}}},"pull_request":{"url":"https://api.github.com/repos/bm-sms/daimon-news/pulls/561","id":77068243,"html_url":"https://github.com/bm-sms/daimon-news/pull/561","diff_url":"https://github.com/bm-sms/daimon-news/pull/561.diff","patch_url":"https://github.com/bm-sms/daimon-news/pull/561.patch","issue_url":"https://api.github.com/repos/bm-sms/daimon-news/issues/561","number":561,"state":"open","locked":false,"title":"Order searched posts by score","user":{"login":"tricknotes","id":290782,"avatar_url":"https://avatars.githubusercontent.com/u/290782?v=3","gravatar_id":"","url":"https://api.github.com/users/tricknotes","html_url":"https://github.com/tricknotes","followers_url":"https://api.github.com/users/tricknotes/followers","following_url":"https://api.github.com/users/tricknotes/following{/other_user}","gists_url":"https://api.github.com/users/tricknotes/gists{/gist_id}","starred_url":"https://api.github.com/users/tricknotes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tricknotes/subscriptions","organizations_url":"https://api.github.com/users/tricknotes/orgs","repos_url":"https://api.github.com/users/tricknotes/repos","events_url":"https://api.github.com/users/tricknotes/events{/privacy}","received_events_url":"https://api.github.com/users/tricknotes/received_events","type":"User","site_admin":false},"body":"Instead of: https://github.com/bm-sms/daimon-news/pull/407","created_at":"2016-07-12T06:37:39Z","updated_at":"2016-07-12T06:37:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"548bfce5ad8d84f7542c4df824444498ede78048","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/bm-sms/daimon-news/pulls/561/commits","review_comments_url":"https://api.github.com/repos/bm-sms/daimon-news/pulls/561/comments","review_comment_url":"https://api.github.com/repos/bm-sms/daimon-news/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bm-sms/daimon-news/issues/561/comments","statuses_url":"https://api.github.com/repos/bm-sms/daimon-news/statuses/1f88b6d79fa02d8d3c9229a29881a8b4917fb7a3","head":{"label":"bm-sms:order-by-score","ref":"order-by-score","sha":"1f88b6d79fa02d8d3c9229a29881a8b4917fb7a3","user":{"login":"bm-sms","id":11305323,"avatar_url":"https://avatars.githubusercontent.com/u/11305323?v=3","gravatar_id":"","url":"https://api.github.com/users/bm-sms","html_url":"https://github.com/bm-sms","followers_url":"https://api.github.com/users/bm-sms/followers","following_url":"https://api.github.com/users/bm-sms/following{/other_user}","gists_url":"https://api.github.com/users/bm-sms/gists{/gist_id}","starred_url":"https://api.github.com/users/bm-sms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bm-sms/subscriptions","organizations_url":"https://api.github.com/users/bm-sms/orgs","repos_url":"https://api.github.com/users/bm-sms/repos","events_url":"https://api.github.com/users/bm-sms/events{/privacy}","received_events_url":"https://api.github.com/users/bm-sms/received_events","type":"Organization","site_admin":false},"repo":{"id":46255953,"name":"daimon-news","full_name":"bm-sms/daimon-news","owner":{"login":"bm-sms","id":11305323,"avatar_url":"https://avatars.githubusercontent.com/u/11305323?v=3","gravatar_id":"","url":"https://api.github.com/users/bm-sms","html_url":"https://github.com/bm-sms","followers_url":"https://api.github.com/users/bm-sms/followers","following_url":"https://api.github.com/users/bm-sms/following{/other_user}","gists_url":"https://api.github.com/users/bm-sms/gists{/gist_id}","starred_url":"https://api.github.com/users/bm-sms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bm-sms/subscriptions","organizations_url":"https://api.github.com/users/bm-sms/orgs","repos_url":"https://api.github.com/users/bm-sms/repos","events_url":"https://api.github.com/users/bm-sms/events{/privacy}","received_events_url":"https://api.github.com/users/bm-sms/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bm-sms/daimon-news","description":"","fork":false,"url":"https://api.github.com/repos/bm-sms/daimon-news","forks_url":"https://api.github.com/repos/bm-sms/daimon-news/forks","keys_url":"https://api.github.com/repos/bm-sms/daimon-news/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bm-sms/daimon-news/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bm-sms/daimon-news/teams","hooks_url":"https://api.github.com/repos/bm-sms/daimon-news/hooks","issue_events_url":"https://api.github.com/repos/bm-sms/daimon-news/issues/events{/number}","events_url":"https://api.github.com/repos/bm-sms/daimon-news/events","assignees_url":"https://api.github.com/repos/bm-sms/daimon-news/assignees{/user}","branches_url":"https://api.github.com/repos/bm-sms/daimon-news/branches{/branch}","tags_url":"https://api.github.com/repos/bm-sms/daimon-news/tags","blobs_url":"https://api.github.com/repos/bm-sms/daimon-news/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bm-sms/daimon-news/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bm-sms/daimon-news/git/refs{/sha}","trees_url":"https://api.github.com/repos/bm-sms/daimon-news/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bm-sms/daimon-news/statuses/{sha}","languages_url":"https://api.github.com/repos/bm-sms/daimon-news/languages","stargazers_url":"https://api.github.com/repos/bm-sms/daimon-news/stargazers","contributors_url":"https://api.github.com/repos/bm-sms/daimon-news/contributors","subscribers_url":"https://api.github.com/repos/bm-sms/daimon-news/subscribers","subscription_url":"https://api.github.com/repos/bm-sms/daimon-news/subscription","commits_url":"https://api.github.com/repos/bm-sms/daimon-news/commits{/sha}","git_commits_url":"https://api.github.com/repos/bm-sms/daimon-news/git/commits{/sha}","comments_url":"https://api.github.com/repos/bm-sms/daimon-news/comments{/number}","issue_comment_url":"https://api.github.com/repos/bm-sms/daimon-news/issues/comments{/number}","contents_url":"https://api.github.com/repos/bm-sms/daimon-news/contents/{+path}","compare_url":"https://api.github.com/repos/bm-sms/daimon-news/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bm-sms/daimon-news/merges","archive_url":"https://api.github.com/repos/bm-sms/daimon-news/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bm-sms/daimon-news/downloads","issues_url":"https://api.github.com/repos/bm-sms/daimon-news/issues{/number}","pulls_url":"https://api.github.com/repos/bm-sms/daimon-news/pulls{/number}","milestones_url":"https://api.github.com/repos/bm-sms/daimon-news/milestones{/number}","notifications_url":"https://api.github.com/repos/bm-sms/daimon-news/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bm-sms/daimon-news/labels{/name}","releases_url":"https://api.github.com/repos/bm-sms/daimon-news/releases{/id}","deployments_url":"https://api.github.com/repos/bm-sms/daimon-news/deployments","created_at":"2015-11-16T06:20:35Z","updated_at":"2016-06-02T22:32:01Z","pushed_at":"2016-07-12T06:37:39Z","git_url":"git://github.com/bm-sms/daimon-news.git","ssh_url":"git@github.com:bm-sms/daimon-news.git","clone_url":"https://github.com/bm-sms/daimon-news.git","svn_url":"https://github.com/bm-sms/daimon-news","homepage":"","size":1354,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":6,"default_branch":"master"}},"base":{"label":"bm-sms:master","ref":"master","sha":"33f606cc22a0cbcfede5e9bf5826d29362b46fe1","user":{"login":"bm-sms","id":11305323,"avatar_url":"https://avatars.githubusercontent.com/u/11305323?v=3","gravatar_id":"","url":"https://api.github.com/users/bm-sms","html_url":"https://github.com/bm-sms","followers_url":"https://api.github.com/users/bm-sms/followers","following_url":"https://api.github.com/users/bm-sms/following{/other_user}","gists_url":"https://api.github.com/users/bm-sms/gists{/gist_id}","starred_url":"https://api.github.com/users/bm-sms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bm-sms/subscriptions","organizations_url":"https://api.github.com/users/bm-sms/orgs","repos_url":"https://api.github.com/users/bm-sms/repos","events_url":"https://api.github.com/users/bm-sms/events{/privacy}","received_events_url":"https://api.github.com/users/bm-sms/received_events","type":"Organization","site_admin":false},"repo":{"id":46255953,"name":"daimon-news","full_name":"bm-sms/daimon-news","owner":{"login":"bm-sms","id":11305323,"avatar_url":"https://avatars.githubusercontent.com/u/11305323?v=3","gravatar_id":"","url":"https://api.github.com/users/bm-sms","html_url":"https://github.com/bm-sms","followers_url":"https://api.github.com/users/bm-sms/followers","following_url":"https://api.github.com/users/bm-sms/following{/other_user}","gists_url":"https://api.github.com/users/bm-sms/gists{/gist_id}","starred_url":"https://api.github.com/users/bm-sms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bm-sms/subscriptions","organizations_url":"https://api.github.com/users/bm-sms/orgs","repos_url":"https://api.github.com/users/bm-sms/repos","events_url":"https://api.github.com/users/bm-sms/events{/privacy}","received_events_url":"https://api.github.com/users/bm-sms/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bm-sms/daimon-news","description":"","fork":false,"url":"https://api.github.com/repos/bm-sms/daimon-news","forks_url":"https://api.github.com/repos/bm-sms/daimon-news/forks","keys_url":"https://api.github.com/repos/bm-sms/daimon-news/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bm-sms/daimon-news/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bm-sms/daimon-news/teams","hooks_url":"https://api.github.com/repos/bm-sms/daimon-news/hooks","issue_events_url":"https://api.github.com/repos/bm-sms/daimon-news/issues/events{/number}","events_url":"https://api.github.com/repos/bm-sms/daimon-news/events","assignees_url":"https://api.github.com/repos/bm-sms/daimon-news/assignees{/user}","branches_url":"https://api.github.com/repos/bm-sms/daimon-news/branches{/branch}","tags_url":"https://api.github.com/repos/bm-sms/daimon-news/tags","blobs_url":"https://api.github.com/repos/bm-sms/daimon-news/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bm-sms/daimon-news/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bm-sms/daimon-news/git/refs{/sha}","trees_url":"https://api.github.com/repos/bm-sms/daimon-news/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bm-sms/daimon-news/statuses/{sha}","languages_url":"https://api.github.com/repos/bm-sms/daimon-news/languages","stargazers_url":"https://api.github.com/repos/bm-sms/daimon-news/stargazers","contributors_url":"https://api.github.com/repos/bm-sms/daimon-news/contributors","subscribers_url":"https://api.github.com/repos/bm-sms/daimon-news/subscribers","subscription_url":"https://api.github.com/repos/bm-sms/daimon-news/subscription","commits_url":"https://api.github.com/repos/bm-sms/daimon-news/commits{/sha}","git_commits_url":"https://api.github.com/repos/bm-sms/daimon-news/git/commits{/sha}","comments_url":"https://api.github.com/repos/bm-sms/daimon-news/comments{/number}","issue_comment_url":"https://api.github.com/repos/bm-sms/daimon-news/issues/comments{/number}","contents_url":"https://api.github.com/repos/bm-sms/daimon-news/contents/{+path}","compare_url":"https://api.github.com/repos/bm-sms/daimon-news/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bm-sms/daimon-news/merges","archive_url":"https://api.github.com/repos/bm-sms/daimon-news/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bm-sms/daimon-news/downloads","issues_url":"https://api.github.com/repos/bm-sms/daimon-news/issues{/number}","pulls_url":"https://api.github.com/repos/bm-sms/daimon-news/pulls{/number}","milestones_url":"https://api.github.com/repos/bm-sms/daimon-news/milestones{/number}","notifications_url":"https://api.github.com/repos/bm-sms/daimon-news/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bm-sms/daimon-news/labels{/name}","releases_url":"https://api.github.com/repos/bm-sms/daimon-news/releases{/id}","deployments_url":"https://api.github.com/repos/bm-sms/daimon-news/deployments","created_at":"2015-11-16T06:20:35Z","updated_at":"2016-06-02T22:32:01Z","pushed_at":"2016-07-12T06:37:39Z","git_url":"git://github.com/bm-sms/daimon-news.git","ssh_url":"git@github.com:bm-sms/daimon-news.git","clone_url":"https://github.com/bm-sms/daimon-news.git","svn_url":"https://github.com/bm-sms/daimon-news","homepage":"","size":1354,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bm-sms/daimon-news/pulls/561"},"html":{"href":"https://github.com/bm-sms/daimon-news/pull/561"},"issue":{"href":"https://api.github.com/repos/bm-sms/daimon-news/issues/561"},"comments":{"href":"https://api.github.com/repos/bm-sms/daimon-news/issues/561/comments"},"review_comments":{"href":"https://api.github.com/repos/bm-sms/daimon-news/pulls/561/comments"},"review_comment":{"href":"https://api.github.com/repos/bm-sms/daimon-news/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bm-sms/daimon-news/pulls/561/commits"},"statuses":{"href":"https://api.github.com/repos/bm-sms/daimon-news/statuses/1f88b6d79fa02d8d3c9229a29881a8b4917fb7a3"}}}}
{"actor":{"display_login":"okkez-bot"}}