{"action":"created","comment":{"url":"https://api.github.com/repos/davemaurer/dinner_dash/pulls/comments/32897915","id":32897915,"diff_hunk":"@@ -0,0 +1,84 @@\n+require \"rails_helper\"\n+\n+RSpec.feature \"admin can update categories for an item\", type: :feature do\n+  before(:each) do\n+    dessert_cat = Category.create(name: \"dessert\")\n+    curry_cat   = Category.new(name: \"curry\")\n+    seafood_cat = Category.new(name: \"seafood\")\n+    drinks_cat  = Category.new(name: \"drinks\")\n+\n+    unicorn     = Item.create(title: \"Unicorn Pie\",\n+                              description: \"Good\",\n+                              price: 8,\n+                              status: \"active\",\n+                              categories: [dessert_cat, seafood_cat])\n+\n+    elaria      = User.create(full_name: \"Elaria Sand\",\n+                              user_name: \"HouseMartell\",\n+                              email: \"elaria@dorne.com\",\n+                              password: \"password\",\n+                              role: 1)\n+\n+    allow_any_instance_of(ApplicationController).to receive(:current_user).and_return(elaria)\n+  end\n+\n+  let(:item) { Item.first }\n+\n+  scenario \"the item show page for admins shows the item's categories\" do\n+    visit admin_item_path(item.id)\n+\n+    within(\".categories\") do\n+      expect(page).to have_content(\"Dessert\")\n+      expect(page).to have_content(\"Seafood\")\n+    end\n+  end\n+\n+  scenario \"the item show page has a link to edit the item\" do\n+    visit admin_item_path(item.id)\n+\n+    within(\"#nav_links\") do\n+      expect(page).to have_link(\"Edit\")\n+    end\n+  end\n+\n+  scenario \"the edit link redirects to the edit page\" do\n+    visit admin_item_path(item)\n+    click_link(\"Edit\")\n+\n+    expect(current_path).to eq(edit_admin_item_path(item))\n+  end\n+\n+  context \"adding and removing categories for an item\" do\n+      let(:dessert) { Category.find_by(name: \"Dessert\") }\n+      let(:seafood) { Category.find_by(name: \"Seafood\") }\n+      let(:curry)   { Category.find_by(name: \"Curry\") }\n+      let(:drinks)  { Category.find_by(name: \"Drinks\") }\n+\n+    scenario \"admin can remove a category from an item\" do\n+      visit edit_admin_item_path(item)\n+\n+      find(:xpath, \"//input[@value='#{dessert.id}']\").set(false)\n+      click_button \"Finished\"\n+\n+      within(\".categories\") do\n+        expect(page).to_not have_content(dessert.name)\n+        expect(page).to have_content(seafood.name)\n+      end\n+    end\n+\n+    xscenario \"admin can add a category from an item\" do\n+    # page does now show all categories in test","path":"spec/features/admin_user/admin_change_categories_for_item_spec.rb","position":70,"original_position":70,"commit_id":"8169af627d75806a2ac136ce92e1d13a0736e466","original_commit_id":"8169af627d75806a2ac136ce92e1d13a0736e466","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":"Incorrect indentation detected (column 4 instead of 6).","created_at":"2015-06-21T21:31:05Z","updated_at":"2015-06-21T21:31:05Z","html_url":"https://github.com/davemaurer/dinner_dash/pull/82#discussion_r32897915","pull_request_url":"https://api.github.com/repos/davemaurer/dinner_dash/pulls/82","_links":{"self":{"href":"https://api.github.com/repos/davemaurer/dinner_dash/pulls/comments/32897915"},"html":{"href":"https://github.com/davemaurer/dinner_dash/pull/82#discussion_r32897915"},"pull_request":{"href":"https://api.github.com/repos/davemaurer/dinner_dash/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/davemaurer/dinner_dash/pulls/82","id":38191058,"html_url":"https://github.com/davemaurer/dinner_dash/pull/82","diff_url":"https://github.com/davemaurer/dinner_dash/pull/82.diff","patch_url":"https://github.com/davemaurer/dinner_dash/pull/82.patch","issue_url":"https://api.github.com/repos/davemaurer/dinner_dash/issues/82","number":82,"state":"open","locked":false,"title":"30 add and remove categories from items","user":{"login":"aoili","id":11182356,"avatar_url":"https://avatars.githubusercontent.com/u/11182356?v=3","gravatar_id":"","url":"https://api.github.com/users/aoili","html_url":"https://github.com/aoili","followers_url":"https://api.github.com/users/aoili/followers","following_url":"https://api.github.com/users/aoili/following{/other_user}","gists_url":"https://api.github.com/users/aoili/gists{/gist_id}","starred_url":"https://api.github.com/users/aoili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aoili/subscriptions","organizations_url":"https://api.github.com/users/aoili/orgs","repos_url":"https://api.github.com/users/aoili/repos","events_url":"https://api.github.com/users/aoili/events{/privacy}","received_events_url":"https://api.github.com/users/aoili/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-21T21:30:59Z","updated_at":"2015-06-21T21:31:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ca9e088ce5ab8c83d1cf08d812ab728710779576","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/davemaurer/dinner_dash/pulls/82/commits","review_comments_url":"https://api.github.com/repos/davemaurer/dinner_dash/pulls/82/comments","review_comment_url":"https://api.github.com/repos/davemaurer/dinner_dash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/davemaurer/dinner_dash/issues/82/comments","statuses_url":"https://api.github.com/repos/davemaurer/dinner_dash/statuses/8169af627d75806a2ac136ce92e1d13a0736e466","head":{"label":"davemaurer:30_add_and_remove_categories_from_items","ref":"30_add_and_remove_categories_from_items","sha":"8169af627d75806a2ac136ce92e1d13a0736e466","user":{"login":"davemaurer","id":9309907,"avatar_url":"https://avatars.githubusercontent.com/u/9309907?v=3","gravatar_id":"","url":"https://api.github.com/users/davemaurer","html_url":"https://github.com/davemaurer","followers_url":"https://api.github.com/users/davemaurer/followers","following_url":"https://api.github.com/users/davemaurer/following{/other_user}","gists_url":"https://api.github.com/users/davemaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/davemaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davemaurer/subscriptions","organizations_url":"https://api.github.com/users/davemaurer/orgs","repos_url":"https://api.github.com/users/davemaurer/repos","events_url":"https://api.github.com/users/davemaurer/events{/privacy}","received_events_url":"https://api.github.com/users/davemaurer/received_events","type":"User","site_admin":false},"repo":{"id":37473112,"name":"dinner_dash","full_name":"davemaurer/dinner_dash","owner":{"login":"davemaurer","id":9309907,"avatar_url":"https://avatars.githubusercontent.com/u/9309907?v=3","gravatar_id":"","url":"https://api.github.com/users/davemaurer","html_url":"https://github.com/davemaurer","followers_url":"https://api.github.com/users/davemaurer/followers","following_url":"https://api.github.com/users/davemaurer/following{/other_user}","gists_url":"https://api.github.com/users/davemaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/davemaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davemaurer/subscriptions","organizations_url":"https://api.github.com/users/davemaurer/orgs","repos_url":"https://api.github.com/users/davemaurer/repos","events_url":"https://api.github.com/users/davemaurer/events{/privacy}","received_events_url":"https://api.github.com/users/davemaurer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davemaurer/dinner_dash","description":"","fork":false,"url":"https://api.github.com/repos/davemaurer/dinner_dash","forks_url":"https://api.github.com/repos/davemaurer/dinner_dash/forks","keys_url":"https://api.github.com/repos/davemaurer/dinner_dash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davemaurer/dinner_dash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davemaurer/dinner_dash/teams","hooks_url":"https://api.github.com/repos/davemaurer/dinner_dash/hooks","issue_events_url":"https://api.github.com/repos/davemaurer/dinner_dash/issues/events{/number}","events_url":"https://api.github.com/repos/davemaurer/dinner_dash/events","assignees_url":"https://api.github.com/repos/davemaurer/dinner_dash/assignees{/user}","branches_url":"https://api.github.com/repos/davemaurer/dinner_dash/branches{/branch}","tags_url":"https://api.github.com/repos/davemaurer/dinner_dash/tags","blobs_url":"https://api.github.com/repos/davemaurer/dinner_dash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davemaurer/dinner_dash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davemaurer/dinner_dash/git/refs{/sha}","trees_url":"https://api.github.com/repos/davemaurer/dinner_dash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davemaurer/dinner_dash/statuses/{sha}","languages_url":"https://api.github.com/repos/davemaurer/dinner_dash/languages","stargazers_url":"https://api.github.com/repos/davemaurer/dinner_dash/stargazers","contributors_url":"https://api.github.com/repos/davemaurer/dinner_dash/contributors","subscribers_url":"https://api.github.com/repos/davemaurer/dinner_dash/subscribers","subscription_url":"https://api.github.com/repos/davemaurer/dinner_dash/subscription","commits_url":"https://api.github.com/repos/davemaurer/dinner_dash/commits{/sha}","git_commits_url":"https://api.github.com/repos/davemaurer/dinner_dash/git/commits{/sha}","comments_url":"https://api.github.com/repos/davemaurer/dinner_dash/comments{/number}","issue_comment_url":"https://api.github.com/repos/davemaurer/dinner_dash/issues/comments{/number}","contents_url":"https://api.github.com/repos/davemaurer/dinner_dash/contents/{+path}","compare_url":"https://api.github.com/repos/davemaurer/dinner_dash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davemaurer/dinner_dash/merges","archive_url":"https://api.github.com/repos/davemaurer/dinner_dash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davemaurer/dinner_dash/downloads","issues_url":"https://api.github.com/repos/davemaurer/dinner_dash/issues{/number}","pulls_url":"https://api.github.com/repos/davemaurer/dinner_dash/pulls{/number}","milestones_url":"https://api.github.com/repos/davemaurer/dinner_dash/milestones{/number}","notifications_url":"https://api.github.com/repos/davemaurer/dinner_dash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davemaurer/dinner_dash/labels{/name}","releases_url":"https://api.github.com/repos/davemaurer/dinner_dash/releases{/id}","created_at":"2015-06-15T15:17:38Z","updated_at":"2015-06-19T02:19:17Z","pushed_at":"2015-06-21T21:30:59Z","git_url":"git://github.com/davemaurer/dinner_dash.git","ssh_url":"git@github.com:davemaurer/dinner_dash.git","clone_url":"https://github.com/davemaurer/dinner_dash.git","svn_url":"https://github.com/davemaurer/dinner_dash","homepage":null,"size":940,"stargazers_count":0,"watchers_count":0,"language":"CSS","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":"davemaurer:master","ref":"master","sha":"fe5c7c891019426b7537530b04562bfcee9f7877","user":{"login":"davemaurer","id":9309907,"avatar_url":"https://avatars.githubusercontent.com/u/9309907?v=3","gravatar_id":"","url":"https://api.github.com/users/davemaurer","html_url":"https://github.com/davemaurer","followers_url":"https://api.github.com/users/davemaurer/followers","following_url":"https://api.github.com/users/davemaurer/following{/other_user}","gists_url":"https://api.github.com/users/davemaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/davemaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davemaurer/subscriptions","organizations_url":"https://api.github.com/users/davemaurer/orgs","repos_url":"https://api.github.com/users/davemaurer/repos","events_url":"https://api.github.com/users/davemaurer/events{/privacy}","received_events_url":"https://api.github.com/users/davemaurer/received_events","type":"User","site_admin":false},"repo":{"id":37473112,"name":"dinner_dash","full_name":"davemaurer/dinner_dash","owner":{"login":"davemaurer","id":9309907,"avatar_url":"https://avatars.githubusercontent.com/u/9309907?v=3","gravatar_id":"","url":"https://api.github.com/users/davemaurer","html_url":"https://github.com/davemaurer","followers_url":"https://api.github.com/users/davemaurer/followers","following_url":"https://api.github.com/users/davemaurer/following{/other_user}","gists_url":"https://api.github.com/users/davemaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/davemaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davemaurer/subscriptions","organizations_url":"https://api.github.com/users/davemaurer/orgs","repos_url":"https://api.github.com/users/davemaurer/repos","events_url":"https://api.github.com/users/davemaurer/events{/privacy}","received_events_url":"https://api.github.com/users/davemaurer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davemaurer/dinner_dash","description":"","fork":false,"url":"https://api.github.com/repos/davemaurer/dinner_dash","forks_url":"https://api.github.com/repos/davemaurer/dinner_dash/forks","keys_url":"https://api.github.com/repos/davemaurer/dinner_dash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davemaurer/dinner_dash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davemaurer/dinner_dash/teams","hooks_url":"https://api.github.com/repos/davemaurer/dinner_dash/hooks","issue_events_url":"https://api.github.com/repos/davemaurer/dinner_dash/issues/events{/number}","events_url":"https://api.github.com/repos/davemaurer/dinner_dash/events","assignees_url":"https://api.github.com/repos/davemaurer/dinner_dash/assignees{/user}","branches_url":"https://api.github.com/repos/davemaurer/dinner_dash/branches{/branch}","tags_url":"https://api.github.com/repos/davemaurer/dinner_dash/tags","blobs_url":"https://api.github.com/repos/davemaurer/dinner_dash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davemaurer/dinner_dash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davemaurer/dinner_dash/git/refs{/sha}","trees_url":"https://api.github.com/repos/davemaurer/dinner_dash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davemaurer/dinner_dash/statuses/{sha}","languages_url":"https://api.github.com/repos/davemaurer/dinner_dash/languages","stargazers_url":"https://api.github.com/repos/davemaurer/dinner_dash/stargazers","contributors_url":"https://api.github.com/repos/davemaurer/dinner_dash/contributors","subscribers_url":"https://api.github.com/repos/davemaurer/dinner_dash/subscribers","subscription_url":"https://api.github.com/repos/davemaurer/dinner_dash/subscription","commits_url":"https://api.github.com/repos/davemaurer/dinner_dash/commits{/sha}","git_commits_url":"https://api.github.com/repos/davemaurer/dinner_dash/git/commits{/sha}","comments_url":"https://api.github.com/repos/davemaurer/dinner_dash/comments{/number}","issue_comment_url":"https://api.github.com/repos/davemaurer/dinner_dash/issues/comments{/number}","contents_url":"https://api.github.com/repos/davemaurer/dinner_dash/contents/{+path}","compare_url":"https://api.github.com/repos/davemaurer/dinner_dash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davemaurer/dinner_dash/merges","archive_url":"https://api.github.com/repos/davemaurer/dinner_dash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davemaurer/dinner_dash/downloads","issues_url":"https://api.github.com/repos/davemaurer/dinner_dash/issues{/number}","pulls_url":"https://api.github.com/repos/davemaurer/dinner_dash/pulls{/number}","milestones_url":"https://api.github.com/repos/davemaurer/dinner_dash/milestones{/number}","notifications_url":"https://api.github.com/repos/davemaurer/dinner_dash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davemaurer/dinner_dash/labels{/name}","releases_url":"https://api.github.com/repos/davemaurer/dinner_dash/releases{/id}","created_at":"2015-06-15T15:17:38Z","updated_at":"2015-06-19T02:19:17Z","pushed_at":"2015-06-21T21:30:59Z","git_url":"git://github.com/davemaurer/dinner_dash.git","ssh_url":"git@github.com:davemaurer/dinner_dash.git","clone_url":"https://github.com/davemaurer/dinner_dash.git","svn_url":"https://github.com/davemaurer/dinner_dash","homepage":null,"size":940,"stargazers_count":0,"watchers_count":0,"language":"CSS","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/davemaurer/dinner_dash/pulls/82"},"html":{"href":"https://github.com/davemaurer/dinner_dash/pull/82"},"issue":{"href":"https://api.github.com/repos/davemaurer/dinner_dash/issues/82"},"comments":{"href":"https://api.github.com/repos/davemaurer/dinner_dash/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/davemaurer/dinner_dash/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/davemaurer/dinner_dash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/davemaurer/dinner_dash/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/davemaurer/dinner_dash/statuses/8169af627d75806a2ac136ce92e1d13a0736e466"}}}}