{"action":"created","comment":{"url":"https://api.github.com/repos/spree/spree/pulls/comments/28709688","id":28709688,"diff_hunk":"@@ -390,6 +390,32 @@ module Core\n         expect(order.adjustments.first.amount).to eq -4.99\n       end\n \n+      it 'adds line item adjustments' do\n+        params = {\n+          line_items_attributes: line_items,\n+          adjustments_attributes: [\n+            { label: 'Line Item Discount', amount: -4.99, variant_id: line_items.first[:variant_id] },\n+            { label: 'Order Discount', amount: -5.99 }\n+          ]\n+        }\n+\n+        order = Importer::Order.import(user, params)\n+\n+        line_item_adjustment = order.line_item_adjustments.first\n+        expect(line_item_adjustment.closed?).to be true","path":"core/spec/lib/spree/core/importer/order_spec.rb","position":16,"original_position":16,"commit_id":"78631adff69c37cb1c37a45bfd863275b03da05a","original_commit_id":"78631adff69c37cb1c37a45bfd863275b03da05a","user":{"login":"JDutil","id":25104,"avatar_url":"https://avatars.githubusercontent.com/u/25104?v=3","gravatar_id":"","url":"https://api.github.com/users/JDutil","html_url":"https://github.com/JDutil","followers_url":"https://api.github.com/users/JDutil/followers","following_url":"https://api.github.com/users/JDutil/following{/other_user}","gists_url":"https://api.github.com/users/JDutil/gists{/gist_id}","starred_url":"https://api.github.com/users/JDutil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JDutil/subscriptions","organizations_url":"https://api.github.com/users/JDutil/orgs","repos_url":"https://api.github.com/users/JDutil/repos","events_url":"https://api.github.com/users/JDutil/events{/privacy}","received_events_url":"https://api.github.com/users/JDutil/received_events","type":"User","site_admin":false},"body":"@BenMorganIO I believe be_truthy will pass for any positive return like say 1 would be truthy where as here you explicitly want the value to be true not just truthy. http://www.rubydoc.info/github/rspec/rspec-expectations/RSpec/Matchers:be_truthy","created_at":"2015-04-20T17:28:51Z","updated_at":"2015-04-20T17:28:51Z","html_url":"https://github.com/spree/spree/pull/6236#discussion_r28709688","pull_request_url":"https://api.github.com/repos/spree/spree/pulls/6236","_links":{"self":{"href":"https://api.github.com/repos/spree/spree/pulls/comments/28709688"},"html":{"href":"https://github.com/spree/spree/pull/6236#discussion_r28709688"},"pull_request":{"href":"https://api.github.com/repos/spree/spree/pulls/6236"}}},"pull_request":{"url":"https://api.github.com/repos/spree/spree/pulls/6236","id":32049423,"html_url":"https://github.com/spree/spree/pull/6236","diff_url":"https://github.com/spree/spree/pull/6236.diff","patch_url":"https://github.com/spree/spree/pull/6236.patch","issue_url":"https://api.github.com/repos/spree/spree/issues/6236","number":6236,"state":"open","locked":false,"title":"Support line item adjustments in order importer","user":{"login":"smartacus","id":77801,"avatar_url":"https://avatars.githubusercontent.com/u/77801?v=3","gravatar_id":"","url":"https://api.github.com/users/smartacus","html_url":"https://github.com/smartacus","followers_url":"https://api.github.com/users/smartacus/followers","following_url":"https://api.github.com/users/smartacus/following{/other_user}","gists_url":"https://api.github.com/users/smartacus/gists{/gist_id}","starred_url":"https://api.github.com/users/smartacus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartacus/subscriptions","organizations_url":"https://api.github.com/users/smartacus/orgs","repos_url":"https://api.github.com/users/smartacus/repos","events_url":"https://api.github.com/users/smartacus/events{/privacy}","received_events_url":"https://api.github.com/users/smartacus/received_events","type":"User","site_admin":false},"body":"This is a work in progress but I ran into issue #6231. As the code stands now, a line item's adjustment_total attribute isn't getting set correctly. I believe this is because the adjustment doesn't have a source and is therefore not a [promotion](https://github.com/spree/spree/blob/master/core/app/models/spree/adjustment.rb#L65) and it's not a tax.\r\n\r\nI believe that adjustment_total is getting set [here](https://github.com/spree/spree/blob/master/core/app/models/spree/adjustable/adjustments_updater.rb#L43).","created_at":"2015-03-26T18:58:37Z","updated_at":"2015-04-20T17:28:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55b988fe37cd95dc8f3912dd1996bc5f5dafd88e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spree/spree/pulls/6236/commits","review_comments_url":"https://api.github.com/repos/spree/spree/pulls/6236/comments","review_comment_url":"https://api.github.com/repos/spree/spree/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spree/spree/issues/6236/comments","statuses_url":"https://api.github.com/repos/spree/spree/statuses/78631adff69c37cb1c37a45bfd863275b03da05a","head":{"label":"TrialGuides:order-importer-line-item-adjustments","ref":"order-importer-line-item-adjustments","sha":"78631adff69c37cb1c37a45bfd863275b03da05a","user":{"login":"TrialGuides","id":2974904,"avatar_url":"https://avatars.githubusercontent.com/u/2974904?v=3","gravatar_id":"","url":"https://api.github.com/users/TrialGuides","html_url":"https://github.com/TrialGuides","followers_url":"https://api.github.com/users/TrialGuides/followers","following_url":"https://api.github.com/users/TrialGuides/following{/other_user}","gists_url":"https://api.github.com/users/TrialGuides/gists{/gist_id}","starred_url":"https://api.github.com/users/TrialGuides/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrialGuides/subscriptions","organizations_url":"https://api.github.com/users/TrialGuides/orgs","repos_url":"https://api.github.com/users/TrialGuides/repos","events_url":"https://api.github.com/users/TrialGuides/events{/privacy}","received_events_url":"https://api.github.com/users/TrialGuides/received_events","type":"Organization","site_admin":false},"repo":{"id":31393706,"name":"spree","full_name":"TrialGuides/spree","owner":{"login":"TrialGuides","id":2974904,"avatar_url":"https://avatars.githubusercontent.com/u/2974904?v=3","gravatar_id":"","url":"https://api.github.com/users/TrialGuides","html_url":"https://github.com/TrialGuides","followers_url":"https://api.github.com/users/TrialGuides/followers","following_url":"https://api.github.com/users/TrialGuides/following{/other_user}","gists_url":"https://api.github.com/users/TrialGuides/gists{/gist_id}","starred_url":"https://api.github.com/users/TrialGuides/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TrialGuides/subscriptions","organizations_url":"https://api.github.com/users/TrialGuides/orgs","repos_url":"https://api.github.com/users/TrialGuides/repos","events_url":"https://api.github.com/users/TrialGuides/events{/privacy}","received_events_url":"https://api.github.com/users/TrialGuides/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TrialGuides/spree","description":"Spree is a complete open source e-commerce solution for Ruby on Rails.","fork":true,"url":"https://api.github.com/repos/TrialGuides/spree","forks_url":"https://api.github.com/repos/TrialGuides/spree/forks","keys_url":"https://api.github.com/repos/TrialGuides/spree/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TrialGuides/spree/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TrialGuides/spree/teams","hooks_url":"https://api.github.com/repos/TrialGuides/spree/hooks","issue_events_url":"https://api.github.com/repos/TrialGuides/spree/issues/events{/number}","events_url":"https://api.github.com/repos/TrialGuides/spree/events","assignees_url":"https://api.github.com/repos/TrialGuides/spree/assignees{/user}","branches_url":"https://api.github.com/repos/TrialGuides/spree/branches{/branch}","tags_url":"https://api.github.com/repos/TrialGuides/spree/tags","blobs_url":"https://api.github.com/repos/TrialGuides/spree/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TrialGuides/spree/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TrialGuides/spree/git/refs{/sha}","trees_url":"https://api.github.com/repos/TrialGuides/spree/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TrialGuides/spree/statuses/{sha}","languages_url":"https://api.github.com/repos/TrialGuides/spree/languages","stargazers_url":"https://api.github.com/repos/TrialGuides/spree/stargazers","contributors_url":"https://api.github.com/repos/TrialGuides/spree/contributors","subscribers_url":"https://api.github.com/repos/TrialGuides/spree/subscribers","subscription_url":"https://api.github.com/repos/TrialGuides/spree/subscription","commits_url":"https://api.github.com/repos/TrialGuides/spree/commits{/sha}","git_commits_url":"https://api.github.com/repos/TrialGuides/spree/git/commits{/sha}","comments_url":"https://api.github.com/repos/TrialGuides/spree/comments{/number}","issue_comment_url":"https://api.github.com/repos/TrialGuides/spree/issues/comments{/number}","contents_url":"https://api.github.com/repos/TrialGuides/spree/contents/{+path}","compare_url":"https://api.github.com/repos/TrialGuides/spree/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TrialGuides/spree/merges","archive_url":"https://api.github.com/repos/TrialGuides/spree/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TrialGuides/spree/downloads","issues_url":"https://api.github.com/repos/TrialGuides/spree/issues{/number}","pulls_url":"https://api.github.com/repos/TrialGuides/spree/pulls{/number}","milestones_url":"https://api.github.com/repos/TrialGuides/spree/milestones{/number}","notifications_url":"https://api.github.com/repos/TrialGuides/spree/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TrialGuides/spree/labels{/name}","releases_url":"https://api.github.com/repos/TrialGuides/spree/releases{/id}","created_at":"2015-02-26T23:09:42Z","updated_at":"2015-04-13T22:49:42Z","pushed_at":"2015-04-15T18:07:07Z","git_url":"git://github.com/TrialGuides/spree.git","ssh_url":"git@github.com:TrialGuides/spree.git","clone_url":"https://github.com/TrialGuides/spree.git","svn_url":"https://github.com/TrialGuides/spree","homepage":"http://spreecommerce.com","size":73303,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spree:master","ref":"master","sha":"2f524f46be2d61d8660b67882fae14b2349bda2b","user":{"login":"spree","id":56702,"avatar_url":"https://avatars.githubusercontent.com/u/56702?v=3","gravatar_id":"","url":"https://api.github.com/users/spree","html_url":"https://github.com/spree","followers_url":"https://api.github.com/users/spree/followers","following_url":"https://api.github.com/users/spree/following{/other_user}","gists_url":"https://api.github.com/users/spree/gists{/gist_id}","starred_url":"https://api.github.com/users/spree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spree/subscriptions","organizations_url":"https://api.github.com/users/spree/orgs","repos_url":"https://api.github.com/users/spree/repos","events_url":"https://api.github.com/users/spree/events{/privacy}","received_events_url":"https://api.github.com/users/spree/received_events","type":"Organization","site_admin":false},"repo":{"id":3314,"name":"spree","full_name":"spree/spree","owner":{"login":"spree","id":56702,"avatar_url":"https://avatars.githubusercontent.com/u/56702?v=3","gravatar_id":"","url":"https://api.github.com/users/spree","html_url":"https://github.com/spree","followers_url":"https://api.github.com/users/spree/followers","following_url":"https://api.github.com/users/spree/following{/other_user}","gists_url":"https://api.github.com/users/spree/gists{/gist_id}","starred_url":"https://api.github.com/users/spree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spree/subscriptions","organizations_url":"https://api.github.com/users/spree/orgs","repos_url":"https://api.github.com/users/spree/repos","events_url":"https://api.github.com/users/spree/events{/privacy}","received_events_url":"https://api.github.com/users/spree/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spree/spree","description":"Spree is a complete open source e-commerce solution for Ruby on Rails.","fork":false,"url":"https://api.github.com/repos/spree/spree","forks_url":"https://api.github.com/repos/spree/spree/forks","keys_url":"https://api.github.com/repos/spree/spree/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spree/spree/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spree/spree/teams","hooks_url":"https://api.github.com/repos/spree/spree/hooks","issue_events_url":"https://api.github.com/repos/spree/spree/issues/events{/number}","events_url":"https://api.github.com/repos/spree/spree/events","assignees_url":"https://api.github.com/repos/spree/spree/assignees{/user}","branches_url":"https://api.github.com/repos/spree/spree/branches{/branch}","tags_url":"https://api.github.com/repos/spree/spree/tags","blobs_url":"https://api.github.com/repos/spree/spree/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spree/spree/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spree/spree/git/refs{/sha}","trees_url":"https://api.github.com/repos/spree/spree/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spree/spree/statuses/{sha}","languages_url":"https://api.github.com/repos/spree/spree/languages","stargazers_url":"https://api.github.com/repos/spree/spree/stargazers","contributors_url":"https://api.github.com/repos/spree/spree/contributors","subscribers_url":"https://api.github.com/repos/spree/spree/subscribers","subscription_url":"https://api.github.com/repos/spree/spree/subscription","commits_url":"https://api.github.com/repos/spree/spree/commits{/sha}","git_commits_url":"https://api.github.com/repos/spree/spree/git/commits{/sha}","comments_url":"https://api.github.com/repos/spree/spree/comments{/number}","issue_comment_url":"https://api.github.com/repos/spree/spree/issues/comments{/number}","contents_url":"https://api.github.com/repos/spree/spree/contents/{+path}","compare_url":"https://api.github.com/repos/spree/spree/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spree/spree/merges","archive_url":"https://api.github.com/repos/spree/spree/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spree/spree/downloads","issues_url":"https://api.github.com/repos/spree/spree/issues{/number}","pulls_url":"https://api.github.com/repos/spree/spree/pulls{/number}","milestones_url":"https://api.github.com/repos/spree/spree/milestones{/number}","notifications_url":"https://api.github.com/repos/spree/spree/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spree/spree/labels{/name}","releases_url":"https://api.github.com/repos/spree/spree/releases{/id}","created_at":"2008-03-10T14:45:35Z","updated_at":"2015-04-20T16:02:40Z","pushed_at":"2015-04-20T13:50:24Z","git_url":"git://github.com/spree/spree.git","ssh_url":"git@github.com:spree/spree.git","clone_url":"https://github.com/spree/spree.git","svn_url":"https://github.com/spree/spree","homepage":"http://spreecommerce.com","size":135768,"stargazers_count":6250,"watchers_count":6250,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2928,"mirror_url":null,"open_issues_count":112,"forks":2928,"open_issues":112,"watchers":6250,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spree/spree/pulls/6236"},"html":{"href":"https://github.com/spree/spree/pull/6236"},"issue":{"href":"https://api.github.com/repos/spree/spree/issues/6236"},"comments":{"href":"https://api.github.com/repos/spree/spree/issues/6236/comments"},"review_comments":{"href":"https://api.github.com/repos/spree/spree/pulls/6236/comments"},"review_comment":{"href":"https://api.github.com/repos/spree/spree/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spree/spree/pulls/6236/commits"},"statuses":{"href":"https://api.github.com/repos/spree/spree/statuses/78631adff69c37cb1c37a45bfd863275b03da05a"}}}}