{"action":"created","comment":{"url":"https://api.github.com/repos/calonso/rails-push-notifications/pulls/comments/30836432","id":30836432,"diff_hunk":"@@ -0,0 +1,89 @@\n+\n+module RailsPushNotifications\n+  describe APNSApp, type: :model do\n+    it 'creates an instance given valid attributes' do\n+      APNSApp.create! attributes_for :apns_app\n+    end\n+\n+    describe 'validations' do\n+\n+      let(:app) { build :apns_app }\n+\n+      it 'requires an apns dev cert' do\n+        app.apns_dev_cert = nil\n+        expect(app).to_not be_valid\n+      end\n+\n+      it 'requires an apns prod cert' do\n+        app.apns_prod_cert = nil\n+        expect(app).to_not be_valid\n+      end\n+\n+      describe 'sandbox mode' do\n+        it 'automatically sets sandbox mode if missing' do\n+          app.sandbox_mode = nil\n+          expect do\n+            app.valid?\n+          end.to change { app.sandbox_mode }.from(nil).to true\n+        end\n+\n+        it 'uses the value if given' do\n+          app.sandbox_mode = false\n+          expect do\n+            app.valid?\n+          end.to_not change { app.sandbox_mode }.from false\n+        end\n+      end\n+    end\n+\n+    describe 'notifications relationship' do\n+\n+      let(:app) { create :apns_app }\n+\n+      it 'can create new notifications' do\n+        expect do\n+          app.notifications.create attributes_for :apns_notification\n+        end.to change { app.reload.notifications.count }.from(0).to 1\n+      end\n+    end\n+\n+    describe '#push_notifications' do\n+\n+      let(:app) { create :apns_app }\n+      let(:notifications) {","path":"spec/apps/apns_app_spec.rb","position":53,"original_position":53,"commit_id":"bce14bd22eea871e1812449409d3df9395f0d963","original_commit_id":"bce14bd22eea871e1812449409d3df9395f0d963","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Avoid using {...} for multi-line blocks.","created_at":"2015-05-21T19:10:57Z","updated_at":"2015-05-21T19:10:57Z","html_url":"https://github.com/calonso/rails-push-notifications/pull/4#discussion_r30836432","pull_request_url":"https://api.github.com/repos/calonso/rails-push-notifications/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/calonso/rails-push-notifications/pulls/comments/30836432"},"html":{"href":"https://github.com/calonso/rails-push-notifications/pull/4#discussion_r30836432"},"pull_request":{"href":"https://api.github.com/repos/calonso/rails-push-notifications/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/calonso/rails-push-notifications/pulls/4","id":32880240,"html_url":"https://github.com/calonso/rails-push-notifications/pull/4","diff_url":"https://github.com/calonso/rails-push-notifications/pull/4.diff","patch_url":"https://github.com/calonso/rails-push-notifications/pull/4.patch","issue_url":"https://api.github.com/repos/calonso/rails-push-notifications/issues/4","number":4,"state":"open","locked":false,"title":"Full rearchitect","user":{"login":"calonso","id":2392041,"avatar_url":"https://avatars.githubusercontent.com/u/2392041?v=3","gravatar_id":"","url":"https://api.github.com/users/calonso","html_url":"https://github.com/calonso","followers_url":"https://api.github.com/users/calonso/followers","following_url":"https://api.github.com/users/calonso/following{/other_user}","gists_url":"https://api.github.com/users/calonso/gists{/gist_id}","starred_url":"https://api.github.com/users/calonso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calonso/subscriptions","organizations_url":"https://api.github.com/users/calonso/orgs","repos_url":"https://api.github.com/users/calonso/repos","events_url":"https://api.github.com/users/calonso/events{/privacy}","received_events_url":"https://api.github.com/users/calonso/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-08T16:56:44Z","updated_at":"2015-05-21T19:10:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8caaca71100764acffa40266d8a179138227a5ed","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/calonso/rails-push-notifications/pulls/4/commits","review_comments_url":"https://api.github.com/repos/calonso/rails-push-notifications/pulls/4/comments","review_comment_url":"https://api.github.com/repos/calonso/rails-push-notifications/pulls/comments{/number}","comments_url":"https://api.github.com/repos/calonso/rails-push-notifications/issues/4/comments","statuses_url":"https://api.github.com/repos/calonso/rails-push-notifications/statuses/bce14bd22eea871e1812449409d3df9395f0d963","head":{"label":"calonso:full_rearchitect","ref":"full_rearchitect","sha":"bce14bd22eea871e1812449409d3df9395f0d963","user":{"login":"calonso","id":2392041,"avatar_url":"https://avatars.githubusercontent.com/u/2392041?v=3","gravatar_id":"","url":"https://api.github.com/users/calonso","html_url":"https://github.com/calonso","followers_url":"https://api.github.com/users/calonso/followers","following_url":"https://api.github.com/users/calonso/following{/other_user}","gists_url":"https://api.github.com/users/calonso/gists{/gist_id}","starred_url":"https://api.github.com/users/calonso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calonso/subscriptions","organizations_url":"https://api.github.com/users/calonso/orgs","repos_url":"https://api.github.com/users/calonso/repos","events_url":"https://api.github.com/users/calonso/events{/privacy}","received_events_url":"https://api.github.com/users/calonso/received_events","type":"User","site_admin":false},"repo":{"id":12265922,"name":"rails-push-notifications","full_name":"calonso/rails-push-notifications","owner":{"login":"calonso","id":2392041,"avatar_url":"https://avatars.githubusercontent.com/u/2392041?v=3","gravatar_id":"","url":"https://api.github.com/users/calonso","html_url":"https://github.com/calonso","followers_url":"https://api.github.com/users/calonso/followers","following_url":"https://api.github.com/users/calonso/following{/other_user}","gists_url":"https://api.github.com/users/calonso/gists{/gist_id}","starred_url":"https://api.github.com/users/calonso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calonso/subscriptions","organizations_url":"https://api.github.com/users/calonso/orgs","repos_url":"https://api.github.com/users/calonso/repos","events_url":"https://api.github.com/users/calonso/events{/privacy}","received_events_url":"https://api.github.com/users/calonso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/calonso/rails-push-notifications","description":"Professional Ruby on Rails Apple and Android Push Notifications","fork":false,"url":"https://api.github.com/repos/calonso/rails-push-notifications","forks_url":"https://api.github.com/repos/calonso/rails-push-notifications/forks","keys_url":"https://api.github.com/repos/calonso/rails-push-notifications/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calonso/rails-push-notifications/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calonso/rails-push-notifications/teams","hooks_url":"https://api.github.com/repos/calonso/rails-push-notifications/hooks","issue_events_url":"https://api.github.com/repos/calonso/rails-push-notifications/issues/events{/number}","events_url":"https://api.github.com/repos/calonso/rails-push-notifications/events","assignees_url":"https://api.github.com/repos/calonso/rails-push-notifications/assignees{/user}","branches_url":"https://api.github.com/repos/calonso/rails-push-notifications/branches{/branch}","tags_url":"https://api.github.com/repos/calonso/rails-push-notifications/tags","blobs_url":"https://api.github.com/repos/calonso/rails-push-notifications/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calonso/rails-push-notifications/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calonso/rails-push-notifications/git/refs{/sha}","trees_url":"https://api.github.com/repos/calonso/rails-push-notifications/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calonso/rails-push-notifications/statuses/{sha}","languages_url":"https://api.github.com/repos/calonso/rails-push-notifications/languages","stargazers_url":"https://api.github.com/repos/calonso/rails-push-notifications/stargazers","contributors_url":"https://api.github.com/repos/calonso/rails-push-notifications/contributors","subscribers_url":"https://api.github.com/repos/calonso/rails-push-notifications/subscribers","subscription_url":"https://api.github.com/repos/calonso/rails-push-notifications/subscription","commits_url":"https://api.github.com/repos/calonso/rails-push-notifications/commits{/sha}","git_commits_url":"https://api.github.com/repos/calonso/rails-push-notifications/git/commits{/sha}","comments_url":"https://api.github.com/repos/calonso/rails-push-notifications/comments{/number}","issue_comment_url":"https://api.github.com/repos/calonso/rails-push-notifications/issues/comments{/number}","contents_url":"https://api.github.com/repos/calonso/rails-push-notifications/contents/{+path}","compare_url":"https://api.github.com/repos/calonso/rails-push-notifications/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calonso/rails-push-notifications/merges","archive_url":"https://api.github.com/repos/calonso/rails-push-notifications/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calonso/rails-push-notifications/downloads","issues_url":"https://api.github.com/repos/calonso/rails-push-notifications/issues{/number}","pulls_url":"https://api.github.com/repos/calonso/rails-push-notifications/pulls{/number}","milestones_url":"https://api.github.com/repos/calonso/rails-push-notifications/milestones{/number}","notifications_url":"https://api.github.com/repos/calonso/rails-push-notifications/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calonso/rails-push-notifications/labels{/name}","releases_url":"https://api.github.com/repos/calonso/rails-push-notifications/releases{/id}","created_at":"2013-08-21T09:06:20Z","updated_at":"2015-04-07T15:32:25Z","pushed_at":"2015-05-21T19:10:48Z","git_url":"git://github.com/calonso/rails-push-notifications.git","ssh_url":"git@github.com:calonso/rails-push-notifications.git","clone_url":"https://github.com/calonso/rails-push-notifications.git","svn_url":"https://github.com/calonso/rails-push-notifications","homepage":"http://mrcalonso.com/rails-push-notifications-gem/","size":382,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":4,"default_branch":"master"}},"base":{"label":"calonso:master","ref":"master","sha":"357a919d7f05e342d9ccd3acc1a18cc7c419fcb8","user":{"login":"calonso","id":2392041,"avatar_url":"https://avatars.githubusercontent.com/u/2392041?v=3","gravatar_id":"","url":"https://api.github.com/users/calonso","html_url":"https://github.com/calonso","followers_url":"https://api.github.com/users/calonso/followers","following_url":"https://api.github.com/users/calonso/following{/other_user}","gists_url":"https://api.github.com/users/calonso/gists{/gist_id}","starred_url":"https://api.github.com/users/calonso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calonso/subscriptions","organizations_url":"https://api.github.com/users/calonso/orgs","repos_url":"https://api.github.com/users/calonso/repos","events_url":"https://api.github.com/users/calonso/events{/privacy}","received_events_url":"https://api.github.com/users/calonso/received_events","type":"User","site_admin":false},"repo":{"id":12265922,"name":"rails-push-notifications","full_name":"calonso/rails-push-notifications","owner":{"login":"calonso","id":2392041,"avatar_url":"https://avatars.githubusercontent.com/u/2392041?v=3","gravatar_id":"","url":"https://api.github.com/users/calonso","html_url":"https://github.com/calonso","followers_url":"https://api.github.com/users/calonso/followers","following_url":"https://api.github.com/users/calonso/following{/other_user}","gists_url":"https://api.github.com/users/calonso/gists{/gist_id}","starred_url":"https://api.github.com/users/calonso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calonso/subscriptions","organizations_url":"https://api.github.com/users/calonso/orgs","repos_url":"https://api.github.com/users/calonso/repos","events_url":"https://api.github.com/users/calonso/events{/privacy}","received_events_url":"https://api.github.com/users/calonso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/calonso/rails-push-notifications","description":"Professional Ruby on Rails Apple and Android Push Notifications","fork":false,"url":"https://api.github.com/repos/calonso/rails-push-notifications","forks_url":"https://api.github.com/repos/calonso/rails-push-notifications/forks","keys_url":"https://api.github.com/repos/calonso/rails-push-notifications/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calonso/rails-push-notifications/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calonso/rails-push-notifications/teams","hooks_url":"https://api.github.com/repos/calonso/rails-push-notifications/hooks","issue_events_url":"https://api.github.com/repos/calonso/rails-push-notifications/issues/events{/number}","events_url":"https://api.github.com/repos/calonso/rails-push-notifications/events","assignees_url":"https://api.github.com/repos/calonso/rails-push-notifications/assignees{/user}","branches_url":"https://api.github.com/repos/calonso/rails-push-notifications/branches{/branch}","tags_url":"https://api.github.com/repos/calonso/rails-push-notifications/tags","blobs_url":"https://api.github.com/repos/calonso/rails-push-notifications/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calonso/rails-push-notifications/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calonso/rails-push-notifications/git/refs{/sha}","trees_url":"https://api.github.com/repos/calonso/rails-push-notifications/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calonso/rails-push-notifications/statuses/{sha}","languages_url":"https://api.github.com/repos/calonso/rails-push-notifications/languages","stargazers_url":"https://api.github.com/repos/calonso/rails-push-notifications/stargazers","contributors_url":"https://api.github.com/repos/calonso/rails-push-notifications/contributors","subscribers_url":"https://api.github.com/repos/calonso/rails-push-notifications/subscribers","subscription_url":"https://api.github.com/repos/calonso/rails-push-notifications/subscription","commits_url":"https://api.github.com/repos/calonso/rails-push-notifications/commits{/sha}","git_commits_url":"https://api.github.com/repos/calonso/rails-push-notifications/git/commits{/sha}","comments_url":"https://api.github.com/repos/calonso/rails-push-notifications/comments{/number}","issue_comment_url":"https://api.github.com/repos/calonso/rails-push-notifications/issues/comments{/number}","contents_url":"https://api.github.com/repos/calonso/rails-push-notifications/contents/{+path}","compare_url":"https://api.github.com/repos/calonso/rails-push-notifications/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calonso/rails-push-notifications/merges","archive_url":"https://api.github.com/repos/calonso/rails-push-notifications/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calonso/rails-push-notifications/downloads","issues_url":"https://api.github.com/repos/calonso/rails-push-notifications/issues{/number}","pulls_url":"https://api.github.com/repos/calonso/rails-push-notifications/pulls{/number}","milestones_url":"https://api.github.com/repos/calonso/rails-push-notifications/milestones{/number}","notifications_url":"https://api.github.com/repos/calonso/rails-push-notifications/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calonso/rails-push-notifications/labels{/name}","releases_url":"https://api.github.com/repos/calonso/rails-push-notifications/releases{/id}","created_at":"2013-08-21T09:06:20Z","updated_at":"2015-04-07T15:32:25Z","pushed_at":"2015-05-21T19:10:48Z","git_url":"git://github.com/calonso/rails-push-notifications.git","ssh_url":"git@github.com:calonso/rails-push-notifications.git","clone_url":"https://github.com/calonso/rails-push-notifications.git","svn_url":"https://github.com/calonso/rails-push-notifications","homepage":"http://mrcalonso.com/rails-push-notifications-gem/","size":382,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/calonso/rails-push-notifications/pulls/4"},"html":{"href":"https://github.com/calonso/rails-push-notifications/pull/4"},"issue":{"href":"https://api.github.com/repos/calonso/rails-push-notifications/issues/4"},"comments":{"href":"https://api.github.com/repos/calonso/rails-push-notifications/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/calonso/rails-push-notifications/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/calonso/rails-push-notifications/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/calonso/rails-push-notifications/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/calonso/rails-push-notifications/statuses/bce14bd22eea871e1812449409d3df9395f0d963"}}}}