{"action":"created","comment":{"url":"https://api.github.com/repos/incazteca/chicago_transit/pulls/comments/24296570","id":24296570,"diff_hunk":"@@ -0,0 +1,61 @@\n+require 'rails_helper'\n+\n+describe KMLManager::KMLDownloader do\n+  let (:cta_rail_kml_url)    { \"https://data.cityofchicago.org/download/m3d6-pubu/application/xml\" }\n+  let (:cta_station_kml_url) { \"https://data.cityofchicago.org/download/bs96-uama/application/xml\" }\n+  let (:missing_url)         { \"https://data.cityofchicago.org/download/bs-uama/application/xml\" }\n+  let (:invalid_url)         { \"ttpS://data.city.of.chicago.org/download/\" }\n+\n+  let (:dummy)              { \"dummy_file_name\" }\n+  let (:cta_rail_file_name) { \"cta_rail_lines\" }\n+  let (:cta_station_file_name) { \"cta_train_stations\" }\n+\n+  it \"Downloads a file for cta rail KML data\", :vcr do\n+    downloaded_file_path = KMLManager::KMLDownloader.\n+      download_KML(cta_rail_kml_url, cta_rail_file_name)\n+\n+    expect(downloaded_file_path.exist?).to be_truthy\n+    expect(downloaded_file_path.file?).to be_truthy\n+  end\n+\n+  it \"Downloads a file for cta station KML data\", :vcr do\n+    downloaded_file_path = KMLManager::KMLDownloader.\n+      download_KML(cta_station_kml_url, cta_station_file_name)\n+\n+    expect(downloaded_file_path.exist?).to be_truthy\n+    expect(downloaded_file_path.file?).to be_truthy\n+  end\n+\n+  it \"Creates a backup of older file if different\", :vcr do\n+    # To simulate a different file we're going to download the rail KML file\n+    # under the station KML file name\n+\n+    backup_file_name= cta_station_file_name + \".bak\"\n+\n+    [cta_station_kml_url, cta_rail_kml_url].each do |url|\n+      KMLManager::KMLDownloader.download_KML(url, cta_station_file_name)\n+    end\n+\n+    expect(backup_file_name.exist?).to be_truthy\n+    expect(backup_file_name.file?).to be_truthy\n+  end\n+\n+  it \"Keeps an older version if file changed\", :vcr do\n+    backup_file_name= cta_station_file_name + \".bak\"","path":"spec/kml_manager/kml_downloader_spec.rb","position":44,"original_position":44,"commit_id":"8c9e6c0f7ff2f609f9982190b590c1cc632786e1","original_commit_id":"8c9e6c0f7ff2f609f9982190b590c1cc632786e1","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":"Surrounding space missing for operator '='.","created_at":"2015-02-08T07:38:10Z","updated_at":"2015-02-08T07:38:10Z","html_url":"https://github.com/incazteca/chicago_transit/pull/5#discussion_r24296570","pull_request_url":"https://api.github.com/repos/incazteca/chicago_transit/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/incazteca/chicago_transit/pulls/comments/24296570"},"html":{"href":"https://github.com/incazteca/chicago_transit/pull/5#discussion_r24296570"},"pull_request":{"href":"https://api.github.com/repos/incazteca/chicago_transit/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/incazteca/chicago_transit/pulls/5","id":28877000,"html_url":"https://github.com/incazteca/chicago_transit/pull/5","diff_url":"https://github.com/incazteca/chicago_transit/pull/5.diff","patch_url":"https://github.com/incazteca/chicago_transit/pull/5.patch","issue_url":"https://api.github.com/repos/incazteca/chicago_transit/issues/5","number":5,"state":"open","locked":false,"title":"Kml download","user":{"login":"incazteca","id":2825820,"avatar_url":"https://avatars.githubusercontent.com/u/2825820?v=3","gravatar_id":"","url":"https://api.github.com/users/incazteca","html_url":"https://github.com/incazteca","followers_url":"https://api.github.com/users/incazteca/followers","following_url":"https://api.github.com/users/incazteca/following{/other_user}","gists_url":"https://api.github.com/users/incazteca/gists{/gist_id}","starred_url":"https://api.github.com/users/incazteca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incazteca/subscriptions","organizations_url":"https://api.github.com/users/incazteca/orgs","repos_url":"https://api.github.com/users/incazteca/repos","events_url":"https://api.github.com/users/incazteca/events{/privacy}","received_events_url":"https://api.github.com/users/incazteca/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-08T07:38:05Z","updated_at":"2015-02-08T07:38:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c6f43d35880f7e9e7b967bfe888fc6edfdd79bd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/incazteca/chicago_transit/pulls/5/commits","review_comments_url":"https://api.github.com/repos/incazteca/chicago_transit/pulls/5/comments","review_comment_url":"https://api.github.com/repos/incazteca/chicago_transit/pulls/comments/{number}","comments_url":"https://api.github.com/repos/incazteca/chicago_transit/issues/5/comments","statuses_url":"https://api.github.com/repos/incazteca/chicago_transit/statuses/8c9e6c0f7ff2f609f9982190b590c1cc632786e1","head":{"label":"incazteca:kml_download","ref":"kml_download","sha":"8c9e6c0f7ff2f609f9982190b590c1cc632786e1","user":{"login":"incazteca","id":2825820,"avatar_url":"https://avatars.githubusercontent.com/u/2825820?v=3","gravatar_id":"","url":"https://api.github.com/users/incazteca","html_url":"https://github.com/incazteca","followers_url":"https://api.github.com/users/incazteca/followers","following_url":"https://api.github.com/users/incazteca/following{/other_user}","gists_url":"https://api.github.com/users/incazteca/gists{/gist_id}","starred_url":"https://api.github.com/users/incazteca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incazteca/subscriptions","organizations_url":"https://api.github.com/users/incazteca/orgs","repos_url":"https://api.github.com/users/incazteca/repos","events_url":"https://api.github.com/users/incazteca/events{/privacy}","received_events_url":"https://api.github.com/users/incazteca/received_events","type":"User","site_admin":false},"repo":{"id":26733254,"name":"chicago_transit","full_name":"incazteca/chicago_transit","owner":{"login":"incazteca","id":2825820,"avatar_url":"https://avatars.githubusercontent.com/u/2825820?v=3","gravatar_id":"","url":"https://api.github.com/users/incazteca","html_url":"https://github.com/incazteca","followers_url":"https://api.github.com/users/incazteca/followers","following_url":"https://api.github.com/users/incazteca/following{/other_user}","gists_url":"https://api.github.com/users/incazteca/gists{/gist_id}","starred_url":"https://api.github.com/users/incazteca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incazteca/subscriptions","organizations_url":"https://api.github.com/users/incazteca/orgs","repos_url":"https://api.github.com/users/incazteca/repos","events_url":"https://api.github.com/users/incazteca/events{/privacy}","received_events_url":"https://api.github.com/users/incazteca/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/incazteca/chicago_transit","description":"An interactive tool to demonstrate the reach of Chicago transit options","fork":false,"url":"https://api.github.com/repos/incazteca/chicago_transit","forks_url":"https://api.github.com/repos/incazteca/chicago_transit/forks","keys_url":"https://api.github.com/repos/incazteca/chicago_transit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/incazteca/chicago_transit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/incazteca/chicago_transit/teams","hooks_url":"https://api.github.com/repos/incazteca/chicago_transit/hooks","issue_events_url":"https://api.github.com/repos/incazteca/chicago_transit/issues/events{/number}","events_url":"https://api.github.com/repos/incazteca/chicago_transit/events","assignees_url":"https://api.github.com/repos/incazteca/chicago_transit/assignees{/user}","branches_url":"https://api.github.com/repos/incazteca/chicago_transit/branches{/branch}","tags_url":"https://api.github.com/repos/incazteca/chicago_transit/tags","blobs_url":"https://api.github.com/repos/incazteca/chicago_transit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/incazteca/chicago_transit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/incazteca/chicago_transit/git/refs{/sha}","trees_url":"https://api.github.com/repos/incazteca/chicago_transit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/incazteca/chicago_transit/statuses/{sha}","languages_url":"https://api.github.com/repos/incazteca/chicago_transit/languages","stargazers_url":"https://api.github.com/repos/incazteca/chicago_transit/stargazers","contributors_url":"https://api.github.com/repos/incazteca/chicago_transit/contributors","subscribers_url":"https://api.github.com/repos/incazteca/chicago_transit/subscribers","subscription_url":"https://api.github.com/repos/incazteca/chicago_transit/subscription","commits_url":"https://api.github.com/repos/incazteca/chicago_transit/commits{/sha}","git_commits_url":"https://api.github.com/repos/incazteca/chicago_transit/git/commits{/sha}","comments_url":"https://api.github.com/repos/incazteca/chicago_transit/comments{/number}","issue_comment_url":"https://api.github.com/repos/incazteca/chicago_transit/issues/comments/{number}","contents_url":"https://api.github.com/repos/incazteca/chicago_transit/contents/{+path}","compare_url":"https://api.github.com/repos/incazteca/chicago_transit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/incazteca/chicago_transit/merges","archive_url":"https://api.github.com/repos/incazteca/chicago_transit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/incazteca/chicago_transit/downloads","issues_url":"https://api.github.com/repos/incazteca/chicago_transit/issues{/number}","pulls_url":"https://api.github.com/repos/incazteca/chicago_transit/pulls{/number}","milestones_url":"https://api.github.com/repos/incazteca/chicago_transit/milestones{/number}","notifications_url":"https://api.github.com/repos/incazteca/chicago_transit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/incazteca/chicago_transit/labels{/name}","releases_url":"https://api.github.com/repos/incazteca/chicago_transit/releases{/id}","created_at":"2014-11-17T00:24:47Z","updated_at":"2015-01-31T07:13:01Z","pushed_at":"2015-02-08T07:33:50Z","git_url":"git://github.com/incazteca/chicago_transit.git","ssh_url":"git@github.com:incazteca/chicago_transit.git","clone_url":"https://github.com/incazteca/chicago_transit.git","svn_url":"https://github.com/incazteca/chicago_transit","homepage":null,"size":480,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"incazteca:master","ref":"master","sha":"af56172a8927955ff0c86b9c37ee92b661a82684","user":{"login":"incazteca","id":2825820,"avatar_url":"https://avatars.githubusercontent.com/u/2825820?v=3","gravatar_id":"","url":"https://api.github.com/users/incazteca","html_url":"https://github.com/incazteca","followers_url":"https://api.github.com/users/incazteca/followers","following_url":"https://api.github.com/users/incazteca/following{/other_user}","gists_url":"https://api.github.com/users/incazteca/gists{/gist_id}","starred_url":"https://api.github.com/users/incazteca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incazteca/subscriptions","organizations_url":"https://api.github.com/users/incazteca/orgs","repos_url":"https://api.github.com/users/incazteca/repos","events_url":"https://api.github.com/users/incazteca/events{/privacy}","received_events_url":"https://api.github.com/users/incazteca/received_events","type":"User","site_admin":false},"repo":{"id":26733254,"name":"chicago_transit","full_name":"incazteca/chicago_transit","owner":{"login":"incazteca","id":2825820,"avatar_url":"https://avatars.githubusercontent.com/u/2825820?v=3","gravatar_id":"","url":"https://api.github.com/users/incazteca","html_url":"https://github.com/incazteca","followers_url":"https://api.github.com/users/incazteca/followers","following_url":"https://api.github.com/users/incazteca/following{/other_user}","gists_url":"https://api.github.com/users/incazteca/gists{/gist_id}","starred_url":"https://api.github.com/users/incazteca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incazteca/subscriptions","organizations_url":"https://api.github.com/users/incazteca/orgs","repos_url":"https://api.github.com/users/incazteca/repos","events_url":"https://api.github.com/users/incazteca/events{/privacy}","received_events_url":"https://api.github.com/users/incazteca/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/incazteca/chicago_transit","description":"An interactive tool to demonstrate the reach of Chicago transit options","fork":false,"url":"https://api.github.com/repos/incazteca/chicago_transit","forks_url":"https://api.github.com/repos/incazteca/chicago_transit/forks","keys_url":"https://api.github.com/repos/incazteca/chicago_transit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/incazteca/chicago_transit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/incazteca/chicago_transit/teams","hooks_url":"https://api.github.com/repos/incazteca/chicago_transit/hooks","issue_events_url":"https://api.github.com/repos/incazteca/chicago_transit/issues/events{/number}","events_url":"https://api.github.com/repos/incazteca/chicago_transit/events","assignees_url":"https://api.github.com/repos/incazteca/chicago_transit/assignees{/user}","branches_url":"https://api.github.com/repos/incazteca/chicago_transit/branches{/branch}","tags_url":"https://api.github.com/repos/incazteca/chicago_transit/tags","blobs_url":"https://api.github.com/repos/incazteca/chicago_transit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/incazteca/chicago_transit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/incazteca/chicago_transit/git/refs{/sha}","trees_url":"https://api.github.com/repos/incazteca/chicago_transit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/incazteca/chicago_transit/statuses/{sha}","languages_url":"https://api.github.com/repos/incazteca/chicago_transit/languages","stargazers_url":"https://api.github.com/repos/incazteca/chicago_transit/stargazers","contributors_url":"https://api.github.com/repos/incazteca/chicago_transit/contributors","subscribers_url":"https://api.github.com/repos/incazteca/chicago_transit/subscribers","subscription_url":"https://api.github.com/repos/incazteca/chicago_transit/subscription","commits_url":"https://api.github.com/repos/incazteca/chicago_transit/commits{/sha}","git_commits_url":"https://api.github.com/repos/incazteca/chicago_transit/git/commits{/sha}","comments_url":"https://api.github.com/repos/incazteca/chicago_transit/comments{/number}","issue_comment_url":"https://api.github.com/repos/incazteca/chicago_transit/issues/comments/{number}","contents_url":"https://api.github.com/repos/incazteca/chicago_transit/contents/{+path}","compare_url":"https://api.github.com/repos/incazteca/chicago_transit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/incazteca/chicago_transit/merges","archive_url":"https://api.github.com/repos/incazteca/chicago_transit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/incazteca/chicago_transit/downloads","issues_url":"https://api.github.com/repos/incazteca/chicago_transit/issues{/number}","pulls_url":"https://api.github.com/repos/incazteca/chicago_transit/pulls{/number}","milestones_url":"https://api.github.com/repos/incazteca/chicago_transit/milestones{/number}","notifications_url":"https://api.github.com/repos/incazteca/chicago_transit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/incazteca/chicago_transit/labels{/name}","releases_url":"https://api.github.com/repos/incazteca/chicago_transit/releases{/id}","created_at":"2014-11-17T00:24:47Z","updated_at":"2015-01-31T07:13:01Z","pushed_at":"2015-02-08T07:33:50Z","git_url":"git://github.com/incazteca/chicago_transit.git","ssh_url":"git@github.com:incazteca/chicago_transit.git","clone_url":"https://github.com/incazteca/chicago_transit.git","svn_url":"https://github.com/incazteca/chicago_transit","homepage":null,"size":480,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/incazteca/chicago_transit/pulls/5"},"html":{"href":"https://github.com/incazteca/chicago_transit/pull/5"},"issue":{"href":"https://api.github.com/repos/incazteca/chicago_transit/issues/5"},"comments":{"href":"https://api.github.com/repos/incazteca/chicago_transit/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/incazteca/chicago_transit/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/incazteca/chicago_transit/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/incazteca/chicago_transit/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/incazteca/chicago_transit/statuses/8c9e6c0f7ff2f609f9982190b590c1cc632786e1"}}}}