{"action":"created","comment":{"url":"https://api.github.com/repos/ilabsea/zero-reporting/pulls/comments/75631461","id":75631461,"diff_hunk":"@@ -0,0 +1,60 @@\n+require 'rails_helper'\n+\n+RSpec.describe Contexts::AlertContext, type: :model do\n+  include ActiveJob::TestHelper\n+\n+  describe '#process' do\n+    context 'external service alert' do\n+      let(:setting) { create(:external_sms_setting, is_enable: true, message_template: '{{caller_phone}} has left voice message on call log {{call_log_id}}', recipients: ['85512345678', '8551012345678']) }\n+      let(:alert) { Alert::ExternalServiceAlert.new(setting, '1000', '1') }\n+\n+      let(:context) { Contexts::AlertContext.new(alert) }\n+\n+      it 'enqueue an alert job to queue' do\n+        context.process\n+\n+        expect(enqueued_jobs.size).to eq(1)\n+\n+        expect(enqueued_jobs.first[:job]).to eq(SmsQueueJob)\n+        expect(enqueued_jobs.first[:args].first).to eq({:receivers=>['85512345678', '8551012345678'], :body=>'1000 has left voice message on call log 1', :type=>nil})\n+      end\n+    end\n+\n+    context 'report case alert' do\n+      let(:hc) { create(:hc) }\n+      let(:user) { create(:user, phone: '1000', place: hc) }\n+      let(:report) { create(:report, user: user) }\n+      let(:week) { Calendar::Year.new(2016).week(1) }\n+      let!(:setting) { create(:alert_setting, is_enable_sms_alert: true, message_template: 'This is the alert on {{week_year}} for {{reported_cases}}', verboice_project_id: 24, recipient_type: ['OD', 'HC']) }","path":"spec/models/contexts/alert_context_spec.rb","position":28,"original_position":28,"commit_id":"4bd913f1f81eeb03149139508b339b98ba4dbf0c","original_commit_id":"4bd913f1f81eeb03149139508b339b98ba4dbf0c","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. [208/80]<br>Use `%w` or `%W` for an array of words.","created_at":"2016-08-22T07:54:34Z","updated_at":"2016-08-22T07:54:34Z","html_url":"https://github.com/ilabsea/zero-reporting/pull/31#discussion_r75631461","pull_request_url":"https://api.github.com/repos/ilabsea/zero-reporting/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/ilabsea/zero-reporting/pulls/comments/75631461"},"html":{"href":"https://github.com/ilabsea/zero-reporting/pull/31#discussion_r75631461"},"pull_request":{"href":"https://api.github.com/repos/ilabsea/zero-reporting/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/ilabsea/zero-reporting/pulls/31","id":82147571,"html_url":"https://github.com/ilabsea/zero-reporting/pull/31","diff_url":"https://github.com/ilabsea/zero-reporting/pull/31.diff","patch_url":"https://github.com/ilabsea/zero-reporting/pull/31.patch","issue_url":"https://api.github.com/repos/ilabsea/zero-reporting/issues/31","number":31,"state":"open","locked":false,"title":"Missing report x week","user":{"login":"kakada","id":745429,"avatar_url":"https://avatars.githubusercontent.com/u/745429?v=3","gravatar_id":"","url":"https://api.github.com/users/kakada","html_url":"https://github.com/kakada","followers_url":"https://api.github.com/users/kakada/followers","following_url":"https://api.github.com/users/kakada/following{/other_user}","gists_url":"https://api.github.com/users/kakada/gists{/gist_id}","starred_url":"https://api.github.com/users/kakada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kakada/subscriptions","organizations_url":"https://api.github.com/users/kakada/orgs","repos_url":"https://api.github.com/users/kakada/repos","events_url":"https://api.github.com/users/kakada/events{/privacy}","received_events_url":"https://api.github.com/users/kakada/received_events","type":"User","site_admin":false},"body":"Fixes #26 ","created_at":"2016-08-22T07:54:23Z","updated_at":"2016-08-22T07:54:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ed71f2e7450482724645c1d1eef3521abc95aeb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ilabsea/zero-reporting/pulls/31/commits","review_comments_url":"https://api.github.com/repos/ilabsea/zero-reporting/pulls/31/comments","review_comment_url":"https://api.github.com/repos/ilabsea/zero-reporting/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ilabsea/zero-reporting/issues/31/comments","statuses_url":"https://api.github.com/repos/ilabsea/zero-reporting/statuses/4bd913f1f81eeb03149139508b339b98ba4dbf0c","head":{"label":"ilabsea:missing-report-x-week","ref":"missing-report-x-week","sha":"4bd913f1f81eeb03149139508b339b98ba4dbf0c","user":{"login":"ilabsea","id":7487090,"avatar_url":"https://avatars.githubusercontent.com/u/7487090?v=3","gravatar_id":"","url":"https://api.github.com/users/ilabsea","html_url":"https://github.com/ilabsea","followers_url":"https://api.github.com/users/ilabsea/followers","following_url":"https://api.github.com/users/ilabsea/following{/other_user}","gists_url":"https://api.github.com/users/ilabsea/gists{/gist_id}","starred_url":"https://api.github.com/users/ilabsea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilabsea/subscriptions","organizations_url":"https://api.github.com/users/ilabsea/orgs","repos_url":"https://api.github.com/users/ilabsea/repos","events_url":"https://api.github.com/users/ilabsea/events{/privacy}","received_events_url":"https://api.github.com/users/ilabsea/received_events","type":"Organization","site_admin":false},"repo":{"id":34446156,"name":"zero-reporting","full_name":"ilabsea/zero-reporting","owner":{"login":"ilabsea","id":7487090,"avatar_url":"https://avatars.githubusercontent.com/u/7487090?v=3","gravatar_id":"","url":"https://api.github.com/users/ilabsea","html_url":"https://github.com/ilabsea","followers_url":"https://api.github.com/users/ilabsea/followers","following_url":"https://api.github.com/users/ilabsea/following{/other_user}","gists_url":"https://api.github.com/users/ilabsea/gists{/gist_id}","starred_url":"https://api.github.com/users/ilabsea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilabsea/subscriptions","organizations_url":"https://api.github.com/users/ilabsea/orgs","repos_url":"https://api.github.com/users/ilabsea/repos","events_url":"https://api.github.com/users/ilabsea/events{/privacy}","received_events_url":"https://api.github.com/users/ilabsea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ilabsea/zero-reporting","description":"","fork":false,"url":"https://api.github.com/repos/ilabsea/zero-reporting","forks_url":"https://api.github.com/repos/ilabsea/zero-reporting/forks","keys_url":"https://api.github.com/repos/ilabsea/zero-reporting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ilabsea/zero-reporting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ilabsea/zero-reporting/teams","hooks_url":"https://api.github.com/repos/ilabsea/zero-reporting/hooks","issue_events_url":"https://api.github.com/repos/ilabsea/zero-reporting/issues/events{/number}","events_url":"https://api.github.com/repos/ilabsea/zero-reporting/events","assignees_url":"https://api.github.com/repos/ilabsea/zero-reporting/assignees{/user}","branches_url":"https://api.github.com/repos/ilabsea/zero-reporting/branches{/branch}","tags_url":"https://api.github.com/repos/ilabsea/zero-reporting/tags","blobs_url":"https://api.github.com/repos/ilabsea/zero-reporting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ilabsea/zero-reporting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ilabsea/zero-reporting/git/refs{/sha}","trees_url":"https://api.github.com/repos/ilabsea/zero-reporting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ilabsea/zero-reporting/statuses/{sha}","languages_url":"https://api.github.com/repos/ilabsea/zero-reporting/languages","stargazers_url":"https://api.github.com/repos/ilabsea/zero-reporting/stargazers","contributors_url":"https://api.github.com/repos/ilabsea/zero-reporting/contributors","subscribers_url":"https://api.github.com/repos/ilabsea/zero-reporting/subscribers","subscription_url":"https://api.github.com/repos/ilabsea/zero-reporting/subscription","commits_url":"https://api.github.com/repos/ilabsea/zero-reporting/commits{/sha}","git_commits_url":"https://api.github.com/repos/ilabsea/zero-reporting/git/commits{/sha}","comments_url":"https://api.github.com/repos/ilabsea/zero-reporting/comments{/number}","issue_comment_url":"https://api.github.com/repos/ilabsea/zero-reporting/issues/comments{/number}","contents_url":"https://api.github.com/repos/ilabsea/zero-reporting/contents/{+path}","compare_url":"https://api.github.com/repos/ilabsea/zero-reporting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ilabsea/zero-reporting/merges","archive_url":"https://api.github.com/repos/ilabsea/zero-reporting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ilabsea/zero-reporting/downloads","issues_url":"https://api.github.com/repos/ilabsea/zero-reporting/issues{/number}","pulls_url":"https://api.github.com/repos/ilabsea/zero-reporting/pulls{/number}","milestones_url":"https://api.github.com/repos/ilabsea/zero-reporting/milestones{/number}","notifications_url":"https://api.github.com/repos/ilabsea/zero-reporting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ilabsea/zero-reporting/labels{/name}","releases_url":"https://api.github.com/repos/ilabsea/zero-reporting/releases{/id}","deployments_url":"https://api.github.com/repos/ilabsea/zero-reporting/deployments","created_at":"2015-04-23T09:13:11Z","updated_at":"2016-06-21T03:47:41Z","pushed_at":"2016-08-22T07:54:23Z","git_url":"git://github.com/ilabsea/zero-reporting.git","ssh_url":"git@github.com:ilabsea/zero-reporting.git","clone_url":"https://github.com/ilabsea/zero-reporting.git","svn_url":"https://github.com/ilabsea/zero-reporting","homepage":null,"size":3111,"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":"develop"}},"base":{"label":"ilabsea:develop","ref":"develop","sha":"0aa42fc0c4589b4b58c78085f02beda892c08a57","user":{"login":"ilabsea","id":7487090,"avatar_url":"https://avatars.githubusercontent.com/u/7487090?v=3","gravatar_id":"","url":"https://api.github.com/users/ilabsea","html_url":"https://github.com/ilabsea","followers_url":"https://api.github.com/users/ilabsea/followers","following_url":"https://api.github.com/users/ilabsea/following{/other_user}","gists_url":"https://api.github.com/users/ilabsea/gists{/gist_id}","starred_url":"https://api.github.com/users/ilabsea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilabsea/subscriptions","organizations_url":"https://api.github.com/users/ilabsea/orgs","repos_url":"https://api.github.com/users/ilabsea/repos","events_url":"https://api.github.com/users/ilabsea/events{/privacy}","received_events_url":"https://api.github.com/users/ilabsea/received_events","type":"Organization","site_admin":false},"repo":{"id":34446156,"name":"zero-reporting","full_name":"ilabsea/zero-reporting","owner":{"login":"ilabsea","id":7487090,"avatar_url":"https://avatars.githubusercontent.com/u/7487090?v=3","gravatar_id":"","url":"https://api.github.com/users/ilabsea","html_url":"https://github.com/ilabsea","followers_url":"https://api.github.com/users/ilabsea/followers","following_url":"https://api.github.com/users/ilabsea/following{/other_user}","gists_url":"https://api.github.com/users/ilabsea/gists{/gist_id}","starred_url":"https://api.github.com/users/ilabsea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilabsea/subscriptions","organizations_url":"https://api.github.com/users/ilabsea/orgs","repos_url":"https://api.github.com/users/ilabsea/repos","events_url":"https://api.github.com/users/ilabsea/events{/privacy}","received_events_url":"https://api.github.com/users/ilabsea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ilabsea/zero-reporting","description":"","fork":false,"url":"https://api.github.com/repos/ilabsea/zero-reporting","forks_url":"https://api.github.com/repos/ilabsea/zero-reporting/forks","keys_url":"https://api.github.com/repos/ilabsea/zero-reporting/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ilabsea/zero-reporting/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ilabsea/zero-reporting/teams","hooks_url":"https://api.github.com/repos/ilabsea/zero-reporting/hooks","issue_events_url":"https://api.github.com/repos/ilabsea/zero-reporting/issues/events{/number}","events_url":"https://api.github.com/repos/ilabsea/zero-reporting/events","assignees_url":"https://api.github.com/repos/ilabsea/zero-reporting/assignees{/user}","branches_url":"https://api.github.com/repos/ilabsea/zero-reporting/branches{/branch}","tags_url":"https://api.github.com/repos/ilabsea/zero-reporting/tags","blobs_url":"https://api.github.com/repos/ilabsea/zero-reporting/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ilabsea/zero-reporting/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ilabsea/zero-reporting/git/refs{/sha}","trees_url":"https://api.github.com/repos/ilabsea/zero-reporting/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ilabsea/zero-reporting/statuses/{sha}","languages_url":"https://api.github.com/repos/ilabsea/zero-reporting/languages","stargazers_url":"https://api.github.com/repos/ilabsea/zero-reporting/stargazers","contributors_url":"https://api.github.com/repos/ilabsea/zero-reporting/contributors","subscribers_url":"https://api.github.com/repos/ilabsea/zero-reporting/subscribers","subscription_url":"https://api.github.com/repos/ilabsea/zero-reporting/subscription","commits_url":"https://api.github.com/repos/ilabsea/zero-reporting/commits{/sha}","git_commits_url":"https://api.github.com/repos/ilabsea/zero-reporting/git/commits{/sha}","comments_url":"https://api.github.com/repos/ilabsea/zero-reporting/comments{/number}","issue_comment_url":"https://api.github.com/repos/ilabsea/zero-reporting/issues/comments{/number}","contents_url":"https://api.github.com/repos/ilabsea/zero-reporting/contents/{+path}","compare_url":"https://api.github.com/repos/ilabsea/zero-reporting/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ilabsea/zero-reporting/merges","archive_url":"https://api.github.com/repos/ilabsea/zero-reporting/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ilabsea/zero-reporting/downloads","issues_url":"https://api.github.com/repos/ilabsea/zero-reporting/issues{/number}","pulls_url":"https://api.github.com/repos/ilabsea/zero-reporting/pulls{/number}","milestones_url":"https://api.github.com/repos/ilabsea/zero-reporting/milestones{/number}","notifications_url":"https://api.github.com/repos/ilabsea/zero-reporting/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ilabsea/zero-reporting/labels{/name}","releases_url":"https://api.github.com/repos/ilabsea/zero-reporting/releases{/id}","deployments_url":"https://api.github.com/repos/ilabsea/zero-reporting/deployments","created_at":"2015-04-23T09:13:11Z","updated_at":"2016-06-21T03:47:41Z","pushed_at":"2016-08-22T07:54:23Z","git_url":"git://github.com/ilabsea/zero-reporting.git","ssh_url":"git@github.com:ilabsea/zero-reporting.git","clone_url":"https://github.com/ilabsea/zero-reporting.git","svn_url":"https://github.com/ilabsea/zero-reporting","homepage":null,"size":3111,"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":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ilabsea/zero-reporting/pulls/31"},"html":{"href":"https://github.com/ilabsea/zero-reporting/pull/31"},"issue":{"href":"https://api.github.com/repos/ilabsea/zero-reporting/issues/31"},"comments":{"href":"https://api.github.com/repos/ilabsea/zero-reporting/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/ilabsea/zero-reporting/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/ilabsea/zero-reporting/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ilabsea/zero-reporting/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/ilabsea/zero-reporting/statuses/4bd913f1f81eeb03149139508b339b98ba4dbf0c"}}}}
{"actor":{"display_login":"houndci-bot"}}