{"action":"created","comment":{"url":"https://api.github.com/repos/damwhit/the_pivot/pulls/comments/57668370","id":57668370,"diff_hunk":"@@ -1,53 +1,87 @@\n require \"rails_helper\"\n \n RSpec.feature \"UserCanPlaceOrderAndViewPreviousOrder\", type: :feature do\n-  scenario \"user places order and views previous orders\" do\n-    pending\n-    # make pass!!!!\n-    category = Category.create(name: \"coffee\")\n-    product = category.products.create(name:\"Ethiopian\", price:1500,\n-    description:\"Ethiopian coffee is super good\")\n-    user = User.create(first_name: \"John\", last_name: \"Adams\", fullname: \"John Adams\",\n-                       email: \"email@example.com\", password: \"password\")\n+  include SpecHelpers\n+  scenario \"user places order and views previous orders\", js: true do\n+    make_listings_and_tickets\n \n-    visit \"/products/#{product.id}\"\n-    click_on \"Add to cart\"\n+    user = User.create(\n+      first_name: \"Sam\",\n+      last_name: \"White\",\n+      email: \"fodays@example.com\",\n+      password: \"password\",\n+      role: 0,\n+      fullname: \"Sam White\"\n+    )\n \n-    visit \"/\"\n+    event = Event.last\n+    listing = Listing.first\n+    ticket = Ticket.first\n \n-    click_on \"login\"\n+    visit event_path(event)\n \n+    within(\"#listing-#{listing.id}\") do\n+      select \"10\", from: \"seats\"\n+      click_on \"add to cart!\"\n+    end\n+\n+    visit \"/cart\"\n+\n+    click_on \"Checkout\"\n+\n+    fill_in \"name\", with: user.name\n     fill_in \"email\", with: user.email\n     fill_in \"password\", with: user.password\n-    click_on \"login\"\n \n-    click_on \"cart\"\n+    click_on \"continue\"\n \n-    click_on \"Checkout\"\n+    expect(current_path).to eq(\"/checkout\")\n \n+    expect(page).to have_content(event.name)\n+    expect(page).to have_content(ticket.format_price)\n \n-    order1 = user.orders.create(street: \"1600 pennslyvania\",\n-                                city: \"washington\",\n-                                state: \"District of Columbia\",\n-                                zip: \"46250\",\n-                                fullname: \"jonathon adams\",\n-                                first_name: \"jonathon\",\n-                                last_name: \"adams\",\n-                                email: \"spam@foundingfathers.biz\")\n+    click_on \"submit\"\n \n-    order1.order_products.create(product_id: product.id,\n-                                 quantity: 10)\n+    stripe_iframe = all(\"iframe[name=stripe_checkout_app]\").last\n+    Capybara.within_frame stripe_iframe do\n+      page.execute_script(%Q{ $(\"input#email\").val(\"bob@example.com\"); })\n+      sleep 1\n+      page.execute_script(%Q{ $(\"input#shipping-name\").val(\"Sam\"); })\n+      sleep 1\n+      page.execute_script(%Q{ $(\"input#shipping-street\").val(\"1510 Blake St\"); })\n+      sleep 1\n+      page.execute_script(%Q{ $(\"input#shipping-zip\").val(\"80000\"); })\n+      sleep 1\n+      page.execute_script(%Q{ $(\"input#shipping-city\").val(\"Denver\"); })\n \n-    click_on \"order history\"\n+      sleep 3\n \n-    expect(current_path).to eq(\"/users/#{user.id}/orders\")\n+      click_on \"Payment Info\"\n+\n+      page.execute_script(%Q{ $(\"input#card_number\").val(\"4242 4242 4242 4242\"); })","path":"spec/features/user/user_can_place_an_order_and_view_past_orders_spec.rb","position":88,"original_position":88,"commit_id":"e3a792fd39b240825d66f5a338eac79440e02ce7","original_commit_id":"e3a792fd39b240825d66f5a338eac79440e02ce7","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":"Line is too long. [83/80]<br>Use `%` instead of `%Q`.<br>Do not use `%Q` unless interpolation is needed.  Use `%q`.<br>Use `%Q` only for strings that contain both single quotes and double quotes, or for dynamic strings that contain double quotes.","created_at":"2016-03-29T03:36:12Z","updated_at":"2016-03-29T03:36:12Z","html_url":"https://github.com/damwhit/the_pivot/pull/54#discussion_r57668370","pull_request_url":"https://api.github.com/repos/damwhit/the_pivot/pulls/54","_links":{"self":{"href":"https://api.github.com/repos/damwhit/the_pivot/pulls/comments/57668370"},"html":{"href":"https://github.com/damwhit/the_pivot/pull/54#discussion_r57668370"},"pull_request":{"href":"https://api.github.com/repos/damwhit/the_pivot/pulls/54"}}},"pull_request":{"url":"https://api.github.com/repos/damwhit/the_pivot/pulls/54","id":64404951,"html_url":"https://github.com/damwhit/the_pivot/pull/54","diff_url":"https://github.com/damwhit/the_pivot/pull/54.diff","patch_url":"https://github.com/damwhit/the_pivot/pull/54.patch","issue_url":"https://api.github.com/repos/damwhit/the_pivot/issues/54","number":54,"state":"open","locked":false,"title":"Purchasing a ticket","user":{"login":"cheljoh","id":14203424,"avatar_url":"https://avatars.githubusercontent.com/u/14203424?v=3","gravatar_id":"","url":"https://api.github.com/users/cheljoh","html_url":"https://github.com/cheljoh","followers_url":"https://api.github.com/users/cheljoh/followers","following_url":"https://api.github.com/users/cheljoh/following{/other_user}","gists_url":"https://api.github.com/users/cheljoh/gists{/gist_id}","starred_url":"https://api.github.com/users/cheljoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cheljoh/subscriptions","organizations_url":"https://api.github.com/users/cheljoh/orgs","repos_url":"https://api.github.com/users/cheljoh/repos","events_url":"https://api.github.com/users/cheljoh/events{/privacy}","received_events_url":"https://api.github.com/users/cheljoh/received_events","type":"User","site_admin":false},"body":"Users are able to purchase one or more tickets. Not sure how to have Capybara fill out Stripe form yet.","created_at":"2016-03-29T02:21:42Z","updated_at":"2016-03-29T03:36:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5db087921e07f740629d315c58e3c3c69fe3534f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/damwhit/the_pivot/pulls/54/commits","review_comments_url":"https://api.github.com/repos/damwhit/the_pivot/pulls/54/comments","review_comment_url":"https://api.github.com/repos/damwhit/the_pivot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/damwhit/the_pivot/issues/54/comments","statuses_url":"https://api.github.com/repos/damwhit/the_pivot/statuses/e3a792fd39b240825d66f5a338eac79440e02ce7","head":{"label":"damwhit:purchasing_a_ticket","ref":"purchasing_a_ticket","sha":"e3a792fd39b240825d66f5a338eac79440e02ce7","user":{"login":"damwhit","id":13105577,"avatar_url":"https://avatars.githubusercontent.com/u/13105577?v=3","gravatar_id":"","url":"https://api.github.com/users/damwhit","html_url":"https://github.com/damwhit","followers_url":"https://api.github.com/users/damwhit/followers","following_url":"https://api.github.com/users/damwhit/following{/other_user}","gists_url":"https://api.github.com/users/damwhit/gists{/gist_id}","starred_url":"https://api.github.com/users/damwhit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damwhit/subscriptions","organizations_url":"https://api.github.com/users/damwhit/orgs","repos_url":"https://api.github.com/users/damwhit/repos","events_url":"https://api.github.com/users/damwhit/events{/privacy}","received_events_url":"https://api.github.com/users/damwhit/received_events","type":"User","site_admin":false},"repo":{"id":54416830,"name":"the_pivot","full_name":"damwhit/the_pivot","owner":{"login":"damwhit","id":13105577,"avatar_url":"https://avatars.githubusercontent.com/u/13105577?v=3","gravatar_id":"","url":"https://api.github.com/users/damwhit","html_url":"https://github.com/damwhit","followers_url":"https://api.github.com/users/damwhit/followers","following_url":"https://api.github.com/users/damwhit/following{/other_user}","gists_url":"https://api.github.com/users/damwhit/gists{/gist_id}","starred_url":"https://api.github.com/users/damwhit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damwhit/subscriptions","organizations_url":"https://api.github.com/users/damwhit/orgs","repos_url":"https://api.github.com/users/damwhit/repos","events_url":"https://api.github.com/users/damwhit/events{/privacy}","received_events_url":"https://api.github.com/users/damwhit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/damwhit/the_pivot","description":null,"fork":false,"url":"https://api.github.com/repos/damwhit/the_pivot","forks_url":"https://api.github.com/repos/damwhit/the_pivot/forks","keys_url":"https://api.github.com/repos/damwhit/the_pivot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/damwhit/the_pivot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/damwhit/the_pivot/teams","hooks_url":"https://api.github.com/repos/damwhit/the_pivot/hooks","issue_events_url":"https://api.github.com/repos/damwhit/the_pivot/issues/events{/number}","events_url":"https://api.github.com/repos/damwhit/the_pivot/events","assignees_url":"https://api.github.com/repos/damwhit/the_pivot/assignees{/user}","branches_url":"https://api.github.com/repos/damwhit/the_pivot/branches{/branch}","tags_url":"https://api.github.com/repos/damwhit/the_pivot/tags","blobs_url":"https://api.github.com/repos/damwhit/the_pivot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/damwhit/the_pivot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/damwhit/the_pivot/git/refs{/sha}","trees_url":"https://api.github.com/repos/damwhit/the_pivot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/damwhit/the_pivot/statuses/{sha}","languages_url":"https://api.github.com/repos/damwhit/the_pivot/languages","stargazers_url":"https://api.github.com/repos/damwhit/the_pivot/stargazers","contributors_url":"https://api.github.com/repos/damwhit/the_pivot/contributors","subscribers_url":"https://api.github.com/repos/damwhit/the_pivot/subscribers","subscription_url":"https://api.github.com/repos/damwhit/the_pivot/subscription","commits_url":"https://api.github.com/repos/damwhit/the_pivot/commits{/sha}","git_commits_url":"https://api.github.com/repos/damwhit/the_pivot/git/commits{/sha}","comments_url":"https://api.github.com/repos/damwhit/the_pivot/comments{/number}","issue_comment_url":"https://api.github.com/repos/damwhit/the_pivot/issues/comments{/number}","contents_url":"https://api.github.com/repos/damwhit/the_pivot/contents/{+path}","compare_url":"https://api.github.com/repos/damwhit/the_pivot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/damwhit/the_pivot/merges","archive_url":"https://api.github.com/repos/damwhit/the_pivot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/damwhit/the_pivot/downloads","issues_url":"https://api.github.com/repos/damwhit/the_pivot/issues{/number}","pulls_url":"https://api.github.com/repos/damwhit/the_pivot/pulls{/number}","milestones_url":"https://api.github.com/repos/damwhit/the_pivot/milestones{/number}","notifications_url":"https://api.github.com/repos/damwhit/the_pivot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/damwhit/the_pivot/labels{/name}","releases_url":"https://api.github.com/repos/damwhit/the_pivot/releases{/id}","deployments_url":"https://api.github.com/repos/damwhit/the_pivot/deployments","created_at":"2016-03-21T19:29:55Z","updated_at":"2016-03-21T19:46:29Z","pushed_at":"2016-03-29T03:36:04Z","git_url":"git://github.com/damwhit/the_pivot.git","ssh_url":"git@github.com:damwhit/the_pivot.git","clone_url":"https://github.com/damwhit/the_pivot.git","svn_url":"https://github.com/damwhit/the_pivot","homepage":null,"size":54013,"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":24,"forks":0,"open_issues":24,"watchers":0,"default_branch":"master"}},"base":{"label":"damwhit:master","ref":"master","sha":"22589c4c69ea59ea92d93c04cdcde26fe737a942","user":{"login":"damwhit","id":13105577,"avatar_url":"https://avatars.githubusercontent.com/u/13105577?v=3","gravatar_id":"","url":"https://api.github.com/users/damwhit","html_url":"https://github.com/damwhit","followers_url":"https://api.github.com/users/damwhit/followers","following_url":"https://api.github.com/users/damwhit/following{/other_user}","gists_url":"https://api.github.com/users/damwhit/gists{/gist_id}","starred_url":"https://api.github.com/users/damwhit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damwhit/subscriptions","organizations_url":"https://api.github.com/users/damwhit/orgs","repos_url":"https://api.github.com/users/damwhit/repos","events_url":"https://api.github.com/users/damwhit/events{/privacy}","received_events_url":"https://api.github.com/users/damwhit/received_events","type":"User","site_admin":false},"repo":{"id":54416830,"name":"the_pivot","full_name":"damwhit/the_pivot","owner":{"login":"damwhit","id":13105577,"avatar_url":"https://avatars.githubusercontent.com/u/13105577?v=3","gravatar_id":"","url":"https://api.github.com/users/damwhit","html_url":"https://github.com/damwhit","followers_url":"https://api.github.com/users/damwhit/followers","following_url":"https://api.github.com/users/damwhit/following{/other_user}","gists_url":"https://api.github.com/users/damwhit/gists{/gist_id}","starred_url":"https://api.github.com/users/damwhit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damwhit/subscriptions","organizations_url":"https://api.github.com/users/damwhit/orgs","repos_url":"https://api.github.com/users/damwhit/repos","events_url":"https://api.github.com/users/damwhit/events{/privacy}","received_events_url":"https://api.github.com/users/damwhit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/damwhit/the_pivot","description":null,"fork":false,"url":"https://api.github.com/repos/damwhit/the_pivot","forks_url":"https://api.github.com/repos/damwhit/the_pivot/forks","keys_url":"https://api.github.com/repos/damwhit/the_pivot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/damwhit/the_pivot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/damwhit/the_pivot/teams","hooks_url":"https://api.github.com/repos/damwhit/the_pivot/hooks","issue_events_url":"https://api.github.com/repos/damwhit/the_pivot/issues/events{/number}","events_url":"https://api.github.com/repos/damwhit/the_pivot/events","assignees_url":"https://api.github.com/repos/damwhit/the_pivot/assignees{/user}","branches_url":"https://api.github.com/repos/damwhit/the_pivot/branches{/branch}","tags_url":"https://api.github.com/repos/damwhit/the_pivot/tags","blobs_url":"https://api.github.com/repos/damwhit/the_pivot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/damwhit/the_pivot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/damwhit/the_pivot/git/refs{/sha}","trees_url":"https://api.github.com/repos/damwhit/the_pivot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/damwhit/the_pivot/statuses/{sha}","languages_url":"https://api.github.com/repos/damwhit/the_pivot/languages","stargazers_url":"https://api.github.com/repos/damwhit/the_pivot/stargazers","contributors_url":"https://api.github.com/repos/damwhit/the_pivot/contributors","subscribers_url":"https://api.github.com/repos/damwhit/the_pivot/subscribers","subscription_url":"https://api.github.com/repos/damwhit/the_pivot/subscription","commits_url":"https://api.github.com/repos/damwhit/the_pivot/commits{/sha}","git_commits_url":"https://api.github.com/repos/damwhit/the_pivot/git/commits{/sha}","comments_url":"https://api.github.com/repos/damwhit/the_pivot/comments{/number}","issue_comment_url":"https://api.github.com/repos/damwhit/the_pivot/issues/comments{/number}","contents_url":"https://api.github.com/repos/damwhit/the_pivot/contents/{+path}","compare_url":"https://api.github.com/repos/damwhit/the_pivot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/damwhit/the_pivot/merges","archive_url":"https://api.github.com/repos/damwhit/the_pivot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/damwhit/the_pivot/downloads","issues_url":"https://api.github.com/repos/damwhit/the_pivot/issues{/number}","pulls_url":"https://api.github.com/repos/damwhit/the_pivot/pulls{/number}","milestones_url":"https://api.github.com/repos/damwhit/the_pivot/milestones{/number}","notifications_url":"https://api.github.com/repos/damwhit/the_pivot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/damwhit/the_pivot/labels{/name}","releases_url":"https://api.github.com/repos/damwhit/the_pivot/releases{/id}","deployments_url":"https://api.github.com/repos/damwhit/the_pivot/deployments","created_at":"2016-03-21T19:29:55Z","updated_at":"2016-03-21T19:46:29Z","pushed_at":"2016-03-29T03:36:04Z","git_url":"git://github.com/damwhit/the_pivot.git","ssh_url":"git@github.com:damwhit/the_pivot.git","clone_url":"https://github.com/damwhit/the_pivot.git","svn_url":"https://github.com/damwhit/the_pivot","homepage":null,"size":54013,"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":24,"forks":0,"open_issues":24,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/damwhit/the_pivot/pulls/54"},"html":{"href":"https://github.com/damwhit/the_pivot/pull/54"},"issue":{"href":"https://api.github.com/repos/damwhit/the_pivot/issues/54"},"comments":{"href":"https://api.github.com/repos/damwhit/the_pivot/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/damwhit/the_pivot/pulls/54/comments"},"review_comment":{"href":"https://api.github.com/repos/damwhit/the_pivot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/damwhit/the_pivot/pulls/54/commits"},"statuses":{"href":"https://api.github.com/repos/damwhit/the_pivot/statuses/e3a792fd39b240825d66f5a338eac79440e02ce7"}}}}