{"action":"created","comment":{"url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/pulls/comments/52955459","id":52955459,"diff_hunk":"@@ -0,0 +1,336 @@\n+beforeAll(function () {\n+  VelocityHelpers.exportGlobals();\n+});\n+\n+describe('getoutfitted:reaction-advanced-fulfillment bulkActions methods', function () {\n+  describe('advancedFulfillment/shipSelectedOrders', function () {\n+    beforeEach(function () {\n+      Meteor.users.remove({});\n+      return ReactionCore.Collections.Orders.remove({});\n+    });\n+    it('should update mulitple orders to ordershipped', function () {\n+      let Order = Factory.create('importedShopifyOrder', {\n+        'advancedFulfillment.workflow.status': 'orderReadyToShip'\n+      });\n+      let Order2 = Factory.create('importedShopifyOrder', {\n+        'advancedFulfillment.workflow.status': 'orderReadyToShip'\n+      });\n+      let Order3 = Factory.create('importedShopifyOrder', {\n+        'advancedFulfillment.workflow.status': 'orderReadyToShip'\n+      });\n+      const user = Factory.create('user');\n+      spyOn(ReactionCore.Collections.Orders, 'update').and.callThrough();\n+      spyOn(ReactionCore, 'hasPermission').and.returnValue(true);\n+      spyOn(Meteor, 'userId').and.returnValue(user._id);\n+      let orders = [Order, Order2, Order3];\n+      let allReady = _.every(orders, function (order) {\n+        return order.advancedFulfillment.workflow.status === 'orderReadyToShip';\n+      });\n+      expect(allReady).toBe(true);\n+      let orderIds = [Order._id, Order2._id, Order3._id];\n+      Meteor.call('advancedFulfillment/shipSelectedOrders', orderIds);\n+      expect(ReactionCore.Collections.Orders.update).toHaveBeenCalled();\n+      Order = ReactionCore.Collections.Orders.findOne(Order._id);\n+      expect(Order.advancedFulfillment.workflow.status).toBe('orderShipped');\n+      expect(Order.history.length).toBe(1);\n+      expect(Order.history).toContain(jasmine.objectContaining({event: 'orderShipped'}));\n+      Order3 = ReactionCore.Collections.Orders.findOne(Order3._id);\n+      expect(Order3.advancedFulfillment.workflow.status).toBe('orderShipped');\n+      expect(Order3.history.length).toBe(1);\n+      expect(Order3.history).toContain(jasmine.objectContaining({event: 'orderShipped'}));\n+    });","path":"tests/jasmine/server/integration/methods/bulkActions.js","position":41,"original_position":41,"commit_id":"37c3954f52a046ff9816dd0966e546c50795f10b","original_commit_id":"37c3954f52a046ff9816dd0966e546c50795f10b","user":{"login":"spencern","id":1203639,"avatar_url":"https://avatars.githubusercontent.com/u/1203639?v=3","gravatar_id":"","url":"https://api.github.com/users/spencern","html_url":"https://github.com/spencern","followers_url":"https://api.github.com/users/spencern/followers","following_url":"https://api.github.com/users/spencern/following{/other_user}","gists_url":"https://api.github.com/users/spencern/gists{/gist_id}","starred_url":"https://api.github.com/users/spencern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spencern/subscriptions","organizations_url":"https://api.github.com/users/spencern/orgs","repos_url":"https://api.github.com/users/spencern/repos","events_url":"https://api.github.com/users/spencern/events{/privacy}","received_events_url":"https://api.github.com/users/spencern/received_events","type":"User","site_admin":false},"body":"Nitpicky, but can we add a line break after `it` blocks?","created_at":"2016-02-16T00:05:05Z","updated_at":"2016-02-16T00:05:05Z","html_url":"https://github.com/getoutfitted/reaction-advanced-fulfillment/pull/200#discussion_r52955459","pull_request_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/pulls/200","_links":{"self":{"href":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/pulls/comments/52955459"},"html":{"href":"https://github.com/getoutfitted/reaction-advanced-fulfillment/pull/200#discussion_r52955459"},"pull_request":{"href":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/pulls/200"}}},"pull_request":{"url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/pulls/200","id":59087379,"html_url":"https://github.com/getoutfitted/reaction-advanced-fulfillment/pull/200","diff_url":"https://github.com/getoutfitted/reaction-advanced-fulfillment/pull/200.diff","patch_url":"https://github.com/getoutfitted/reaction-advanced-fulfillment/pull/200.patch","issue_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/issues/200","number":200,"state":"open","locked":false,"title":"Factory update (with tests)","user":{"login":"paulgrever","id":3664281,"avatar_url":"https://avatars.githubusercontent.com/u/3664281?v=3","gravatar_id":"","url":"https://api.github.com/users/paulgrever","html_url":"https://github.com/paulgrever","followers_url":"https://api.github.com/users/paulgrever/followers","following_url":"https://api.github.com/users/paulgrever/following{/other_user}","gists_url":"https://api.github.com/users/paulgrever/gists{/gist_id}","starred_url":"https://api.github.com/users/paulgrever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulgrever/subscriptions","organizations_url":"https://api.github.com/users/paulgrever/orgs","repos_url":"https://api.github.com/users/paulgrever/repos","events_url":"https://api.github.com/users/paulgrever/events{/privacy}","received_events_url":"https://api.github.com/users/paulgrever/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-11T20:17:42Z","updated_at":"2016-02-16T00:05:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5a2b588ac4534d0e02480f6428ddb9b10eeb9d6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/pulls/200/commits","review_comments_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/pulls/200/comments","review_comment_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/pulls/comments{/number}","comments_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/issues/200/comments","statuses_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/statuses/37c3954f52a046ff9816dd0966e546c50795f10b","head":{"label":"getoutfitted:factory-update","ref":"factory-update","sha":"37c3954f52a046ff9816dd0966e546c50795f10b","user":{"login":"getoutfitted","id":11788610,"avatar_url":"https://avatars.githubusercontent.com/u/11788610?v=3","gravatar_id":"","url":"https://api.github.com/users/getoutfitted","html_url":"https://github.com/getoutfitted","followers_url":"https://api.github.com/users/getoutfitted/followers","following_url":"https://api.github.com/users/getoutfitted/following{/other_user}","gists_url":"https://api.github.com/users/getoutfitted/gists{/gist_id}","starred_url":"https://api.github.com/users/getoutfitted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getoutfitted/subscriptions","organizations_url":"https://api.github.com/users/getoutfitted/orgs","repos_url":"https://api.github.com/users/getoutfitted/repos","events_url":"https://api.github.com/users/getoutfitted/events{/privacy}","received_events_url":"https://api.github.com/users/getoutfitted/received_events","type":"Organization","site_admin":false},"repo":{"id":44138567,"name":"reaction-advanced-fulfillment","full_name":"getoutfitted/reaction-advanced-fulfillment","owner":{"login":"getoutfitted","id":11788610,"avatar_url":"https://avatars.githubusercontent.com/u/11788610?v=3","gravatar_id":"","url":"https://api.github.com/users/getoutfitted","html_url":"https://github.com/getoutfitted","followers_url":"https://api.github.com/users/getoutfitted/followers","following_url":"https://api.github.com/users/getoutfitted/following{/other_user}","gists_url":"https://api.github.com/users/getoutfitted/gists{/gist_id}","starred_url":"https://api.github.com/users/getoutfitted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getoutfitted/subscriptions","organizations_url":"https://api.github.com/users/getoutfitted/orgs","repos_url":"https://api.github.com/users/getoutfitted/repos","events_url":"https://api.github.com/users/getoutfitted/events{/privacy}","received_events_url":"https://api.github.com/users/getoutfitted/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getoutfitted/reaction-advanced-fulfillment","description":"Package to help manage the fulfillment cycle of rental products.","fork":false,"url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment","forks_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/forks","keys_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/teams","hooks_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/hooks","issue_events_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/issues/events{/number}","events_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/events","assignees_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/assignees{/user}","branches_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/branches{/branch}","tags_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/tags","blobs_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/git/refs{/sha}","trees_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/statuses/{sha}","languages_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/languages","stargazers_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/stargazers","contributors_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/contributors","subscribers_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/subscribers","subscription_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/subscription","commits_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/commits{/sha}","git_commits_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/git/commits{/sha}","comments_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/comments{/number}","issue_comment_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/issues/comments{/number}","contents_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/contents/{+path}","compare_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/merges","archive_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/downloads","issues_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/issues{/number}","pulls_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/pulls{/number}","milestones_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/milestones{/number}","notifications_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/labels{/name}","releases_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/releases{/id}","deployments_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/deployments","created_at":"2015-10-12T22:53:44Z","updated_at":"2016-01-11T21:57:04Z","pushed_at":"2016-02-15T23:28:58Z","git_url":"git://github.com/getoutfitted/reaction-advanced-fulfillment.git","ssh_url":"git@github.com:getoutfitted/reaction-advanced-fulfillment.git","clone_url":"https://github.com/getoutfitted/reaction-advanced-fulfillment.git","svn_url":"https://github.com/getoutfitted/reaction-advanced-fulfillment","homepage":"","size":497,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":4,"default_branch":"development"}},"base":{"label":"getoutfitted:development","ref":"development","sha":"a8cfeb67d7bc31180a0f3b298e5ce0586d1e8ffc","user":{"login":"getoutfitted","id":11788610,"avatar_url":"https://avatars.githubusercontent.com/u/11788610?v=3","gravatar_id":"","url":"https://api.github.com/users/getoutfitted","html_url":"https://github.com/getoutfitted","followers_url":"https://api.github.com/users/getoutfitted/followers","following_url":"https://api.github.com/users/getoutfitted/following{/other_user}","gists_url":"https://api.github.com/users/getoutfitted/gists{/gist_id}","starred_url":"https://api.github.com/users/getoutfitted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getoutfitted/subscriptions","organizations_url":"https://api.github.com/users/getoutfitted/orgs","repos_url":"https://api.github.com/users/getoutfitted/repos","events_url":"https://api.github.com/users/getoutfitted/events{/privacy}","received_events_url":"https://api.github.com/users/getoutfitted/received_events","type":"Organization","site_admin":false},"repo":{"id":44138567,"name":"reaction-advanced-fulfillment","full_name":"getoutfitted/reaction-advanced-fulfillment","owner":{"login":"getoutfitted","id":11788610,"avatar_url":"https://avatars.githubusercontent.com/u/11788610?v=3","gravatar_id":"","url":"https://api.github.com/users/getoutfitted","html_url":"https://github.com/getoutfitted","followers_url":"https://api.github.com/users/getoutfitted/followers","following_url":"https://api.github.com/users/getoutfitted/following{/other_user}","gists_url":"https://api.github.com/users/getoutfitted/gists{/gist_id}","starred_url":"https://api.github.com/users/getoutfitted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getoutfitted/subscriptions","organizations_url":"https://api.github.com/users/getoutfitted/orgs","repos_url":"https://api.github.com/users/getoutfitted/repos","events_url":"https://api.github.com/users/getoutfitted/events{/privacy}","received_events_url":"https://api.github.com/users/getoutfitted/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getoutfitted/reaction-advanced-fulfillment","description":"Package to help manage the fulfillment cycle of rental products.","fork":false,"url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment","forks_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/forks","keys_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/teams","hooks_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/hooks","issue_events_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/issues/events{/number}","events_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/events","assignees_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/assignees{/user}","branches_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/branches{/branch}","tags_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/tags","blobs_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/git/refs{/sha}","trees_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/statuses/{sha}","languages_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/languages","stargazers_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/stargazers","contributors_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/contributors","subscribers_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/subscribers","subscription_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/subscription","commits_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/commits{/sha}","git_commits_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/git/commits{/sha}","comments_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/comments{/number}","issue_comment_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/issues/comments{/number}","contents_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/contents/{+path}","compare_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/merges","archive_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/downloads","issues_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/issues{/number}","pulls_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/pulls{/number}","milestones_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/milestones{/number}","notifications_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/labels{/name}","releases_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/releases{/id}","deployments_url":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/deployments","created_at":"2015-10-12T22:53:44Z","updated_at":"2016-01-11T21:57:04Z","pushed_at":"2016-02-15T23:28:58Z","git_url":"git://github.com/getoutfitted/reaction-advanced-fulfillment.git","ssh_url":"git@github.com:getoutfitted/reaction-advanced-fulfillment.git","clone_url":"https://github.com/getoutfitted/reaction-advanced-fulfillment.git","svn_url":"https://github.com/getoutfitted/reaction-advanced-fulfillment","homepage":"","size":497,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":4,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/pulls/200"},"html":{"href":"https://github.com/getoutfitted/reaction-advanced-fulfillment/pull/200"},"issue":{"href":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/issues/200"},"comments":{"href":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/issues/200/comments"},"review_comments":{"href":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/pulls/200/comments"},"review_comment":{"href":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/pulls/200/commits"},"statuses":{"href":"https://api.github.com/repos/getoutfitted/reaction-advanced-fulfillment/statuses/37c3954f52a046ff9816dd0966e546c50795f10b"}}}}