{"action":"created","comment":{"url":"https://api.github.com/repos/michael-reeves/redrum_nursery/pulls/comments/36817724","id":36817724,"diff_hunk":"@@ -0,0 +1,107 @@\n+require \"rails_helper\"\n+require \"factory_helper\"\n+\n+feature \"Admin can view all Products from Admin Dashboard\" do\n+  before do\n+    admin = User.create(first_name: \"Mike\",\n+                      last_name: \"Dorrance\",\n+                      email: \"mike@mike.com\",\n+                      password: \"12345678\",\n+                      role: \"admin\")\n+    build_products\n+\n+    allow_any_instance_of(ApplicationController)\n+      .to receive(:current_user).and_return(admin)\n+\n+    visit admin_dashboard_path\n+  end\n+\n+  scenario \"Admin logs in and sees View All Products button\" do\n+    expect(page).to have_content(\"View All Products\")\n+  end\n+\n+  scenario \"Admin clicks on View All Products and sees all products\" do\n+    product1 = @plants.products.first\n+    product2 = @food.products.first\n+    product3 = @accessories.products.first\n+\n+    click_link \"View All Products\"\n+\n+    expect(current_path).to eq(admin_products_path)\n+    expect(page).to have_content(\"All Products\")\n+    expect(page).to have_content(\"Image\")\n+    expect(page).to have_content(\"Name\")\n+    expect(page).to have_content(\"Description\")\n+    expect(page).to have_content(\"Price\")\n+    expect(page).to have_content(\"Category\")\n+    expect(page).to have_content(\"Status\")\n+\n+    within(\"tr\", text: product1.name) do\n+      expect(page).to have_css(\"img[src*='plants/plant-2.jpg']\")\n+      expect(page).to have_content(\"Plant 1\")\n+      expect(page).to have_content(\"This is the description for plant 1\")\n+      expect(page).to have_content(\"19.99\")\n+      expect(page).to have_content(\"Plants\")\n+      expect(page).to have_content(\"active\")\n+      expect(page).to have_link(\"edit\")\n+    end\n+  end\n+  scenario \"Admin clicks on edit button and can edit that Product\" do\n+    product1 = @plants.products.first\n+\n+    click_link \"View All Products\"\n+\n+    within(\"tr\", text: product1.name) do\n+      expect(page).to have_css(\"img[src*='plants/plant-2.jpg']\")\n+      expect(page).to have_content(\"Plant 1\")\n+      expect(page).to have_content(\"This is the description for plant 1\")\n+      expect(page).to have_content(\"19.99\")\n+      expect(page).to have_content(\"Plants\")\n+      expect(page).to have_content(\"active\")\n+      expect(page).to have_link(\"edit\")\n+\n+      click_link \"edit\"\n+    end\n+\n+      expect(current_path).to eq(edit_admin_product_path(product1))\n+      expect(page).to have_content(\"Edit Product\")\n+      expect(page).to have_content(\"Name\")\n+\n+      name = find(\"#product_form_name\").value\n+      expect(name).to eq(\"Plant 1\")\n+\n+      description = find(\"#product_form_description\").value\n+      expect(description).to eq(\"This is the description for plant 1\")\n+      expect(page).to have_content(\"Price\")\n+      price = find(\"#product_form_price\").value\n+      expect(price).to eq(\"19.99\")\n+      expect(page).to have_content(\"Status\")\n+      status = find(\"#product_form_status\").value\n+      category = find(\"#product_form_category\").value\n+      expect(page).to have_content(\"Plants\")\n+      expect(page).to have_content(\"Active\")\n+      expect(page).to have_content(\"Image Url\")\n+      url = find(\"#product_form_image_url\").value\n+      expect(url).to eq(\"plants/plant-2.jpg\")\n+      expect(page).to have_button(\"Edit Product\")\n+\n+      find('input[type=\"text\"][name*=\"name\"]').set(\"Richard\")\n+      find('input[type=\"text\"][name*=\"description\"]').set(\"A boat.\")\n+      find('input[type=\"text\"][name*=\"price\"]').set(\"12.99\")\n+      find('input[type=\"text\"][name*=\"image_url\"]').set(\"\")\n+      select \"Food\", from: \"product[category_id]\"\n+      select \"Retired\", from: \"product[status]\"\n+      click_button \"Edit Product\"\n+\n+      expect(current_path).to eq(admin_products_path)","path":"spec/features/admin_can_view_all_products_spec.rb","position":null,"original_position":96,"commit_id":"d3dfb7567744fcef665af0baa8997c4ef3665955","original_commit_id":"fd3318b570ec928577703465a1186e5db8ec3f01","user":{"login":"mdorrance","id":3131114,"avatar_url":"https://avatars.githubusercontent.com/u/3131114?v=3","gravatar_id":"","url":"https://api.github.com/users/mdorrance","html_url":"https://github.com/mdorrance","followers_url":"https://api.github.com/users/mdorrance/followers","following_url":"https://api.github.com/users/mdorrance/following{/other_user}","gists_url":"https://api.github.com/users/mdorrance/gists{/gist_id}","starred_url":"https://api.github.com/users/mdorrance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdorrance/subscriptions","organizations_url":"https://api.github.com/users/mdorrance/orgs","repos_url":"https://api.github.com/users/mdorrance/repos","events_url":"https://api.github.com/users/mdorrance/events{/privacy}","received_events_url":"https://api.github.com/users/mdorrance/received_events","type":"User","site_admin":false},"body":"Corrected.","created_at":"2015-08-12T00:58:02Z","updated_at":"2015-08-12T00:58:02Z","html_url":"https://github.com/michael-reeves/redrum_nursery/pull/73#discussion_r36817724","pull_request_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/pulls/73","_links":{"self":{"href":"https://api.github.com/repos/michael-reeves/redrum_nursery/pulls/comments/36817724"},"html":{"href":"https://github.com/michael-reeves/redrum_nursery/pull/73#discussion_r36817724"},"pull_request":{"href":"https://api.github.com/repos/michael-reeves/redrum_nursery/pulls/73"}}},"pull_request":{"url":"https://api.github.com/repos/michael-reeves/redrum_nursery/pulls/73","id":42191345,"html_url":"https://github.com/michael-reeves/redrum_nursery/pull/73","diff_url":"https://github.com/michael-reeves/redrum_nursery/pull/73.diff","patch_url":"https://github.com/michael-reeves/redrum_nursery/pull/73.patch","issue_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/issues/73","number":73,"state":"open","locked":false,"title":"61 admin items","user":{"login":"mdorrance","id":3131114,"avatar_url":"https://avatars.githubusercontent.com/u/3131114?v=3","gravatar_id":"","url":"https://api.github.com/users/mdorrance","html_url":"https://github.com/mdorrance","followers_url":"https://api.github.com/users/mdorrance/followers","following_url":"https://api.github.com/users/mdorrance/following{/other_user}","gists_url":"https://api.github.com/users/mdorrance/gists{/gist_id}","starred_url":"https://api.github.com/users/mdorrance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdorrance/subscriptions","organizations_url":"https://api.github.com/users/mdorrance/orgs","repos_url":"https://api.github.com/users/mdorrance/repos","events_url":"https://api.github.com/users/mdorrance/events{/privacy}","received_events_url":"https://api.github.com/users/mdorrance/received_events","type":"User","site_admin":false},"body":"As an Admin, when you visit \"/admin/products\" you can see all products with an edit button that links to the edit product form. The name of the product also links to the product show page.\r\n\r\nAdd breadcrumbs to top of admin/products, admin/products/new and admin/products/:id/edit","created_at":"2015-08-11T23:48:27Z","updated_at":"2015-08-12T00:58:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d7f4ec93d2fceef7ca22170edbbe55bc8bb5803b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/pulls/73/commits","review_comments_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/pulls/73/comments","review_comment_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/issues/73/comments","statuses_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/statuses/d3dfb7567744fcef665af0baa8997c4ef3665955","head":{"label":"michael-reeves:61-admin_items","ref":"61-admin_items","sha":"d3dfb7567744fcef665af0baa8997c4ef3665955","user":{"login":"michael-reeves","id":7769973,"avatar_url":"https://avatars.githubusercontent.com/u/7769973?v=3","gravatar_id":"","url":"https://api.github.com/users/michael-reeves","html_url":"https://github.com/michael-reeves","followers_url":"https://api.github.com/users/michael-reeves/followers","following_url":"https://api.github.com/users/michael-reeves/following{/other_user}","gists_url":"https://api.github.com/users/michael-reeves/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-reeves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-reeves/subscriptions","organizations_url":"https://api.github.com/users/michael-reeves/orgs","repos_url":"https://api.github.com/users/michael-reeves/repos","events_url":"https://api.github.com/users/michael-reeves/events{/privacy}","received_events_url":"https://api.github.com/users/michael-reeves/received_events","type":"User","site_admin":false},"repo":{"id":40136626,"name":"redrum_nursery","full_name":"michael-reeves/redrum_nursery","owner":{"login":"michael-reeves","id":7769973,"avatar_url":"https://avatars.githubusercontent.com/u/7769973?v=3","gravatar_id":"","url":"https://api.github.com/users/michael-reeves","html_url":"https://github.com/michael-reeves","followers_url":"https://api.github.com/users/michael-reeves/followers","following_url":"https://api.github.com/users/michael-reeves/following{/other_user}","gists_url":"https://api.github.com/users/michael-reeves/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-reeves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-reeves/subscriptions","organizations_url":"https://api.github.com/users/michael-reeves/orgs","repos_url":"https://api.github.com/users/michael-reeves/repos","events_url":"https://api.github.com/users/michael-reeves/events{/privacy}","received_events_url":"https://api.github.com/users/michael-reeves/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/michael-reeves/redrum_nursery","description":"Carnivorous Plant Store","fork":false,"url":"https://api.github.com/repos/michael-reeves/redrum_nursery","forks_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/forks","keys_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/teams","hooks_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/hooks","issue_events_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/issues/events{/number}","events_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/events","assignees_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/assignees{/user}","branches_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/branches{/branch}","tags_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/tags","blobs_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/git/refs{/sha}","trees_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/statuses/{sha}","languages_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/languages","stargazers_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/stargazers","contributors_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/contributors","subscribers_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/subscribers","subscription_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/subscription","commits_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/commits{/sha}","git_commits_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/git/commits{/sha}","comments_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/comments{/number}","issue_comment_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/issues/comments{/number}","contents_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/contents/{+path}","compare_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/merges","archive_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/downloads","issues_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/issues{/number}","pulls_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/pulls{/number}","milestones_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/milestones{/number}","notifications_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/labels{/name}","releases_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/releases{/id}","created_at":"2015-08-03T16:50:11Z","updated_at":"2015-08-11T00:49:09Z","pushed_at":"2015-08-12T00:55:26Z","git_url":"git://github.com/michael-reeves/redrum_nursery.git","ssh_url":"git@github.com:michael-reeves/redrum_nursery.git","clone_url":"https://github.com/michael-reeves/redrum_nursery.git","svn_url":"https://github.com/michael-reeves/redrum_nursery","homepage":null,"size":6810,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":11,"forks":1,"open_issues":11,"watchers":2,"default_branch":"master"}},"base":{"label":"michael-reeves:master","ref":"master","sha":"19ab6b10f139aed8cd6cc862972e31799d3dcb68","user":{"login":"michael-reeves","id":7769973,"avatar_url":"https://avatars.githubusercontent.com/u/7769973?v=3","gravatar_id":"","url":"https://api.github.com/users/michael-reeves","html_url":"https://github.com/michael-reeves","followers_url":"https://api.github.com/users/michael-reeves/followers","following_url":"https://api.github.com/users/michael-reeves/following{/other_user}","gists_url":"https://api.github.com/users/michael-reeves/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-reeves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-reeves/subscriptions","organizations_url":"https://api.github.com/users/michael-reeves/orgs","repos_url":"https://api.github.com/users/michael-reeves/repos","events_url":"https://api.github.com/users/michael-reeves/events{/privacy}","received_events_url":"https://api.github.com/users/michael-reeves/received_events","type":"User","site_admin":false},"repo":{"id":40136626,"name":"redrum_nursery","full_name":"michael-reeves/redrum_nursery","owner":{"login":"michael-reeves","id":7769973,"avatar_url":"https://avatars.githubusercontent.com/u/7769973?v=3","gravatar_id":"","url":"https://api.github.com/users/michael-reeves","html_url":"https://github.com/michael-reeves","followers_url":"https://api.github.com/users/michael-reeves/followers","following_url":"https://api.github.com/users/michael-reeves/following{/other_user}","gists_url":"https://api.github.com/users/michael-reeves/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-reeves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-reeves/subscriptions","organizations_url":"https://api.github.com/users/michael-reeves/orgs","repos_url":"https://api.github.com/users/michael-reeves/repos","events_url":"https://api.github.com/users/michael-reeves/events{/privacy}","received_events_url":"https://api.github.com/users/michael-reeves/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/michael-reeves/redrum_nursery","description":"Carnivorous Plant Store","fork":false,"url":"https://api.github.com/repos/michael-reeves/redrum_nursery","forks_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/forks","keys_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/teams","hooks_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/hooks","issue_events_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/issues/events{/number}","events_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/events","assignees_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/assignees{/user}","branches_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/branches{/branch}","tags_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/tags","blobs_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/git/refs{/sha}","trees_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/statuses/{sha}","languages_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/languages","stargazers_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/stargazers","contributors_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/contributors","subscribers_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/subscribers","subscription_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/subscription","commits_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/commits{/sha}","git_commits_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/git/commits{/sha}","comments_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/comments{/number}","issue_comment_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/issues/comments{/number}","contents_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/contents/{+path}","compare_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/merges","archive_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/downloads","issues_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/issues{/number}","pulls_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/pulls{/number}","milestones_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/milestones{/number}","notifications_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/labels{/name}","releases_url":"https://api.github.com/repos/michael-reeves/redrum_nursery/releases{/id}","created_at":"2015-08-03T16:50:11Z","updated_at":"2015-08-11T00:49:09Z","pushed_at":"2015-08-12T00:55:26Z","git_url":"git://github.com/michael-reeves/redrum_nursery.git","ssh_url":"git@github.com:michael-reeves/redrum_nursery.git","clone_url":"https://github.com/michael-reeves/redrum_nursery.git","svn_url":"https://github.com/michael-reeves/redrum_nursery","homepage":null,"size":6810,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":11,"forks":1,"open_issues":11,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/michael-reeves/redrum_nursery/pulls/73"},"html":{"href":"https://github.com/michael-reeves/redrum_nursery/pull/73"},"issue":{"href":"https://api.github.com/repos/michael-reeves/redrum_nursery/issues/73"},"comments":{"href":"https://api.github.com/repos/michael-reeves/redrum_nursery/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/michael-reeves/redrum_nursery/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/michael-reeves/redrum_nursery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/michael-reeves/redrum_nursery/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/michael-reeves/redrum_nursery/statuses/d3dfb7567744fcef665af0baa8997c4ef3665955"}}}}