{"action":"created","comment":{"url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/pulls/comments/52343891","id":52343891,"diff_hunk":"@@ -0,0 +1,138 @@\n+require 'flow_test_helper'\n+\n+class PicturesCrudTest < FlowTestCase\n+  setup do\n+    Capybara.default_driver = Capybara.javascript_driver\n+  end\n+\n+  test 'add a picture' do\n+    visit '/'\n+\n+    assert page.has_title?('Image')\n+\n+    click_on('Upload New Image')\n+\n+    assert_equal '/pictures/new', page.current_path\n+    assert_equal 'Add New Image', page.find('body h1').text\n+\n+    click_on('Upload an image')\n+\n+    assert_equal 'Add New Image', page.find('body h1').text\n+    assert_equal \"3 errors prohibited this image from being saved: Link can't be blank Link is invalid Tag list can't be blank\", page.find('#image_errors').text\n+\n+    picture_url = 'https://media.giphy.com/media/Xbjut97XRr1aU/giphy.gif'\n+    tags = %w(tag1 tag2)\n+    fill_in('Link', with: picture_url)\n+    fill_in('Tag', with: tags.join(', '))\n+\n+    click_on('Upload an image')\n+\n+    assert_match '/', page.current_path\n+    assert_picture_present(picture_url)\n+    assert_tag_list_present(tags)\n+  end\n+\n+  test 'show a picture' do\n+    picture = create_picture\n+\n+    visit '/'\n+\n+    click_on_picture(picture)\n+\n+    show_picture_path_pattern = %r{/pictures/\\d+}\n+    assert_match show_picture_path_pattern, page.current_path\n+    assert_picture_present(picture.link)\n+\n+    assert_tag_list_present(picture.tag_list)\n+\n+    click_on('Go Back')\n+    assert_equal '/', page.current_path\n+  end\n+\n+  test 'delete a picture' do\n+    picture = create_picture\n+\n+    visit picture_path(picture)\n+\n+    accept_alert do\n+      click_on('Delete it')\n+    end\n+\n+    assert_equal '/', page.current_path\n+    assert_no_picture_present(picture.link)\n+  end\n+\n+  test 'edit a picture' do\n+    picture = create_picture\n+    current_tags = picture.tag_list\n+    new_tags = [ current_tags.first ] + %w(newtag1 newtag2)\n+\n+    visit edit_picture_path(picture)\n+\n+    fill_in('Tag', with: new_tags.join(', '))\n+    click_on('Update')\n+    click_on_picture(picture)\n+\n+    show_picture_path_pattern = %r{/pictures/\\d+}\n+    assert_match show_picture_path_pattern, page.current_path\n+    assert_tag_list_present(new_tags)\n+  end\n+\n+  test 'edit a picture with error' do\n+    picture = create_picture\n+\n+    visit edit_picture_path(picture)\n+\n+    fill_in('Tag', with: '')\n+    click_on('Update')\n+\n+    assert_equal \"Tag list can't be blank\", page.find('#image_errors li').text\n+  end\n+\n+  test 'index page with tag filter' do\n+    [['tag1'], ['tag2', 'tag3'], ['tag3','tag4'] ].map do |tags|\n+      create_picture(tags)\n+    end\n+\n+    visit '/'\n+    assert_equal 3, page.all('#picture_list li').count\n+\n+    page.all(:xpath, \"//a[contains(., 'tag3')]\").first.click\n+    assert_equal 2, page.all('#picture_list li').count\n+  end\n+\n+  test 'show all tags' do\n+    [['tag1', 'tag2', 'tag3'], ['tag2', 'tag3'], ['tag3']].map do |tags|\n+      create_picture(tags)\n+    end\n+\n+    visit '/'","path":"test/flow_tests/pictures_crud_test.rb","position":109,"original_position":109,"commit_id":"30f043c00b44b80eb23d905c163675d46093e005","original_commit_id":"30f043c00b44b80eb23d905c163675d46093e005","user":{"login":"shiboying","id":7544433,"avatar_url":"https://avatars.githubusercontent.com/u/7544433?v=3","gravatar_id":"","url":"https://api.github.com/users/shiboying","html_url":"https://github.com/shiboying","followers_url":"https://api.github.com/users/shiboying/followers","following_url":"https://api.github.com/users/shiboying/following{/other_user}","gists_url":"https://api.github.com/users/shiboying/gists{/gist_id}","starred_url":"https://api.github.com/users/shiboying/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiboying/subscriptions","organizations_url":"https://api.github.com/users/shiboying/orgs","repos_url":"https://api.github.com/users/shiboying/repos","events_url":"https://api.github.com/users/shiboying/events{/privacy}","received_events_url":"https://api.github.com/users/shiboying/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2016-02-09T17:39:15Z","updated_at":"2016-02-09T17:39:15Z","html_url":"https://github.com/AppFolioOnboarding/Boying_ImageUploader/pull/43#discussion_r52343891","pull_request_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/pulls/43","_links":{"self":{"href":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/pulls/comments/52343891"},"html":{"href":"https://github.com/AppFolioOnboarding/Boying_ImageUploader/pull/43#discussion_r52343891"},"pull_request":{"href":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/pulls/43","id":58684833,"html_url":"https://github.com/AppFolioOnboarding/Boying_ImageUploader/pull/43","diff_url":"https://github.com/AppFolioOnboarding/Boying_ImageUploader/pull/43.diff","patch_url":"https://github.com/AppFolioOnboarding/Boying_ImageUploader/pull/43.patch","issue_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/issues/43","number":43,"state":"open","locked":false,"title":"Capybara","user":{"login":"shiboying","id":7544433,"avatar_url":"https://avatars.githubusercontent.com/u/7544433?v=3","gravatar_id":"","url":"https://api.github.com/users/shiboying","html_url":"https://github.com/shiboying","followers_url":"https://api.github.com/users/shiboying/followers","following_url":"https://api.github.com/users/shiboying/following{/other_user}","gists_url":"https://api.github.com/users/shiboying/gists{/gist_id}","starred_url":"https://api.github.com/users/shiboying/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shiboying/subscriptions","organizations_url":"https://api.github.com/users/shiboying/orgs","repos_url":"https://api.github.com/users/shiboying/repos","events_url":"https://api.github.com/users/shiboying/events{/privacy}","received_events_url":"https://api.github.com/users/shiboying/received_events","type":"User","site_admin":false},"body":"closes #40 ","created_at":"2016-02-08T23:38:39Z","updated_at":"2016-02-09T17:39:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a590905bd632d742ce50eec6494fca30a019c495","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/pulls/43/commits","review_comments_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/pulls/43/comments","review_comment_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/issues/43/comments","statuses_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/statuses/30f043c00b44b80eb23d905c163675d46093e005","head":{"label":"AppFolioOnboarding:Capybara","ref":"Capybara","sha":"30f043c00b44b80eb23d905c163675d46093e005","user":{"login":"AppFolioOnboarding","id":16782391,"avatar_url":"https://avatars.githubusercontent.com/u/16782391?v=3","gravatar_id":"","url":"https://api.github.com/users/AppFolioOnboarding","html_url":"https://github.com/AppFolioOnboarding","followers_url":"https://api.github.com/users/AppFolioOnboarding/followers","following_url":"https://api.github.com/users/AppFolioOnboarding/following{/other_user}","gists_url":"https://api.github.com/users/AppFolioOnboarding/gists{/gist_id}","starred_url":"https://api.github.com/users/AppFolioOnboarding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppFolioOnboarding/subscriptions","organizations_url":"https://api.github.com/users/AppFolioOnboarding/orgs","repos_url":"https://api.github.com/users/AppFolioOnboarding/repos","events_url":"https://api.github.com/users/AppFolioOnboarding/events{/privacy}","received_events_url":"https://api.github.com/users/AppFolioOnboarding/received_events","type":"Organization","site_admin":false},"repo":{"id":49970184,"name":"Boying_ImageUploader","full_name":"AppFolioOnboarding/Boying_ImageUploader","owner":{"login":"AppFolioOnboarding","id":16782391,"avatar_url":"https://avatars.githubusercontent.com/u/16782391?v=3","gravatar_id":"","url":"https://api.github.com/users/AppFolioOnboarding","html_url":"https://github.com/AppFolioOnboarding","followers_url":"https://api.github.com/users/AppFolioOnboarding/followers","following_url":"https://api.github.com/users/AppFolioOnboarding/following{/other_user}","gists_url":"https://api.github.com/users/AppFolioOnboarding/gists{/gist_id}","starred_url":"https://api.github.com/users/AppFolioOnboarding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppFolioOnboarding/subscriptions","organizations_url":"https://api.github.com/users/AppFolioOnboarding/orgs","repos_url":"https://api.github.com/users/AppFolioOnboarding/repos","events_url":"https://api.github.com/users/AppFolioOnboarding/events{/privacy}","received_events_url":"https://api.github.com/users/AppFolioOnboarding/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AppFolioOnboarding/Boying_ImageUploader","description":"","fork":false,"url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader","forks_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/forks","keys_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/teams","hooks_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/hooks","issue_events_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/issues/events{/number}","events_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/events","assignees_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/assignees{/user}","branches_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/branches{/branch}","tags_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/tags","blobs_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/git/refs{/sha}","trees_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/statuses/{sha}","languages_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/languages","stargazers_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/stargazers","contributors_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/contributors","subscribers_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/subscribers","subscription_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/subscription","commits_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/commits{/sha}","git_commits_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/git/commits{/sha}","comments_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/comments{/number}","issue_comment_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/issues/comments{/number}","contents_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/contents/{+path}","compare_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/merges","archive_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/downloads","issues_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/issues{/number}","pulls_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/pulls{/number}","milestones_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/milestones{/number}","notifications_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/labels{/name}","releases_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/releases{/id}","deployments_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/deployments","created_at":"2016-01-19T17:32:12Z","updated_at":"2016-01-19T17:34:28Z","pushed_at":"2016-02-09T02:07:46Z","git_url":"git://github.com/AppFolioOnboarding/Boying_ImageUploader.git","ssh_url":"git@github.com:AppFolioOnboarding/Boying_ImageUploader.git","clone_url":"https://github.com/AppFolioOnboarding/Boying_ImageUploader.git","svn_url":"https://github.com/AppFolioOnboarding/Boying_ImageUploader","homepage":null,"size":116,"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":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"AppFolioOnboarding:master","ref":"master","sha":"348a6fc9832f4e74891a306337f9fad6545747de","user":{"login":"AppFolioOnboarding","id":16782391,"avatar_url":"https://avatars.githubusercontent.com/u/16782391?v=3","gravatar_id":"","url":"https://api.github.com/users/AppFolioOnboarding","html_url":"https://github.com/AppFolioOnboarding","followers_url":"https://api.github.com/users/AppFolioOnboarding/followers","following_url":"https://api.github.com/users/AppFolioOnboarding/following{/other_user}","gists_url":"https://api.github.com/users/AppFolioOnboarding/gists{/gist_id}","starred_url":"https://api.github.com/users/AppFolioOnboarding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppFolioOnboarding/subscriptions","organizations_url":"https://api.github.com/users/AppFolioOnboarding/orgs","repos_url":"https://api.github.com/users/AppFolioOnboarding/repos","events_url":"https://api.github.com/users/AppFolioOnboarding/events{/privacy}","received_events_url":"https://api.github.com/users/AppFolioOnboarding/received_events","type":"Organization","site_admin":false},"repo":{"id":49970184,"name":"Boying_ImageUploader","full_name":"AppFolioOnboarding/Boying_ImageUploader","owner":{"login":"AppFolioOnboarding","id":16782391,"avatar_url":"https://avatars.githubusercontent.com/u/16782391?v=3","gravatar_id":"","url":"https://api.github.com/users/AppFolioOnboarding","html_url":"https://github.com/AppFolioOnboarding","followers_url":"https://api.github.com/users/AppFolioOnboarding/followers","following_url":"https://api.github.com/users/AppFolioOnboarding/following{/other_user}","gists_url":"https://api.github.com/users/AppFolioOnboarding/gists{/gist_id}","starred_url":"https://api.github.com/users/AppFolioOnboarding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AppFolioOnboarding/subscriptions","organizations_url":"https://api.github.com/users/AppFolioOnboarding/orgs","repos_url":"https://api.github.com/users/AppFolioOnboarding/repos","events_url":"https://api.github.com/users/AppFolioOnboarding/events{/privacy}","received_events_url":"https://api.github.com/users/AppFolioOnboarding/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AppFolioOnboarding/Boying_ImageUploader","description":"","fork":false,"url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader","forks_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/forks","keys_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/teams","hooks_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/hooks","issue_events_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/issues/events{/number}","events_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/events","assignees_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/assignees{/user}","branches_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/branches{/branch}","tags_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/tags","blobs_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/git/refs{/sha}","trees_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/statuses/{sha}","languages_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/languages","stargazers_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/stargazers","contributors_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/contributors","subscribers_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/subscribers","subscription_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/subscription","commits_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/commits{/sha}","git_commits_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/git/commits{/sha}","comments_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/comments{/number}","issue_comment_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/issues/comments{/number}","contents_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/contents/{+path}","compare_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/merges","archive_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/downloads","issues_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/issues{/number}","pulls_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/pulls{/number}","milestones_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/milestones{/number}","notifications_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/labels{/name}","releases_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/releases{/id}","deployments_url":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/deployments","created_at":"2016-01-19T17:32:12Z","updated_at":"2016-01-19T17:34:28Z","pushed_at":"2016-02-09T02:07:46Z","git_url":"git://github.com/AppFolioOnboarding/Boying_ImageUploader.git","ssh_url":"git@github.com:AppFolioOnboarding/Boying_ImageUploader.git","clone_url":"https://github.com/AppFolioOnboarding/Boying_ImageUploader.git","svn_url":"https://github.com/AppFolioOnboarding/Boying_ImageUploader","homepage":null,"size":116,"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":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/pulls/43"},"html":{"href":"https://github.com/AppFolioOnboarding/Boying_ImageUploader/pull/43"},"issue":{"href":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/issues/43"},"comments":{"href":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/AppFolioOnboarding/Boying_ImageUploader/statuses/30f043c00b44b80eb23d905c163675d46093e005"}}}}