{"action":"created","comment":{"url":"https://api.github.com/repos/tylyon/subway_station_reviews/pulls/comments/22420884","id":22420884,"diff_hunk":"@@ -0,0 +1,68 @@\n+require \"rails_helper\"\n+\n+feature \"user deletes review\", %{\n+  As a registered user\n+  I want to delete my own review\n+  So that I can take back my review\n+\n+  Acceptance Criteria:\n+  [ ] I must be logged in\n+  [ ] Next to each of my reviews on a station page I see a link to delete my review\n+  [ ] If I click on this link I am prompted whether I want to delete the review\n+  [ ] If I click yes, my review is deleted and I am taken back to the station page\n+  [ ] I can't delete anyone else's reviews\n+  } do\n+    before(:each) do\n+      @review = FactoryGirl.create(:review)\n+      visit new_user_session_path\n+\n+      fill_in \"Email\", with: @review.user.email\n+      fill_in \"Password\", with: @review.user.password\n+\n+      click_button \"Log in\"\n+\n+      visit station_path(@review.station)\n+    end\n+\n+    scenario \"user cannot delete a review if not signed in\" do\n+      click_link \"Sign Out\"\n+      visit station_path(@review.station)\n+      expect(page).to_not have_button(\"Delete\")\n+    end\n+\n+    scenario \"user can see a delete button next to their review\" do\n+      expect(page).to have_button(\"Delete\")\n+    end\n+\n+    scenario \"user deletes review and is taken back to station page\" do\n+      review_description = @review.description\n+      click_button \"Delete\"\n+\n+      expect(page).to_not have_content(review_description)\n+      expect(Review.count).to eq 0\n+    end\n+\n+    scenario \"user cannot delete other user's reviews\" do\n+      station2 = FactoryGirl.create(:station)\n+      user2 = FactoryGirl.create(:user)\n+      review2 = FactoryGirl.create(:review)\n+      review2 = Review.new(description: review2.description,\n+        rating: review2.rating,\n+        station_id: station2.id,\n+        user_id: user2.id)","path":"spec/features/user_deletes_a_review_spec.rb","position":52,"original_position":52,"commit_id":"06a3aec090b2feb00951f08375fea8e8c558a013","original_commit_id":"06a3aec090b2feb00951f08375fea8e8c558a013","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":"Align the elements of a hash literal if they span more than one line.","created_at":"2015-01-02T19:59:14Z","updated_at":"2015-01-02T19:59:14Z","html_url":"https://github.com/tylyon/subway_station_reviews/pull/9#discussion_r22420884","pull_request_url":"https://api.github.com/repos/tylyon/subway_station_reviews/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/tylyon/subway_station_reviews/pulls/comments/22420884"},"html":{"href":"https://github.com/tylyon/subway_station_reviews/pull/9#discussion_r22420884"},"pull_request":{"href":"https://api.github.com/repos/tylyon/subway_station_reviews/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/tylyon/subway_station_reviews/pulls/9","id":26768848,"html_url":"https://github.com/tylyon/subway_station_reviews/pull/9","diff_url":"https://github.com/tylyon/subway_station_reviews/pull/9.diff","patch_url":"https://github.com/tylyon/subway_station_reviews/pull/9.patch","issue_url":"https://api.github.com/repos/tylyon/subway_station_reviews/issues/9","number":9,"state":"open","locked":false,"title":"Reviews destroy","user":{"login":"tylyon","id":8066645,"avatar_url":"https://avatars.githubusercontent.com/u/8066645?v=3","gravatar_id":"","url":"https://api.github.com/users/tylyon","html_url":"https://github.com/tylyon","followers_url":"https://api.github.com/users/tylyon/followers","following_url":"https://api.github.com/users/tylyon/following{/other_user}","gists_url":"https://api.github.com/users/tylyon/gists{/gist_id}","starred_url":"https://api.github.com/users/tylyon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylyon/subscriptions","organizations_url":"https://api.github.com/users/tylyon/orgs","repos_url":"https://api.github.com/users/tylyon/repos","events_url":"https://api.github.com/users/tylyon/events{/privacy}","received_events_url":"https://api.github.com/users/tylyon/received_events","type":"User","site_admin":false},"body":"Added destroy functionality to reviews. Javascript is not testable in Capybara. ","created_at":"2015-01-02T19:59:06Z","updated_at":"2015-01-02T19:59:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tylyon/subway_station_reviews/pulls/9/commits","review_comments_url":"https://api.github.com/repos/tylyon/subway_station_reviews/pulls/9/comments","review_comment_url":"https://api.github.com/repos/tylyon/subway_station_reviews/pulls/comments/{number}","comments_url":"https://api.github.com/repos/tylyon/subway_station_reviews/issues/9/comments","statuses_url":"https://api.github.com/repos/tylyon/subway_station_reviews/statuses/06a3aec090b2feb00951f08375fea8e8c558a013","head":{"label":"tylyon:reviews_destroy","ref":"reviews_destroy","sha":"06a3aec090b2feb00951f08375fea8e8c558a013","user":{"login":"tylyon","id":8066645,"avatar_url":"https://avatars.githubusercontent.com/u/8066645?v=3","gravatar_id":"","url":"https://api.github.com/users/tylyon","html_url":"https://github.com/tylyon","followers_url":"https://api.github.com/users/tylyon/followers","following_url":"https://api.github.com/users/tylyon/following{/other_user}","gists_url":"https://api.github.com/users/tylyon/gists{/gist_id}","starred_url":"https://api.github.com/users/tylyon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylyon/subscriptions","organizations_url":"https://api.github.com/users/tylyon/orgs","repos_url":"https://api.github.com/users/tylyon/repos","events_url":"https://api.github.com/users/tylyon/events{/privacy}","received_events_url":"https://api.github.com/users/tylyon/received_events","type":"User","site_admin":false},"repo":{"id":28602993,"name":"subway_station_reviews","full_name":"tylyon/subway_station_reviews","owner":{"login":"tylyon","id":8066645,"avatar_url":"https://avatars.githubusercontent.com/u/8066645?v=3","gravatar_id":"","url":"https://api.github.com/users/tylyon","html_url":"https://github.com/tylyon","followers_url":"https://api.github.com/users/tylyon/followers","following_url":"https://api.github.com/users/tylyon/following{/other_user}","gists_url":"https://api.github.com/users/tylyon/gists{/gist_id}","starred_url":"https://api.github.com/users/tylyon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylyon/subscriptions","organizations_url":"https://api.github.com/users/tylyon/orgs","repos_url":"https://api.github.com/users/tylyon/repos","events_url":"https://api.github.com/users/tylyon/events{/privacy}","received_events_url":"https://api.github.com/users/tylyon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tylyon/subway_station_reviews","description":"Launch Group Project","fork":false,"url":"https://api.github.com/repos/tylyon/subway_station_reviews","forks_url":"https://api.github.com/repos/tylyon/subway_station_reviews/forks","keys_url":"https://api.github.com/repos/tylyon/subway_station_reviews/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tylyon/subway_station_reviews/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tylyon/subway_station_reviews/teams","hooks_url":"https://api.github.com/repos/tylyon/subway_station_reviews/hooks","issue_events_url":"https://api.github.com/repos/tylyon/subway_station_reviews/issues/events{/number}","events_url":"https://api.github.com/repos/tylyon/subway_station_reviews/events","assignees_url":"https://api.github.com/repos/tylyon/subway_station_reviews/assignees{/user}","branches_url":"https://api.github.com/repos/tylyon/subway_station_reviews/branches{/branch}","tags_url":"https://api.github.com/repos/tylyon/subway_station_reviews/tags","blobs_url":"https://api.github.com/repos/tylyon/subway_station_reviews/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tylyon/subway_station_reviews/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tylyon/subway_station_reviews/git/refs{/sha}","trees_url":"https://api.github.com/repos/tylyon/subway_station_reviews/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tylyon/subway_station_reviews/statuses/{sha}","languages_url":"https://api.github.com/repos/tylyon/subway_station_reviews/languages","stargazers_url":"https://api.github.com/repos/tylyon/subway_station_reviews/stargazers","contributors_url":"https://api.github.com/repos/tylyon/subway_station_reviews/contributors","subscribers_url":"https://api.github.com/repos/tylyon/subway_station_reviews/subscribers","subscription_url":"https://api.github.com/repos/tylyon/subway_station_reviews/subscription","commits_url":"https://api.github.com/repos/tylyon/subway_station_reviews/commits{/sha}","git_commits_url":"https://api.github.com/repos/tylyon/subway_station_reviews/git/commits{/sha}","comments_url":"https://api.github.com/repos/tylyon/subway_station_reviews/comments{/number}","issue_comment_url":"https://api.github.com/repos/tylyon/subway_station_reviews/issues/comments/{number}","contents_url":"https://api.github.com/repos/tylyon/subway_station_reviews/contents/{+path}","compare_url":"https://api.github.com/repos/tylyon/subway_station_reviews/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tylyon/subway_station_reviews/merges","archive_url":"https://api.github.com/repos/tylyon/subway_station_reviews/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tylyon/subway_station_reviews/downloads","issues_url":"https://api.github.com/repos/tylyon/subway_station_reviews/issues{/number}","pulls_url":"https://api.github.com/repos/tylyon/subway_station_reviews/pulls{/number}","milestones_url":"https://api.github.com/repos/tylyon/subway_station_reviews/milestones{/number}","notifications_url":"https://api.github.com/repos/tylyon/subway_station_reviews/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tylyon/subway_station_reviews/labels{/name}","releases_url":"https://api.github.com/repos/tylyon/subway_station_reviews/releases{/id}","created_at":"2014-12-29T19:08:59Z","updated_at":"2015-01-02T18:29:16Z","pushed_at":"2015-01-02T19:58:07Z","git_url":"git://github.com/tylyon/subway_station_reviews.git","ssh_url":"git@github.com:tylyon/subway_station_reviews.git","clone_url":"https://github.com/tylyon/subway_station_reviews.git","svn_url":"https://github.com/tylyon/subway_station_reviews","homepage":null,"size":436,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"tylyon:master","ref":"master","sha":"9122caf3d251bf521ef25b7cf638c25a3103253f","user":{"login":"tylyon","id":8066645,"avatar_url":"https://avatars.githubusercontent.com/u/8066645?v=3","gravatar_id":"","url":"https://api.github.com/users/tylyon","html_url":"https://github.com/tylyon","followers_url":"https://api.github.com/users/tylyon/followers","following_url":"https://api.github.com/users/tylyon/following{/other_user}","gists_url":"https://api.github.com/users/tylyon/gists{/gist_id}","starred_url":"https://api.github.com/users/tylyon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylyon/subscriptions","organizations_url":"https://api.github.com/users/tylyon/orgs","repos_url":"https://api.github.com/users/tylyon/repos","events_url":"https://api.github.com/users/tylyon/events{/privacy}","received_events_url":"https://api.github.com/users/tylyon/received_events","type":"User","site_admin":false},"repo":{"id":28602993,"name":"subway_station_reviews","full_name":"tylyon/subway_station_reviews","owner":{"login":"tylyon","id":8066645,"avatar_url":"https://avatars.githubusercontent.com/u/8066645?v=3","gravatar_id":"","url":"https://api.github.com/users/tylyon","html_url":"https://github.com/tylyon","followers_url":"https://api.github.com/users/tylyon/followers","following_url":"https://api.github.com/users/tylyon/following{/other_user}","gists_url":"https://api.github.com/users/tylyon/gists{/gist_id}","starred_url":"https://api.github.com/users/tylyon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylyon/subscriptions","organizations_url":"https://api.github.com/users/tylyon/orgs","repos_url":"https://api.github.com/users/tylyon/repos","events_url":"https://api.github.com/users/tylyon/events{/privacy}","received_events_url":"https://api.github.com/users/tylyon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tylyon/subway_station_reviews","description":"Launch Group Project","fork":false,"url":"https://api.github.com/repos/tylyon/subway_station_reviews","forks_url":"https://api.github.com/repos/tylyon/subway_station_reviews/forks","keys_url":"https://api.github.com/repos/tylyon/subway_station_reviews/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tylyon/subway_station_reviews/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tylyon/subway_station_reviews/teams","hooks_url":"https://api.github.com/repos/tylyon/subway_station_reviews/hooks","issue_events_url":"https://api.github.com/repos/tylyon/subway_station_reviews/issues/events{/number}","events_url":"https://api.github.com/repos/tylyon/subway_station_reviews/events","assignees_url":"https://api.github.com/repos/tylyon/subway_station_reviews/assignees{/user}","branches_url":"https://api.github.com/repos/tylyon/subway_station_reviews/branches{/branch}","tags_url":"https://api.github.com/repos/tylyon/subway_station_reviews/tags","blobs_url":"https://api.github.com/repos/tylyon/subway_station_reviews/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tylyon/subway_station_reviews/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tylyon/subway_station_reviews/git/refs{/sha}","trees_url":"https://api.github.com/repos/tylyon/subway_station_reviews/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tylyon/subway_station_reviews/statuses/{sha}","languages_url":"https://api.github.com/repos/tylyon/subway_station_reviews/languages","stargazers_url":"https://api.github.com/repos/tylyon/subway_station_reviews/stargazers","contributors_url":"https://api.github.com/repos/tylyon/subway_station_reviews/contributors","subscribers_url":"https://api.github.com/repos/tylyon/subway_station_reviews/subscribers","subscription_url":"https://api.github.com/repos/tylyon/subway_station_reviews/subscription","commits_url":"https://api.github.com/repos/tylyon/subway_station_reviews/commits{/sha}","git_commits_url":"https://api.github.com/repos/tylyon/subway_station_reviews/git/commits{/sha}","comments_url":"https://api.github.com/repos/tylyon/subway_station_reviews/comments{/number}","issue_comment_url":"https://api.github.com/repos/tylyon/subway_station_reviews/issues/comments/{number}","contents_url":"https://api.github.com/repos/tylyon/subway_station_reviews/contents/{+path}","compare_url":"https://api.github.com/repos/tylyon/subway_station_reviews/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tylyon/subway_station_reviews/merges","archive_url":"https://api.github.com/repos/tylyon/subway_station_reviews/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tylyon/subway_station_reviews/downloads","issues_url":"https://api.github.com/repos/tylyon/subway_station_reviews/issues{/number}","pulls_url":"https://api.github.com/repos/tylyon/subway_station_reviews/pulls{/number}","milestones_url":"https://api.github.com/repos/tylyon/subway_station_reviews/milestones{/number}","notifications_url":"https://api.github.com/repos/tylyon/subway_station_reviews/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tylyon/subway_station_reviews/labels{/name}","releases_url":"https://api.github.com/repos/tylyon/subway_station_reviews/releases{/id}","created_at":"2014-12-29T19:08:59Z","updated_at":"2015-01-02T18:29:16Z","pushed_at":"2015-01-02T19:58:07Z","git_url":"git://github.com/tylyon/subway_station_reviews.git","ssh_url":"git@github.com:tylyon/subway_station_reviews.git","clone_url":"https://github.com/tylyon/subway_station_reviews.git","svn_url":"https://github.com/tylyon/subway_station_reviews","homepage":null,"size":436,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tylyon/subway_station_reviews/pulls/9"},"html":{"href":"https://github.com/tylyon/subway_station_reviews/pull/9"},"issue":{"href":"https://api.github.com/repos/tylyon/subway_station_reviews/issues/9"},"comments":{"href":"https://api.github.com/repos/tylyon/subway_station_reviews/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/tylyon/subway_station_reviews/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/tylyon/subway_station_reviews/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/tylyon/subway_station_reviews/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/tylyon/subway_station_reviews/statuses/06a3aec090b2feb00951f08375fea8e8c558a013"}}}}