{"action":"created","comment":{"url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/pulls/comments/76825573","id":76825573,"diff_hunk":"@@ -0,0 +1,23 @@\n+require 'test_helper'\n+\n+class ImageMailerTest < ActionMailer::TestCase\n+  test 'send email to share an image' do\n+    image = Image.create!(link: 'http://google.com/a.jpeg', tag_list: 'tag1,tag2')\n+    optional_message = 'This is a message'\n+    email = ImageMailer.image_email(image, 'friend@example.com', optional_message)\n+\n+    assert_emails 1 do\n+      email.deliver_now!\n+    end\n+\n+    assert_equal ['sharing@imagesharer.com'], email.from\n+    assert_equal ['friend@example.com'], email.to\n+    assert_equal 'Checkout this image', email.subject\n+\n+    [:text_part, :html_part].each do |part|\n+      email_body = email.send(part).body.to_s\n+      assert email_body.include?(image.link), 'Email body does not contain image link'\n+      assert email_body.include?(optional_message), 'Email body does not contain optional message'","path":"test/mailers/image_mailer_test.rb","position":20,"original_position":20,"commit_id":"b027f7d53365292a860439caf225998b4e369ac8","original_commit_id":"0ffbf6c0ca4beb48b6ad0aefb5116eb6718ffabf","user":{"login":"rmacklin","id":1863540,"avatar_url":"https://avatars.githubusercontent.com/u/1863540?v=3","gravatar_id":"","url":"https://api.github.com/users/rmacklin","html_url":"https://github.com/rmacklin","followers_url":"https://api.github.com/users/rmacklin/followers","following_url":"https://api.github.com/users/rmacklin/following{/other_user}","gists_url":"https://api.github.com/users/rmacklin/gists{/gist_id}","starred_url":"https://api.github.com/users/rmacklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmacklin/subscriptions","organizations_url":"https://api.github.com/users/rmacklin/orgs","repos_url":"https://api.github.com/users/rmacklin/repos","events_url":"https://api.github.com/users/rmacklin/events{/privacy}","received_events_url":"https://api.github.com/users/rmacklin/received_events","type":"User","site_admin":false},"body":"We should also assert that the link to our application is included","created_at":"2016-08-30T16:01:15Z","updated_at":"2016-08-30T16:01:15Z","html_url":"https://github.com/AppFolioOnboarding/image-sharer-lsq921224/pull/43#discussion_r76825573","pull_request_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/pulls/43","_links":{"self":{"href":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/pulls/comments/76825573"},"html":{"href":"https://github.com/AppFolioOnboarding/image-sharer-lsq921224/pull/43#discussion_r76825573"},"pull_request":{"href":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/pulls/43","id":83143998,"html_url":"https://github.com/AppFolioOnboarding/image-sharer-lsq921224/pull/43","diff_url":"https://github.com/AppFolioOnboarding/image-sharer-lsq921224/pull/43.diff","patch_url":"https://github.com/AppFolioOnboarding/image-sharer-lsq921224/pull/43.patch","issue_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/issues/43","number":43,"state":"open","locked":false,"title":"Share image part1","user":{"login":"lsq921224","id":2294091,"avatar_url":"https://avatars.githubusercontent.com/u/2294091?v=3","gravatar_id":"","url":"https://api.github.com/users/lsq921224","html_url":"https://github.com/lsq921224","followers_url":"https://api.github.com/users/lsq921224/followers","following_url":"https://api.github.com/users/lsq921224/following{/other_user}","gists_url":"https://api.github.com/users/lsq921224/gists{/gist_id}","starred_url":"https://api.github.com/users/lsq921224/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsq921224/subscriptions","organizations_url":"https://api.github.com/users/lsq921224/orgs","repos_url":"https://api.github.com/users/lsq921224/repos","events_url":"https://api.github.com/users/lsq921224/events{/privacy}","received_events_url":"https://api.github.com/users/lsq921224/received_events","type":"User","site_admin":false},"body":"Part 1 of #10","created_at":"2016-08-29T18:26:23Z","updated_at":"2016-08-30T16:01:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65bd477d0269930587bc07dd690ec432cdd243fc","assignee":{"login":"rmacklin","id":1863540,"avatar_url":"https://avatars.githubusercontent.com/u/1863540?v=3","gravatar_id":"","url":"https://api.github.com/users/rmacklin","html_url":"https://github.com/rmacklin","followers_url":"https://api.github.com/users/rmacklin/followers","following_url":"https://api.github.com/users/rmacklin/following{/other_user}","gists_url":"https://api.github.com/users/rmacklin/gists{/gist_id}","starred_url":"https://api.github.com/users/rmacklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmacklin/subscriptions","organizations_url":"https://api.github.com/users/rmacklin/orgs","repos_url":"https://api.github.com/users/rmacklin/repos","events_url":"https://api.github.com/users/rmacklin/events{/privacy}","received_events_url":"https://api.github.com/users/rmacklin/received_events","type":"User","site_admin":false},"assignees":[{"login":"rmacklin","id":1863540,"avatar_url":"https://avatars.githubusercontent.com/u/1863540?v=3","gravatar_id":"","url":"https://api.github.com/users/rmacklin","html_url":"https://github.com/rmacklin","followers_url":"https://api.github.com/users/rmacklin/followers","following_url":"https://api.github.com/users/rmacklin/following{/other_user}","gists_url":"https://api.github.com/users/rmacklin/gists{/gist_id}","starred_url":"https://api.github.com/users/rmacklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmacklin/subscriptions","organizations_url":"https://api.github.com/users/rmacklin/orgs","repos_url":"https://api.github.com/users/rmacklin/repos","events_url":"https://api.github.com/users/rmacklin/events{/privacy}","received_events_url":"https://api.github.com/users/rmacklin/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/pulls/43/commits","review_comments_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/pulls/43/comments","review_comment_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/issues/43/comments","statuses_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/statuses/b027f7d53365292a860439caf225998b4e369ac8","head":{"label":"AppFolioOnboarding:share_image_part1","ref":"share_image_part1","sha":"b027f7d53365292a860439caf225998b4e369ac8","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":63720294,"name":"image-sharer-lsq921224","full_name":"AppFolioOnboarding/image-sharer-lsq921224","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/image-sharer-lsq921224","description":"image-sharer-lsq921224 created by GitHub Classroom","fork":false,"url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224","forks_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/forks","keys_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/teams","hooks_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/hooks","issue_events_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/issues/events{/number}","events_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/events","assignees_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/assignees{/user}","branches_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/branches{/branch}","tags_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/tags","blobs_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/git/refs{/sha}","trees_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/statuses/{sha}","languages_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/languages","stargazers_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/stargazers","contributors_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/contributors","subscribers_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/subscribers","subscription_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/subscription","commits_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/commits{/sha}","git_commits_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/git/commits{/sha}","comments_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/comments{/number}","issue_comment_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/issues/comments{/number}","contents_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/contents/{+path}","compare_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/merges","archive_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/downloads","issues_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/issues{/number}","pulls_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/pulls{/number}","milestones_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/milestones{/number}","notifications_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/labels{/name}","releases_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/releases{/id}","deployments_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/deployments","created_at":"2016-07-19T18:59:02Z","updated_at":"2016-07-19T18:59:35Z","pushed_at":"2016-08-29T23:22:08Z","git_url":"git://github.com/AppFolioOnboarding/image-sharer-lsq921224.git","ssh_url":"git@github.com:AppFolioOnboarding/image-sharer-lsq921224.git","clone_url":"https://github.com/AppFolioOnboarding/image-sharer-lsq921224.git","svn_url":"https://github.com/AppFolioOnboarding/image-sharer-lsq921224","homepage":null,"size":139,"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":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"AppFolioOnboarding:master","ref":"master","sha":"f09d9ebc82391084d715b6077b9b378b19cacf41","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":63720294,"name":"image-sharer-lsq921224","full_name":"AppFolioOnboarding/image-sharer-lsq921224","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/image-sharer-lsq921224","description":"image-sharer-lsq921224 created by GitHub Classroom","fork":false,"url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224","forks_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/forks","keys_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/teams","hooks_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/hooks","issue_events_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/issues/events{/number}","events_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/events","assignees_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/assignees{/user}","branches_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/branches{/branch}","tags_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/tags","blobs_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/git/refs{/sha}","trees_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/statuses/{sha}","languages_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/languages","stargazers_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/stargazers","contributors_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/contributors","subscribers_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/subscribers","subscription_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/subscription","commits_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/commits{/sha}","git_commits_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/git/commits{/sha}","comments_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/comments{/number}","issue_comment_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/issues/comments{/number}","contents_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/contents/{+path}","compare_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/merges","archive_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/downloads","issues_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/issues{/number}","pulls_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/pulls{/number}","milestones_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/milestones{/number}","notifications_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/labels{/name}","releases_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/releases{/id}","deployments_url":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/deployments","created_at":"2016-07-19T18:59:02Z","updated_at":"2016-07-19T18:59:35Z","pushed_at":"2016-08-29T23:22:08Z","git_url":"git://github.com/AppFolioOnboarding/image-sharer-lsq921224.git","ssh_url":"git@github.com:AppFolioOnboarding/image-sharer-lsq921224.git","clone_url":"https://github.com/AppFolioOnboarding/image-sharer-lsq921224.git","svn_url":"https://github.com/AppFolioOnboarding/image-sharer-lsq921224","homepage":null,"size":139,"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":7,"forks":0,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/pulls/43"},"html":{"href":"https://github.com/AppFolioOnboarding/image-sharer-lsq921224/pull/43"},"issue":{"href":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/issues/43"},"comments":{"href":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/AppFolioOnboarding/image-sharer-lsq921224/statuses/b027f7d53365292a860439caf225998b4e369ac8"}}}}
{"actor":{"display_login":"rmacklin"}}