{"action":"created","comment":{"url":"https://api.github.com/repos/hackclub/lecture-hall/pulls/comments/75022018","id":75022018,"diff_hunk":"@@ -0,0 +1,82 @@\n+require 'test_helper'\n+\n+class ProjectsControllerTest < ActionDispatch::IntegrationTest\n+  class CreateTest < ProjectsControllerTest\n+    test 'with valid info' do\n+      get '/auth/github/callback'\n+\n+      assert_difference('Project.count') do\n+        post '/projects', params: {\n+               name: 'Personal Website',\n+               live_url: 'https://prophetorpheus.github.io'\n+             },\n+             xhr: true,\n+             as: :json\n+      end\n+\n+      assert_equal 'application/json', @response.content_type\n+      assert_response 200, @response.status\n+\n+      parsed_response = JSON.parse(@response.body)\n+\n+      assert parsed_response['id']\n+      assert_equal parsed_response['name'], 'Personal Website'\n+      assert_equal parsed_response['live_url'], 'https://prophetorpheus.github.io'\n+    end\n+\n+    test 'with invalid info' do\n+      get '/auth/github/callback'\n+\n+      post '/projects', params: {}, xhr: true, as: :json\n+\n+      assert_equal 'application/json', @response.content_type\n+      assert_response 422\n+\n+      assert_equal \"Name can't be blank\", JSON.parse(@response.body)['errors'].first\n+    end\n+  end\n+\n+  class ValidateGithubUrlTest < ProjectsControllerTest\n+    def setup\n+      super\n+\n+      get '/auth/github/callback'\n+    end\n+\n+    test 'with valid url repo' do\n+      VCR.use_cassette 'validate_github_url/valid_repo', match_requests_on: [ :method, :uri ] do\n+        get '/projects/validate_github_url',\n+            params: {\n+              url: 'https://github.com/hackclub/hackclub'\n+            },\n+            xhr: true\n+\n+        assert_equal 'application/json', @response.content_type\n+        assert_response 200\n+      end\n+    end\n+\n+    test \"with invalid url\" do\n+      get \"/projects/validate_github_url\",\n+          params: {},\n+          xhr: true\n+\n+      assert_equal 'application/json', @response.content_type\n+      assert_response 422\n+    end\n+\n+    test \"with repo that doesn't exist\" do\n+      VCR.use_cassette 'validate_github_url/nonexistant_repo',\n+                       match_requests_on: [ :method, :uri ] do\n+        get '/projects/validate_github_url',\n+            params: {\n+              url: \"https://github.com/this_repository/does_not_exist\"\n+            },\n+            xhr: true\n+\n+        assert_equal 'application/json', @response.content_type","path":"test/controllers/projects_controller_test.rb","position":77,"original_position":77,"commit_id":"6b57ec4ce0051cc5adfba5568fcff8eee1b19ee1","original_commit_id":"6b57ec4ce0051cc5adfba5568fcff8eee1b19ee1","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2016-08-16T21:17:19Z","updated_at":"2016-08-16T21:17:19Z","html_url":"https://github.com/hackclub/lecture-hall/pull/37#discussion_r75022018","pull_request_url":"https://api.github.com/repos/hackclub/lecture-hall/pulls/37","_links":{"self":{"href":"https://api.github.com/repos/hackclub/lecture-hall/pulls/comments/75022018"},"html":{"href":"https://github.com/hackclub/lecture-hall/pull/37#discussion_r75022018"},"pull_request":{"href":"https://api.github.com/repos/hackclub/lecture-hall/pulls/37"}}},"pull_request":{"url":"https://api.github.com/repos/hackclub/lecture-hall/pulls/37","id":81545759,"html_url":"https://github.com/hackclub/lecture-hall/pull/37","diff_url":"https://github.com/hackclub/lecture-hall/pull/37.diff","patch_url":"https://github.com/hackclub/lecture-hall/pull/37.patch","issue_url":"https://api.github.com/repos/hackclub/lecture-hall/issues/37","number":37,"state":"open","locked":false,"title":"Add support for project collection","user":{"login":"zachlatta","id":992248,"avatar_url":"https://avatars.githubusercontent.com/u/992248?v=3","gravatar_id":"","url":"https://api.github.com/users/zachlatta","html_url":"https://github.com/zachlatta","followers_url":"https://api.github.com/users/zachlatta/followers","following_url":"https://api.github.com/users/zachlatta/following{/other_user}","gists_url":"https://api.github.com/users/zachlatta/gists{/gist_id}","starred_url":"https://api.github.com/users/zachlatta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zachlatta/subscriptions","organizations_url":"https://api.github.com/users/zachlatta/orgs","repos_url":"https://api.github.com/users/zachlatta/repos","events_url":"https://api.github.com/users/zachlatta/events{/privacy}","received_events_url":"https://api.github.com/users/zachlatta/received_events","type":"User","site_admin":false},"body":"This pull request tracks additions to add support for project collection. Right now only the backend is implemented, @MaxWofford needs to push the frontend implementation to this branch.\r\n\r\nQuick notes about this:\r\n\r\n- This PR adds a required `access_token` field to users. When being deployed to production, all sessions will need to be invalidated so this is recorded when users re-login.","created_at":"2016-08-16T21:12:50Z","updated_at":"2016-08-16T21:17:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3aa2c640230ca1c9f55afb8577dd91928d5ec2b4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hackclub/lecture-hall/pulls/37/commits","review_comments_url":"https://api.github.com/repos/hackclub/lecture-hall/pulls/37/comments","review_comment_url":"https://api.github.com/repos/hackclub/lecture-hall/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hackclub/lecture-hall/issues/37/comments","statuses_url":"https://api.github.com/repos/hackclub/lecture-hall/statuses/6b57ec4ce0051cc5adfba5568fcff8eee1b19ee1","head":{"label":"hackclub:projects","ref":"projects","sha":"6b57ec4ce0051cc5adfba5568fcff8eee1b19ee1","user":{"login":"hackclub","id":5633654,"avatar_url":"https://avatars.githubusercontent.com/u/5633654?v=3","gravatar_id":"","url":"https://api.github.com/users/hackclub","html_url":"https://github.com/hackclub","followers_url":"https://api.github.com/users/hackclub/followers","following_url":"https://api.github.com/users/hackclub/following{/other_user}","gists_url":"https://api.github.com/users/hackclub/gists{/gist_id}","starred_url":"https://api.github.com/users/hackclub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackclub/subscriptions","organizations_url":"https://api.github.com/users/hackclub/orgs","repos_url":"https://api.github.com/users/hackclub/repos","events_url":"https://api.github.com/users/hackclub/events{/privacy}","received_events_url":"https://api.github.com/users/hackclub/received_events","type":"Organization","site_admin":false},"repo":{"id":63267923,"name":"lecture-hall","full_name":"hackclub/lecture-hall","owner":{"login":"hackclub","id":5633654,"avatar_url":"https://avatars.githubusercontent.com/u/5633654?v=3","gravatar_id":"","url":"https://api.github.com/users/hackclub","html_url":"https://github.com/hackclub","followers_url":"https://api.github.com/users/hackclub/followers","following_url":"https://api.github.com/users/hackclub/following{/other_user}","gists_url":"https://api.github.com/users/hackclub/gists{/gist_id}","starred_url":"https://api.github.com/users/hackclub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackclub/subscriptions","organizations_url":"https://api.github.com/users/hackclub/orgs","repos_url":"https://api.github.com/users/hackclub/repos","events_url":"https://api.github.com/users/hackclub/events{/privacy}","received_events_url":"https://api.github.com/users/hackclub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hackclub/lecture-hall","description":"Renderer of Hack Club's workshops. See it live at https://workshops.hackclub.com","fork":false,"url":"https://api.github.com/repos/hackclub/lecture-hall","forks_url":"https://api.github.com/repos/hackclub/lecture-hall/forks","keys_url":"https://api.github.com/repos/hackclub/lecture-hall/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hackclub/lecture-hall/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hackclub/lecture-hall/teams","hooks_url":"https://api.github.com/repos/hackclub/lecture-hall/hooks","issue_events_url":"https://api.github.com/repos/hackclub/lecture-hall/issues/events{/number}","events_url":"https://api.github.com/repos/hackclub/lecture-hall/events","assignees_url":"https://api.github.com/repos/hackclub/lecture-hall/assignees{/user}","branches_url":"https://api.github.com/repos/hackclub/lecture-hall/branches{/branch}","tags_url":"https://api.github.com/repos/hackclub/lecture-hall/tags","blobs_url":"https://api.github.com/repos/hackclub/lecture-hall/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hackclub/lecture-hall/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hackclub/lecture-hall/git/refs{/sha}","trees_url":"https://api.github.com/repos/hackclub/lecture-hall/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hackclub/lecture-hall/statuses/{sha}","languages_url":"https://api.github.com/repos/hackclub/lecture-hall/languages","stargazers_url":"https://api.github.com/repos/hackclub/lecture-hall/stargazers","contributors_url":"https://api.github.com/repos/hackclub/lecture-hall/contributors","subscribers_url":"https://api.github.com/repos/hackclub/lecture-hall/subscribers","subscription_url":"https://api.github.com/repos/hackclub/lecture-hall/subscription","commits_url":"https://api.github.com/repos/hackclub/lecture-hall/commits{/sha}","git_commits_url":"https://api.github.com/repos/hackclub/lecture-hall/git/commits{/sha}","comments_url":"https://api.github.com/repos/hackclub/lecture-hall/comments{/number}","issue_comment_url":"https://api.github.com/repos/hackclub/lecture-hall/issues/comments{/number}","contents_url":"https://api.github.com/repos/hackclub/lecture-hall/contents/{+path}","compare_url":"https://api.github.com/repos/hackclub/lecture-hall/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hackclub/lecture-hall/merges","archive_url":"https://api.github.com/repos/hackclub/lecture-hall/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hackclub/lecture-hall/downloads","issues_url":"https://api.github.com/repos/hackclub/lecture-hall/issues{/number}","pulls_url":"https://api.github.com/repos/hackclub/lecture-hall/pulls{/number}","milestones_url":"https://api.github.com/repos/hackclub/lecture-hall/milestones{/number}","notifications_url":"https://api.github.com/repos/hackclub/lecture-hall/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hackclub/lecture-hall/labels{/name}","releases_url":"https://api.github.com/repos/hackclub/lecture-hall/releases{/id}","deployments_url":"https://api.github.com/repos/hackclub/lecture-hall/deployments","created_at":"2016-07-13T17:56:18Z","updated_at":"2016-08-07T01:16:31Z","pushed_at":"2016-08-16T21:17:09Z","git_url":"git://github.com/hackclub/lecture-hall.git","ssh_url":"git@github.com:hackclub/lecture-hall.git","clone_url":"https://github.com/hackclub/lecture-hall.git","svn_url":"https://github.com/hackclub/lecture-hall","homepage":"","size":118,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":16,"forks":2,"open_issues":16,"watchers":0,"default_branch":"master"}},"base":{"label":"hackclub:master","ref":"master","sha":"1fcb2b9b06115d24c857be65a49c1f055e62784a","user":{"login":"hackclub","id":5633654,"avatar_url":"https://avatars.githubusercontent.com/u/5633654?v=3","gravatar_id":"","url":"https://api.github.com/users/hackclub","html_url":"https://github.com/hackclub","followers_url":"https://api.github.com/users/hackclub/followers","following_url":"https://api.github.com/users/hackclub/following{/other_user}","gists_url":"https://api.github.com/users/hackclub/gists{/gist_id}","starred_url":"https://api.github.com/users/hackclub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackclub/subscriptions","organizations_url":"https://api.github.com/users/hackclub/orgs","repos_url":"https://api.github.com/users/hackclub/repos","events_url":"https://api.github.com/users/hackclub/events{/privacy}","received_events_url":"https://api.github.com/users/hackclub/received_events","type":"Organization","site_admin":false},"repo":{"id":63267923,"name":"lecture-hall","full_name":"hackclub/lecture-hall","owner":{"login":"hackclub","id":5633654,"avatar_url":"https://avatars.githubusercontent.com/u/5633654?v=3","gravatar_id":"","url":"https://api.github.com/users/hackclub","html_url":"https://github.com/hackclub","followers_url":"https://api.github.com/users/hackclub/followers","following_url":"https://api.github.com/users/hackclub/following{/other_user}","gists_url":"https://api.github.com/users/hackclub/gists{/gist_id}","starred_url":"https://api.github.com/users/hackclub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hackclub/subscriptions","organizations_url":"https://api.github.com/users/hackclub/orgs","repos_url":"https://api.github.com/users/hackclub/repos","events_url":"https://api.github.com/users/hackclub/events{/privacy}","received_events_url":"https://api.github.com/users/hackclub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hackclub/lecture-hall","description":"Renderer of Hack Club's workshops. See it live at https://workshops.hackclub.com","fork":false,"url":"https://api.github.com/repos/hackclub/lecture-hall","forks_url":"https://api.github.com/repos/hackclub/lecture-hall/forks","keys_url":"https://api.github.com/repos/hackclub/lecture-hall/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hackclub/lecture-hall/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hackclub/lecture-hall/teams","hooks_url":"https://api.github.com/repos/hackclub/lecture-hall/hooks","issue_events_url":"https://api.github.com/repos/hackclub/lecture-hall/issues/events{/number}","events_url":"https://api.github.com/repos/hackclub/lecture-hall/events","assignees_url":"https://api.github.com/repos/hackclub/lecture-hall/assignees{/user}","branches_url":"https://api.github.com/repos/hackclub/lecture-hall/branches{/branch}","tags_url":"https://api.github.com/repos/hackclub/lecture-hall/tags","blobs_url":"https://api.github.com/repos/hackclub/lecture-hall/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hackclub/lecture-hall/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hackclub/lecture-hall/git/refs{/sha}","trees_url":"https://api.github.com/repos/hackclub/lecture-hall/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hackclub/lecture-hall/statuses/{sha}","languages_url":"https://api.github.com/repos/hackclub/lecture-hall/languages","stargazers_url":"https://api.github.com/repos/hackclub/lecture-hall/stargazers","contributors_url":"https://api.github.com/repos/hackclub/lecture-hall/contributors","subscribers_url":"https://api.github.com/repos/hackclub/lecture-hall/subscribers","subscription_url":"https://api.github.com/repos/hackclub/lecture-hall/subscription","commits_url":"https://api.github.com/repos/hackclub/lecture-hall/commits{/sha}","git_commits_url":"https://api.github.com/repos/hackclub/lecture-hall/git/commits{/sha}","comments_url":"https://api.github.com/repos/hackclub/lecture-hall/comments{/number}","issue_comment_url":"https://api.github.com/repos/hackclub/lecture-hall/issues/comments{/number}","contents_url":"https://api.github.com/repos/hackclub/lecture-hall/contents/{+path}","compare_url":"https://api.github.com/repos/hackclub/lecture-hall/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hackclub/lecture-hall/merges","archive_url":"https://api.github.com/repos/hackclub/lecture-hall/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hackclub/lecture-hall/downloads","issues_url":"https://api.github.com/repos/hackclub/lecture-hall/issues{/number}","pulls_url":"https://api.github.com/repos/hackclub/lecture-hall/pulls{/number}","milestones_url":"https://api.github.com/repos/hackclub/lecture-hall/milestones{/number}","notifications_url":"https://api.github.com/repos/hackclub/lecture-hall/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hackclub/lecture-hall/labels{/name}","releases_url":"https://api.github.com/repos/hackclub/lecture-hall/releases{/id}","deployments_url":"https://api.github.com/repos/hackclub/lecture-hall/deployments","created_at":"2016-07-13T17:56:18Z","updated_at":"2016-08-07T01:16:31Z","pushed_at":"2016-08-16T21:17:09Z","git_url":"git://github.com/hackclub/lecture-hall.git","ssh_url":"git@github.com:hackclub/lecture-hall.git","clone_url":"https://github.com/hackclub/lecture-hall.git","svn_url":"https://github.com/hackclub/lecture-hall","homepage":"","size":118,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":16,"forks":2,"open_issues":16,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hackclub/lecture-hall/pulls/37"},"html":{"href":"https://github.com/hackclub/lecture-hall/pull/37"},"issue":{"href":"https://api.github.com/repos/hackclub/lecture-hall/issues/37"},"comments":{"href":"https://api.github.com/repos/hackclub/lecture-hall/issues/37/comments"},"review_comments":{"href":"https://api.github.com/repos/hackclub/lecture-hall/pulls/37/comments"},"review_comment":{"href":"https://api.github.com/repos/hackclub/lecture-hall/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hackclub/lecture-hall/pulls/37/commits"},"statuses":{"href":"https://api.github.com/repos/hackclub/lecture-hall/statuses/6b57ec4ce0051cc5adfba5568fcff8eee1b19ee1"}}}}
{"actor":{"display_login":"houndci-bot"}}