{"action":"created","comment":{"url":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/comments/29235487","id":29235487,"diff_hunk":"@@ -0,0 +1,72 @@\n+require 'test_helper'\n+\n+class SchleswigholsteinLandtagScraperOverviewTest < ActiveSupport::TestCase\n+  def setup\n+    @scraper = SchleswigHolsteinLandtagScraper\n+    @baseurl = \"http://lissh.lvn.parlanet.de/cgi-bin/starfinder/0?path=lisshfl.txt&id=fastlink&pass=&search=((dtyp%3dkleine+and+WP%3d18))\"\n+    @html = Nokogiri::HTML(File.read(Rails.root.join('test/fixtures/schleswigholstein_landtag_scraper_overview.html')\n+                           ).force_encoding(\"WINDOWS-1252\"))\n+    @table = @scraper.extract_table @html\n+    @blocks = @scraper.extract_blocks @table\n+  end\n+\n+  test 'extract table from resultpage' do\n+    assert_equal 2679, @table.children.length\n+  end\n+\n+  test 'get blocks from table' do\n+    @table = @scraper.extract_table @html\n+    assert_equal 1338, @blocks.length\n+  end\n+\n+  test 'get title from block' do\n+    assert_equal \"Kinderschutz durch Therapie pädophil veranlagter Menschen\", @scraper.extract_title(@blocks[0])\n+  end\n+\n+  test 'is answered' do\n+    assert_equal true, @scraper.is_answer(@blocks[0])\n+    assert_equal false, @scraper.is_answer(@blocks[1])\n+  end\n+\n+  test 'get ministries' do\n+    meta = @scraper.extract_meta(@blocks[0])\n+    assert_equal [\"Minister/in für Soziales, Gesundheit, Wissenschaft und Gleichstellung\"], meta[:ministries]\n+    meta = @scraper.extract_meta(@blocks[1])\n+    assert_equal [], meta[:ministries]\n+  end\n+\n+  test 'get originators' do\n+    meta = @scraper.extract_meta(@blocks[0])\n+    assert_equal [\"Dr. Patrick Breyer\", \"Wolfgang Dudda\"], meta[:originators][:people]\n+    meta = @scraper.extract_meta(@blocks[1])\n+    assert_equal [\"Dr. Patrick Breyer\"], meta[:originators][:people]\n+  end\n+\n+  test 'get parties' do\n+    meta = @scraper.extract_meta(@blocks[0])\n+    assert_equal [\"PIRATEN\"], meta[:originators][:parties]\n+\n+    meta = @scraper.extract_meta(@blocks[1])\n+    assert_equal [\"PIRATEN\"], meta[:originators][:parties]\n+  end\n+\n+  test 'get date' do\n+    meta = @scraper.extract_meta(@blocks[8])\n+    assert_equal Date.parse('2015-12-14'), meta[:published_date]\n+\n+    meta = @scraper.extract_meta(@blocks[7])\n+    puts @blocks[7].inspect\n+    assert_equal nil, meta[:published_date]\n+  end\n+\n+  test 'get full reference' do\n+    assert_equal '18/2540', @scraper.extract_full_reference(@blocks[0])\n+    assert_equal '18/2915', @scraper.extract_full_reference(@blocks[1])\n+  end\n+\n+  test 'get pdf url' do\n+    assert_equal 'http://www.landtag.ltsh.de/infothek/wahl18/drucks/2500/drucksache-18-2540.pdf', @scraper.extract_url(@blocks[0])\n+    assert_equal 'http://www.landtag.ltsh.de/infothek/wahl18/drucks/2900/drucksache-18-2915.pdf', @scraper.extract_url(@blocks[1])\n+  end\n+","path":"test/scraper/schleswigholstein_landtag_scraper_overview_test.rb","position":71,"original_position":71,"commit_id":"5113ac69e9c568e8aa94f729c0395e7fe22423b5","original_commit_id":"5113ac69e9c568e8aa94f729c0395e7fe22423b5","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Extra empty line detected at class body end.","created_at":"2015-04-28T12:02:59Z","updated_at":"2015-04-28T12:02:59Z","html_url":"https://github.com/robbi5/kleineanfragen/pull/17#discussion_r29235487","pull_request_url":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/comments/29235487"},"html":{"href":"https://github.com/robbi5/kleineanfragen/pull/17#discussion_r29235487"},"pull_request":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/17","id":34259418,"html_url":"https://github.com/robbi5/kleineanfragen/pull/17","diff_url":"https://github.com/robbi5/kleineanfragen/pull/17.diff","patch_url":"https://github.com/robbi5/kleineanfragen/pull/17.patch","issue_url":"https://api.github.com/repos/robbi5/kleineanfragen/issues/17","number":17,"state":"open","locked":false,"title":"Schleswig Holstein Scraper","user":{"login":"globalworming","id":2108984,"avatar_url":"https://avatars.githubusercontent.com/u/2108984?v=3","gravatar_id":"","url":"https://api.github.com/users/globalworming","html_url":"https://github.com/globalworming","followers_url":"https://api.github.com/users/globalworming/followers","following_url":"https://api.github.com/users/globalworming/following{/other_user}","gists_url":"https://api.github.com/users/globalworming/gists{/gist_id}","starred_url":"https://api.github.com/users/globalworming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globalworming/subscriptions","organizations_url":"https://api.github.com/users/globalworming/orgs","repos_url":"https://api.github.com/users/globalworming/repos","events_url":"https://api.github.com/users/globalworming/events{/privacy}","received_events_url":"https://api.github.com/users/globalworming/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-28T12:02:54Z","updated_at":"2015-04-28T12:02:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c62847dc4d7b8772e2169a2d992ee4081c9ecd0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/17/commits","review_comments_url":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/17/comments","review_comment_url":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/robbi5/kleineanfragen/issues/17/comments","statuses_url":"https://api.github.com/repos/robbi5/kleineanfragen/statuses/5113ac69e9c568e8aa94f729c0395e7fe22423b5","head":{"label":"globalworming:scraper-sh-2","ref":"scraper-sh-2","sha":"5113ac69e9c568e8aa94f729c0395e7fe22423b5","user":{"login":"globalworming","id":2108984,"avatar_url":"https://avatars.githubusercontent.com/u/2108984?v=3","gravatar_id":"","url":"https://api.github.com/users/globalworming","html_url":"https://github.com/globalworming","followers_url":"https://api.github.com/users/globalworming/followers","following_url":"https://api.github.com/users/globalworming/following{/other_user}","gists_url":"https://api.github.com/users/globalworming/gists{/gist_id}","starred_url":"https://api.github.com/users/globalworming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globalworming/subscriptions","organizations_url":"https://api.github.com/users/globalworming/orgs","repos_url":"https://api.github.com/users/globalworming/repos","events_url":"https://api.github.com/users/globalworming/events{/privacy}","received_events_url":"https://api.github.com/users/globalworming/received_events","type":"User","site_admin":false},"repo":{"id":30397914,"name":"kleineanfragen","full_name":"globalworming/kleineanfragen","owner":{"login":"globalworming","id":2108984,"avatar_url":"https://avatars.githubusercontent.com/u/2108984?v=3","gravatar_id":"","url":"https://api.github.com/users/globalworming","html_url":"https://github.com/globalworming","followers_url":"https://api.github.com/users/globalworming/followers","following_url":"https://api.github.com/users/globalworming/following{/other_user}","gists_url":"https://api.github.com/users/globalworming/gists{/gist_id}","starred_url":"https://api.github.com/users/globalworming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globalworming/subscriptions","organizations_url":"https://api.github.com/users/globalworming/orgs","repos_url":"https://api.github.com/users/globalworming/repos","events_url":"https://api.github.com/users/globalworming/events{/privacy}","received_events_url":"https://api.github.com/users/globalworming/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/globalworming/kleineanfragen","description":"","fork":true,"url":"https://api.github.com/repos/globalworming/kleineanfragen","forks_url":"https://api.github.com/repos/globalworming/kleineanfragen/forks","keys_url":"https://api.github.com/repos/globalworming/kleineanfragen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/globalworming/kleineanfragen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/globalworming/kleineanfragen/teams","hooks_url":"https://api.github.com/repos/globalworming/kleineanfragen/hooks","issue_events_url":"https://api.github.com/repos/globalworming/kleineanfragen/issues/events{/number}","events_url":"https://api.github.com/repos/globalworming/kleineanfragen/events","assignees_url":"https://api.github.com/repos/globalworming/kleineanfragen/assignees{/user}","branches_url":"https://api.github.com/repos/globalworming/kleineanfragen/branches{/branch}","tags_url":"https://api.github.com/repos/globalworming/kleineanfragen/tags","blobs_url":"https://api.github.com/repos/globalworming/kleineanfragen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/globalworming/kleineanfragen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/globalworming/kleineanfragen/git/refs{/sha}","trees_url":"https://api.github.com/repos/globalworming/kleineanfragen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/globalworming/kleineanfragen/statuses/{sha}","languages_url":"https://api.github.com/repos/globalworming/kleineanfragen/languages","stargazers_url":"https://api.github.com/repos/globalworming/kleineanfragen/stargazers","contributors_url":"https://api.github.com/repos/globalworming/kleineanfragen/contributors","subscribers_url":"https://api.github.com/repos/globalworming/kleineanfragen/subscribers","subscription_url":"https://api.github.com/repos/globalworming/kleineanfragen/subscription","commits_url":"https://api.github.com/repos/globalworming/kleineanfragen/commits{/sha}","git_commits_url":"https://api.github.com/repos/globalworming/kleineanfragen/git/commits{/sha}","comments_url":"https://api.github.com/repos/globalworming/kleineanfragen/comments{/number}","issue_comment_url":"https://api.github.com/repos/globalworming/kleineanfragen/issues/comments{/number}","contents_url":"https://api.github.com/repos/globalworming/kleineanfragen/contents/{+path}","compare_url":"https://api.github.com/repos/globalworming/kleineanfragen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/globalworming/kleineanfragen/merges","archive_url":"https://api.github.com/repos/globalworming/kleineanfragen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/globalworming/kleineanfragen/downloads","issues_url":"https://api.github.com/repos/globalworming/kleineanfragen/issues{/number}","pulls_url":"https://api.github.com/repos/globalworming/kleineanfragen/pulls{/number}","milestones_url":"https://api.github.com/repos/globalworming/kleineanfragen/milestones{/number}","notifications_url":"https://api.github.com/repos/globalworming/kleineanfragen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/globalworming/kleineanfragen/labels{/name}","releases_url":"https://api.github.com/repos/globalworming/kleineanfragen/releases{/id}","created_at":"2015-02-06T06:06:10Z","updated_at":"2015-03-12T12:21:48Z","pushed_at":"2015-04-28T12:02:30Z","git_url":"git://github.com/globalworming/kleineanfragen.git","ssh_url":"git@github.com:globalworming/kleineanfragen.git","clone_url":"https://github.com/globalworming/kleineanfragen.git","svn_url":"https://github.com/globalworming/kleineanfragen","homepage":"https://kleineanfragen.de","size":4529,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"robbi5:master","ref":"master","sha":"3bd2cdc283b4ae67cbd5b5a5f04e7ac323a49d9c","user":{"login":"robbi5","id":172415,"avatar_url":"https://avatars.githubusercontent.com/u/172415?v=3","gravatar_id":"","url":"https://api.github.com/users/robbi5","html_url":"https://github.com/robbi5","followers_url":"https://api.github.com/users/robbi5/followers","following_url":"https://api.github.com/users/robbi5/following{/other_user}","gists_url":"https://api.github.com/users/robbi5/gists{/gist_id}","starred_url":"https://api.github.com/users/robbi5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbi5/subscriptions","organizations_url":"https://api.github.com/users/robbi5/orgs","repos_url":"https://api.github.com/users/robbi5/repos","events_url":"https://api.github.com/users/robbi5/events{/privacy}","received_events_url":"https://api.github.com/users/robbi5/received_events","type":"User","site_admin":false},"repo":{"id":23664133,"name":"kleineanfragen","full_name":"robbi5/kleineanfragen","owner":{"login":"robbi5","id":172415,"avatar_url":"https://avatars.githubusercontent.com/u/172415?v=3","gravatar_id":"","url":"https://api.github.com/users/robbi5","html_url":"https://github.com/robbi5","followers_url":"https://api.github.com/users/robbi5/followers","following_url":"https://api.github.com/users/robbi5/following{/other_user}","gists_url":"https://api.github.com/users/robbi5/gists{/gist_id}","starred_url":"https://api.github.com/users/robbi5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbi5/subscriptions","organizations_url":"https://api.github.com/users/robbi5/orgs","repos_url":"https://api.github.com/users/robbi5/repos","events_url":"https://api.github.com/users/robbi5/events{/privacy}","received_events_url":"https://api.github.com/users/robbi5/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/robbi5/kleineanfragen","description":"Collecting kleine Anfragen from Parlamentsdokumentationssystemen for easy search- and linkability","fork":false,"url":"https://api.github.com/repos/robbi5/kleineanfragen","forks_url":"https://api.github.com/repos/robbi5/kleineanfragen/forks","keys_url":"https://api.github.com/repos/robbi5/kleineanfragen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robbi5/kleineanfragen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robbi5/kleineanfragen/teams","hooks_url":"https://api.github.com/repos/robbi5/kleineanfragen/hooks","issue_events_url":"https://api.github.com/repos/robbi5/kleineanfragen/issues/events{/number}","events_url":"https://api.github.com/repos/robbi5/kleineanfragen/events","assignees_url":"https://api.github.com/repos/robbi5/kleineanfragen/assignees{/user}","branches_url":"https://api.github.com/repos/robbi5/kleineanfragen/branches{/branch}","tags_url":"https://api.github.com/repos/robbi5/kleineanfragen/tags","blobs_url":"https://api.github.com/repos/robbi5/kleineanfragen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robbi5/kleineanfragen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robbi5/kleineanfragen/git/refs{/sha}","trees_url":"https://api.github.com/repos/robbi5/kleineanfragen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robbi5/kleineanfragen/statuses/{sha}","languages_url":"https://api.github.com/repos/robbi5/kleineanfragen/languages","stargazers_url":"https://api.github.com/repos/robbi5/kleineanfragen/stargazers","contributors_url":"https://api.github.com/repos/robbi5/kleineanfragen/contributors","subscribers_url":"https://api.github.com/repos/robbi5/kleineanfragen/subscribers","subscription_url":"https://api.github.com/repos/robbi5/kleineanfragen/subscription","commits_url":"https://api.github.com/repos/robbi5/kleineanfragen/commits{/sha}","git_commits_url":"https://api.github.com/repos/robbi5/kleineanfragen/git/commits{/sha}","comments_url":"https://api.github.com/repos/robbi5/kleineanfragen/comments{/number}","issue_comment_url":"https://api.github.com/repos/robbi5/kleineanfragen/issues/comments{/number}","contents_url":"https://api.github.com/repos/robbi5/kleineanfragen/contents/{+path}","compare_url":"https://api.github.com/repos/robbi5/kleineanfragen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robbi5/kleineanfragen/merges","archive_url":"https://api.github.com/repos/robbi5/kleineanfragen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robbi5/kleineanfragen/downloads","issues_url":"https://api.github.com/repos/robbi5/kleineanfragen/issues{/number}","pulls_url":"https://api.github.com/repos/robbi5/kleineanfragen/pulls{/number}","milestones_url":"https://api.github.com/repos/robbi5/kleineanfragen/milestones{/number}","notifications_url":"https://api.github.com/repos/robbi5/kleineanfragen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robbi5/kleineanfragen/labels{/name}","releases_url":"https://api.github.com/repos/robbi5/kleineanfragen/releases{/id}","created_at":"2014-09-04T13:47:44Z","updated_at":"2015-04-27T09:24:22Z","pushed_at":"2015-04-28T12:02:54Z","git_url":"git://github.com/robbi5/kleineanfragen.git","ssh_url":"git@github.com:robbi5/kleineanfragen.git","clone_url":"https://github.com/robbi5/kleineanfragen.git","svn_url":"https://github.com/robbi5/kleineanfragen","homepage":"https://kleineanfragen.de","size":5349,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/17"},"html":{"href":"https://github.com/robbi5/kleineanfragen/pull/17"},"issue":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/issues/17"},"comments":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/robbi5/kleineanfragen/statuses/5113ac69e9c568e8aa94f729c0395e7fe22423b5"}}}}