{"action":"created","comment":{"url":"https://api.github.com/repos/tidyjava/blogging-platform/pulls/comments/72751702","id":72751702,"diff_hunk":"@@ -0,0 +1,67 @@\n+package com.tidyjava.bp\n+\n+import org.springframework.beans.factory.annotation.Autowired\n+import org.springframework.boot.test.SpringApplicationConfiguration\n+import org.springframework.test.context.web.WebAppConfiguration\n+import org.springframework.test.web.servlet.MockMvc\n+import org.springframework.test.web.servlet.setup.MockMvcBuilders\n+import org.springframework.web.context.WebApplicationContext\n+import spock.lang.Specification\n+\n+import static java.time.format.DateTimeFormatter.ISO_LOCAL_DATE\n+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get\n+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status\n+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view\n+\n+@SpringApplicationConfiguration(BloggingPlatform.class)\n+@WebAppConfiguration\n+class PostControllerSpec extends Specification {\n+\n+    @Autowired\n+    WebApplicationContext wac\n+\n+    MockMvc mockMvc\n+\n+    def setup() {\n+        mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build()\n+    }\n+\n+    def \"home\"() {\n+        expect:\n+        def result = mockMvc.perform(get(\"/\"))\n+                .andExpect(status().isOk())\n+                .andReturn()\n+        def posts = result.modelAndView.model.posts\n+        assertTestPost(posts[0], 2)\n+        assertTestPost(posts[1], 1)\n+    }\n+\n+    def \"post\"(n) {\n+        expect:\n+        def result = mockMvc.perform(get(\"/post$n\"))\n+                .andExpect(status().isOk())\n+                .andReturn()\n+        assertTestPost(result.modelAndView.model.post, n)\n+\n+        where:\n+        n << [1, 2]\n+    }\n+\n+    def \"missing post\"(n) {\n+        expect:\n+        mockMvc.perform(get(\"/surely-not-existent\"))\n+                .andExpect(status().isNotFound())\n+                .andExpect(view().name(\"not-found\"))\n+\n+        where:\n+        n << [1, 2]","path":"src/test/groovy/com/tidyjava/bp/PostControllerSpec.groovy","position":57,"original_position":57,"commit_id":"d6e78829901e36dce2f4377e466acf9b3833549a","original_commit_id":"d6e78829901e36dce2f4377e466acf9b3833549a","user":{"login":"tidyjava","id":18643108,"avatar_url":"https://avatars.githubusercontent.com/u/18643108?v=3","gravatar_id":"","url":"https://api.github.com/users/tidyjava","html_url":"https://github.com/tidyjava","followers_url":"https://api.github.com/users/tidyjava/followers","following_url":"https://api.github.com/users/tidyjava/following{/other_user}","gists_url":"https://api.github.com/users/tidyjava/gists{/gist_id}","starred_url":"https://api.github.com/users/tidyjava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tidyjava/subscriptions","organizations_url":"https://api.github.com/users/tidyjava/orgs","repos_url":"https://api.github.com/users/tidyjava/repos","events_url":"https://api.github.com/users/tidyjava/events{/privacy}","received_events_url":"https://api.github.com/users/tidyjava/received_events","type":"User","site_admin":false},"body":"copy-paste leftover","created_at":"2016-07-29T07:29:09Z","updated_at":"2016-07-29T07:29:09Z","html_url":"https://github.com/tidyjava/blogging-platform/pull/2#discussion_r72751702","pull_request_url":"https://api.github.com/repos/tidyjava/blogging-platform/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/tidyjava/blogging-platform/pulls/comments/72751702"},"html":{"href":"https://github.com/tidyjava/blogging-platform/pull/2#discussion_r72751702"},"pull_request":{"href":"https://api.github.com/repos/tidyjava/blogging-platform/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/tidyjava/blogging-platform/pulls/2","id":79317281,"html_url":"https://github.com/tidyjava/blogging-platform/pull/2","diff_url":"https://github.com/tidyjava/blogging-platform/pull/2.diff","patch_url":"https://github.com/tidyjava/blogging-platform/pull/2.patch","issue_url":"https://api.github.com/repos/tidyjava/blogging-platform/issues/2","number":2,"state":"open","locked":false,"title":"Part3 - Post handling","user":{"login":"tidyjava","id":18643108,"avatar_url":"https://avatars.githubusercontent.com/u/18643108?v=3","gravatar_id":"","url":"https://api.github.com/users/tidyjava","html_url":"https://github.com/tidyjava","followers_url":"https://api.github.com/users/tidyjava/followers","following_url":"https://api.github.com/users/tidyjava/following{/other_user}","gists_url":"https://api.github.com/users/tidyjava/gists{/gist_id}","starred_url":"https://api.github.com/users/tidyjava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tidyjava/subscriptions","organizations_url":"https://api.github.com/users/tidyjava/orgs","repos_url":"https://api.github.com/users/tidyjava/repos","events_url":"https://api.github.com/users/tidyjava/events{/privacy}","received_events_url":"https://api.github.com/users/tidyjava/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-29T07:25:13Z","updated_at":"2016-07-29T07:29:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c374a87610ebe2926103df9194dae729f0ba1a8c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/tidyjava/blogging-platform/pulls/2/commits","review_comments_url":"https://api.github.com/repos/tidyjava/blogging-platform/pulls/2/comments","review_comment_url":"https://api.github.com/repos/tidyjava/blogging-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tidyjava/blogging-platform/issues/2/comments","statuses_url":"https://api.github.com/repos/tidyjava/blogging-platform/statuses/d6e78829901e36dce2f4377e466acf9b3833549a","head":{"label":"tidyjava:part3","ref":"part3","sha":"d6e78829901e36dce2f4377e466acf9b3833549a","user":{"login":"tidyjava","id":18643108,"avatar_url":"https://avatars.githubusercontent.com/u/18643108?v=3","gravatar_id":"","url":"https://api.github.com/users/tidyjava","html_url":"https://github.com/tidyjava","followers_url":"https://api.github.com/users/tidyjava/followers","following_url":"https://api.github.com/users/tidyjava/following{/other_user}","gists_url":"https://api.github.com/users/tidyjava/gists{/gist_id}","starred_url":"https://api.github.com/users/tidyjava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tidyjava/subscriptions","organizations_url":"https://api.github.com/users/tidyjava/orgs","repos_url":"https://api.github.com/users/tidyjava/repos","events_url":"https://api.github.com/users/tidyjava/events{/privacy}","received_events_url":"https://api.github.com/users/tidyjava/received_events","type":"User","site_admin":false},"repo":{"id":62830432,"name":"blogging-platform","full_name":"tidyjava/blogging-platform","owner":{"login":"tidyjava","id":18643108,"avatar_url":"https://avatars.githubusercontent.com/u/18643108?v=3","gravatar_id":"","url":"https://api.github.com/users/tidyjava","html_url":"https://github.com/tidyjava","followers_url":"https://api.github.com/users/tidyjava/followers","following_url":"https://api.github.com/users/tidyjava/following{/other_user}","gists_url":"https://api.github.com/users/tidyjava/gists{/gist_id}","starred_url":"https://api.github.com/users/tidyjava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tidyjava/subscriptions","organizations_url":"https://api.github.com/users/tidyjava/orgs","repos_url":"https://api.github.com/users/tidyjava/repos","events_url":"https://api.github.com/users/tidyjava/events{/privacy}","received_events_url":"https://api.github.com/users/tidyjava/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tidyjava/blogging-platform","description":null,"fork":false,"url":"https://api.github.com/repos/tidyjava/blogging-platform","forks_url":"https://api.github.com/repos/tidyjava/blogging-platform/forks","keys_url":"https://api.github.com/repos/tidyjava/blogging-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tidyjava/blogging-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tidyjava/blogging-platform/teams","hooks_url":"https://api.github.com/repos/tidyjava/blogging-platform/hooks","issue_events_url":"https://api.github.com/repos/tidyjava/blogging-platform/issues/events{/number}","events_url":"https://api.github.com/repos/tidyjava/blogging-platform/events","assignees_url":"https://api.github.com/repos/tidyjava/blogging-platform/assignees{/user}","branches_url":"https://api.github.com/repos/tidyjava/blogging-platform/branches{/branch}","tags_url":"https://api.github.com/repos/tidyjava/blogging-platform/tags","blobs_url":"https://api.github.com/repos/tidyjava/blogging-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tidyjava/blogging-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tidyjava/blogging-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/tidyjava/blogging-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tidyjava/blogging-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/tidyjava/blogging-platform/languages","stargazers_url":"https://api.github.com/repos/tidyjava/blogging-platform/stargazers","contributors_url":"https://api.github.com/repos/tidyjava/blogging-platform/contributors","subscribers_url":"https://api.github.com/repos/tidyjava/blogging-platform/subscribers","subscription_url":"https://api.github.com/repos/tidyjava/blogging-platform/subscription","commits_url":"https://api.github.com/repos/tidyjava/blogging-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/tidyjava/blogging-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/tidyjava/blogging-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/tidyjava/blogging-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/tidyjava/blogging-platform/contents/{+path}","compare_url":"https://api.github.com/repos/tidyjava/blogging-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tidyjava/blogging-platform/merges","archive_url":"https://api.github.com/repos/tidyjava/blogging-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tidyjava/blogging-platform/downloads","issues_url":"https://api.github.com/repos/tidyjava/blogging-platform/issues{/number}","pulls_url":"https://api.github.com/repos/tidyjava/blogging-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/tidyjava/blogging-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/tidyjava/blogging-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tidyjava/blogging-platform/labels{/name}","releases_url":"https://api.github.com/repos/tidyjava/blogging-platform/releases{/id}","deployments_url":"https://api.github.com/repos/tidyjava/blogging-platform/deployments","created_at":"2016-07-07T18:44:52Z","updated_at":"2016-07-22T02:30:55Z","pushed_at":"2016-07-29T07:25:13Z","git_url":"git://github.com/tidyjava/blogging-platform.git","ssh_url":"git@github.com:tidyjava/blogging-platform.git","clone_url":"https://github.com/tidyjava/blogging-platform.git","svn_url":"https://github.com/tidyjava/blogging-platform","homepage":null,"size":26,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":4,"default_branch":"master"}},"base":{"label":"tidyjava:master","ref":"master","sha":"8d625ba589db547411cab8fa6289f48350b8ec49","user":{"login":"tidyjava","id":18643108,"avatar_url":"https://avatars.githubusercontent.com/u/18643108?v=3","gravatar_id":"","url":"https://api.github.com/users/tidyjava","html_url":"https://github.com/tidyjava","followers_url":"https://api.github.com/users/tidyjava/followers","following_url":"https://api.github.com/users/tidyjava/following{/other_user}","gists_url":"https://api.github.com/users/tidyjava/gists{/gist_id}","starred_url":"https://api.github.com/users/tidyjava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tidyjava/subscriptions","organizations_url":"https://api.github.com/users/tidyjava/orgs","repos_url":"https://api.github.com/users/tidyjava/repos","events_url":"https://api.github.com/users/tidyjava/events{/privacy}","received_events_url":"https://api.github.com/users/tidyjava/received_events","type":"User","site_admin":false},"repo":{"id":62830432,"name":"blogging-platform","full_name":"tidyjava/blogging-platform","owner":{"login":"tidyjava","id":18643108,"avatar_url":"https://avatars.githubusercontent.com/u/18643108?v=3","gravatar_id":"","url":"https://api.github.com/users/tidyjava","html_url":"https://github.com/tidyjava","followers_url":"https://api.github.com/users/tidyjava/followers","following_url":"https://api.github.com/users/tidyjava/following{/other_user}","gists_url":"https://api.github.com/users/tidyjava/gists{/gist_id}","starred_url":"https://api.github.com/users/tidyjava/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tidyjava/subscriptions","organizations_url":"https://api.github.com/users/tidyjava/orgs","repos_url":"https://api.github.com/users/tidyjava/repos","events_url":"https://api.github.com/users/tidyjava/events{/privacy}","received_events_url":"https://api.github.com/users/tidyjava/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tidyjava/blogging-platform","description":null,"fork":false,"url":"https://api.github.com/repos/tidyjava/blogging-platform","forks_url":"https://api.github.com/repos/tidyjava/blogging-platform/forks","keys_url":"https://api.github.com/repos/tidyjava/blogging-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tidyjava/blogging-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tidyjava/blogging-platform/teams","hooks_url":"https://api.github.com/repos/tidyjava/blogging-platform/hooks","issue_events_url":"https://api.github.com/repos/tidyjava/blogging-platform/issues/events{/number}","events_url":"https://api.github.com/repos/tidyjava/blogging-platform/events","assignees_url":"https://api.github.com/repos/tidyjava/blogging-platform/assignees{/user}","branches_url":"https://api.github.com/repos/tidyjava/blogging-platform/branches{/branch}","tags_url":"https://api.github.com/repos/tidyjava/blogging-platform/tags","blobs_url":"https://api.github.com/repos/tidyjava/blogging-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tidyjava/blogging-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tidyjava/blogging-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/tidyjava/blogging-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tidyjava/blogging-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/tidyjava/blogging-platform/languages","stargazers_url":"https://api.github.com/repos/tidyjava/blogging-platform/stargazers","contributors_url":"https://api.github.com/repos/tidyjava/blogging-platform/contributors","subscribers_url":"https://api.github.com/repos/tidyjava/blogging-platform/subscribers","subscription_url":"https://api.github.com/repos/tidyjava/blogging-platform/subscription","commits_url":"https://api.github.com/repos/tidyjava/blogging-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/tidyjava/blogging-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/tidyjava/blogging-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/tidyjava/blogging-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/tidyjava/blogging-platform/contents/{+path}","compare_url":"https://api.github.com/repos/tidyjava/blogging-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tidyjava/blogging-platform/merges","archive_url":"https://api.github.com/repos/tidyjava/blogging-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tidyjava/blogging-platform/downloads","issues_url":"https://api.github.com/repos/tidyjava/blogging-platform/issues{/number}","pulls_url":"https://api.github.com/repos/tidyjava/blogging-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/tidyjava/blogging-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/tidyjava/blogging-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tidyjava/blogging-platform/labels{/name}","releases_url":"https://api.github.com/repos/tidyjava/blogging-platform/releases{/id}","deployments_url":"https://api.github.com/repos/tidyjava/blogging-platform/deployments","created_at":"2016-07-07T18:44:52Z","updated_at":"2016-07-22T02:30:55Z","pushed_at":"2016-07-29T07:25:13Z","git_url":"git://github.com/tidyjava/blogging-platform.git","ssh_url":"git@github.com:tidyjava/blogging-platform.git","clone_url":"https://github.com/tidyjava/blogging-platform.git","svn_url":"https://github.com/tidyjava/blogging-platform","homepage":null,"size":26,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tidyjava/blogging-platform/pulls/2"},"html":{"href":"https://github.com/tidyjava/blogging-platform/pull/2"},"issue":{"href":"https://api.github.com/repos/tidyjava/blogging-platform/issues/2"},"comments":{"href":"https://api.github.com/repos/tidyjava/blogging-platform/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/tidyjava/blogging-platform/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/tidyjava/blogging-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tidyjava/blogging-platform/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/tidyjava/blogging-platform/statuses/d6e78829901e36dce2f4377e466acf9b3833549a"}}}}
{"actor":{"display_login":"tidyjava"}}