{"action":"created","comment":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/comments/91786713","pull_request_review_id":12299212,"id":91786713,"diff_hunk":"@@ -218,15 +218,27 @@ module Spree\n       end\n     end\n \n-    context \"payment required?\" do\n+    context \"payment_required?\" do\n+      before { order.total = total }\n+\n       context \"total is zero\" do\n-        before { allow(order).to receive_messages(total: 0) }\n-        it { expect(order.payment_required?).to be false }\n+        let(:total) { 0 }\n+        it { expect(order).not_to be_payment_required }\n+      end\n+\n+      context \"total is once cent\" do\n+        let(:total) { 1 }\n+        it { expect(order).to be_payment_required }\n+      end\n+\n+      context \"total is once dollar\" do\n+        let(:total) { 1 }\n+        it { expect(order).to be_payment_required }\n       end\n \n-      context \"total > zero\" do\n-        before { allow(order).to receive_messages(total: 1) }\n-        it { expect(order.payment_required?).to be true }\n+      context \"total is hige\" do","path":"core/spec/models/spree/order/payment_spec.rb","position":28,"original_position":28,"commit_id":"d1b27f2f17b28a2ffe724e81d3f30f69874ee9e7","original_commit_id":"d1b27f2f17b28a2ffe724e81d3f30f69874ee9e7","user":{"login":"tvdeyen","id":42868,"avatar_url":"https://avatars.githubusercontent.com/u/42868?v=3","gravatar_id":"","url":"https://api.github.com/users/tvdeyen","html_url":"https://github.com/tvdeyen","followers_url":"https://api.github.com/users/tvdeyen/followers","following_url":"https://api.github.com/users/tvdeyen/following{/other_user}","gists_url":"https://api.github.com/users/tvdeyen/gists{/gist_id}","starred_url":"https://api.github.com/users/tvdeyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tvdeyen/subscriptions","organizations_url":"https://api.github.com/users/tvdeyen/orgs","repos_url":"https://api.github.com/users/tvdeyen/repos","events_url":"https://api.github.com/users/tvdeyen/events{/privacy}","received_events_url":"https://api.github.com/users/tvdeyen/received_events","type":"User","site_admin":false},"body":"huge? ;)","created_at":"2016-12-09T20:10:56Z","updated_at":"2016-12-09T20:10:56Z","html_url":"https://github.com/solidusio/solidus/pull/1645#discussion_r91786713","pull_request_url":"https://api.github.com/repos/solidusio/solidus/pulls/1645","_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments/91786713"},"html":{"href":"https://github.com/solidusio/solidus/pull/1645#discussion_r91786713"},"pull_request":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1645"}}},"pull_request":{"url":"https://api.github.com/repos/solidusio/solidus/pulls/1645","id":97369985,"html_url":"https://github.com/solidusio/solidus/pull/1645","diff_url":"https://github.com/solidusio/solidus/pull/1645.diff","patch_url":"https://github.com/solidusio/solidus/pull/1645.patch","issue_url":"https://api.github.com/repos/solidusio/solidus/issues/1645","number":1645,"state":"open","locked":false,"title":"Remove conversions to floating point","user":{"login":"jhawthorn","id":131752,"avatar_url":"https://avatars.githubusercontent.com/u/131752?v=3","gravatar_id":"","url":"https://api.github.com/users/jhawthorn","html_url":"https://github.com/jhawthorn","followers_url":"https://api.github.com/users/jhawthorn/followers","following_url":"https://api.github.com/users/jhawthorn/following{/other_user}","gists_url":"https://api.github.com/users/jhawthorn/gists{/gist_id}","starred_url":"https://api.github.com/users/jhawthorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhawthorn/subscriptions","organizations_url":"https://api.github.com/users/jhawthorn/orgs","repos_url":"https://api.github.com/users/jhawthorn/repos","events_url":"https://api.github.com/users/jhawthorn/events{/privacy}","received_events_url":"https://api.github.com/users/jhawthorn/received_events","type":"User","site_admin":false},"body":"Floating point should never be used for money, or really any number you're uncomfortable with being described as \"about\".\r\n\r\nA quick example why:\r\n```\r\n> 0.1 + 0.1 + 0.1\r\n=> 0.30000000000000004\r\n```\r\n\r\nWe use `BigDecimal` extensively, and have done pretty good job at ensuring all new code doesn't do float math. However there are still a few pieces of older code which convert to or back from floats. It's time to remove these.\r\n\r\nRuby 2.4 has [changed the default round mode](https://bugs.ruby-lang.org/issues/12548) for floating point, so we want to make especially sure we aren't rounding any floats.\r\n\r\n## Places `to_f` is found in models\r\n * [ ] refund.rb\r\n * [ ] calculator/tiered_percent.rb\r\n * [ ] calculator/flexi_rate.rb\r\n * [ ] calculator/tiered_flat_rate.rb\r\n * [ ] calculator/shipping/flexi_rate.rb\r\n * [x] calculator/shipping/flat_percent_item_total.rb\r\n * [x] order.rb\r\n * [ ] promotion/actions/create_quantity_adjustments.rb\r\n * [ ] promotion/actions/create_item_adjustments.rb\r\n * [ ] promotion/actions/create_adjustment.rb\r\n * [x] payment/processing.rb","created_at":"2016-12-09T19:54:51Z","updated_at":"2016-12-09T20:10:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"afc8b1148d4c4eca556e96a3de4d29d0c1e8f579","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/solidusio/solidus/pulls/1645/commits","review_comments_url":"https://api.github.com/repos/solidusio/solidus/pulls/1645/comments","review_comment_url":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/solidusio/solidus/issues/1645/comments","statuses_url":"https://api.github.com/repos/solidusio/solidus/statuses/d1b27f2f17b28a2ffe724e81d3f30f69874ee9e7","head":{"label":"jhawthorn:remove_floats","ref":"remove_floats","sha":"d1b27f2f17b28a2ffe724e81d3f30f69874ee9e7","user":{"login":"jhawthorn","id":131752,"avatar_url":"https://avatars.githubusercontent.com/u/131752?v=3","gravatar_id":"","url":"https://api.github.com/users/jhawthorn","html_url":"https://github.com/jhawthorn","followers_url":"https://api.github.com/users/jhawthorn/followers","following_url":"https://api.github.com/users/jhawthorn/following{/other_user}","gists_url":"https://api.github.com/users/jhawthorn/gists{/gist_id}","starred_url":"https://api.github.com/users/jhawthorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhawthorn/subscriptions","organizations_url":"https://api.github.com/users/jhawthorn/orgs","repos_url":"https://api.github.com/users/jhawthorn/repos","events_url":"https://api.github.com/users/jhawthorn/events{/privacy}","received_events_url":"https://api.github.com/users/jhawthorn/received_events","type":"User","site_admin":false},"repo":{"id":37868303,"name":"solidus","full_name":"jhawthorn/solidus","owner":{"login":"jhawthorn","id":131752,"avatar_url":"https://avatars.githubusercontent.com/u/131752?v=3","gravatar_id":"","url":"https://api.github.com/users/jhawthorn","html_url":"https://github.com/jhawthorn","followers_url":"https://api.github.com/users/jhawthorn/followers","following_url":"https://api.github.com/users/jhawthorn/following{/other_user}","gists_url":"https://api.github.com/users/jhawthorn/gists{/gist_id}","starred_url":"https://api.github.com/users/jhawthorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhawthorn/subscriptions","organizations_url":"https://api.github.com/users/jhawthorn/orgs","repos_url":"https://api.github.com/users/jhawthorn/repos","events_url":"https://api.github.com/users/jhawthorn/events{/privacy}","received_events_url":"https://api.github.com/users/jhawthorn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jhawthorn/solidus","description":"solidus ecommerce system","fork":true,"url":"https://api.github.com/repos/jhawthorn/solidus","forks_url":"https://api.github.com/repos/jhawthorn/solidus/forks","keys_url":"https://api.github.com/repos/jhawthorn/solidus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jhawthorn/solidus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jhawthorn/solidus/teams","hooks_url":"https://api.github.com/repos/jhawthorn/solidus/hooks","issue_events_url":"https://api.github.com/repos/jhawthorn/solidus/issues/events{/number}","events_url":"https://api.github.com/repos/jhawthorn/solidus/events","assignees_url":"https://api.github.com/repos/jhawthorn/solidus/assignees{/user}","branches_url":"https://api.github.com/repos/jhawthorn/solidus/branches{/branch}","tags_url":"https://api.github.com/repos/jhawthorn/solidus/tags","blobs_url":"https://api.github.com/repos/jhawthorn/solidus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jhawthorn/solidus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jhawthorn/solidus/git/refs{/sha}","trees_url":"https://api.github.com/repos/jhawthorn/solidus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jhawthorn/solidus/statuses/{sha}","languages_url":"https://api.github.com/repos/jhawthorn/solidus/languages","stargazers_url":"https://api.github.com/repos/jhawthorn/solidus/stargazers","contributors_url":"https://api.github.com/repos/jhawthorn/solidus/contributors","subscribers_url":"https://api.github.com/repos/jhawthorn/solidus/subscribers","subscription_url":"https://api.github.com/repos/jhawthorn/solidus/subscription","commits_url":"https://api.github.com/repos/jhawthorn/solidus/commits{/sha}","git_commits_url":"https://api.github.com/repos/jhawthorn/solidus/git/commits{/sha}","comments_url":"https://api.github.com/repos/jhawthorn/solidus/comments{/number}","issue_comment_url":"https://api.github.com/repos/jhawthorn/solidus/issues/comments{/number}","contents_url":"https://api.github.com/repos/jhawthorn/solidus/contents/{+path}","compare_url":"https://api.github.com/repos/jhawthorn/solidus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jhawthorn/solidus/merges","archive_url":"https://api.github.com/repos/jhawthorn/solidus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jhawthorn/solidus/downloads","issues_url":"https://api.github.com/repos/jhawthorn/solidus/issues{/number}","pulls_url":"https://api.github.com/repos/jhawthorn/solidus/pulls{/number}","milestones_url":"https://api.github.com/repos/jhawthorn/solidus/milestones{/number}","notifications_url":"https://api.github.com/repos/jhawthorn/solidus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jhawthorn/solidus/labels{/name}","releases_url":"https://api.github.com/repos/jhawthorn/solidus/releases{/id}","deployments_url":"https://api.github.com/repos/jhawthorn/solidus/deployments","created_at":"2015-06-22T16:58:44Z","updated_at":"2016-01-15T05:22:53Z","pushed_at":"2016-12-09T20:08:37Z","git_url":"git://github.com/jhawthorn/solidus.git","ssh_url":"git@github.com:jhawthorn/solidus.git","clone_url":"https://github.com/jhawthorn/solidus.git","svn_url":"https://github.com/jhawthorn/solidus","homepage":"","size":65597,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"solidusio:master","ref":"master","sha":"19b4c3330da281cdbf4683cf864f492c13fda697","user":{"login":"solidusio","id":11045486,"avatar_url":"https://avatars.githubusercontent.com/u/11045486?v=3","gravatar_id":"","url":"https://api.github.com/users/solidusio","html_url":"https://github.com/solidusio","followers_url":"https://api.github.com/users/solidusio/followers","following_url":"https://api.github.com/users/solidusio/following{/other_user}","gists_url":"https://api.github.com/users/solidusio/gists{/gist_id}","starred_url":"https://api.github.com/users/solidusio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solidusio/subscriptions","organizations_url":"https://api.github.com/users/solidusio/orgs","repos_url":"https://api.github.com/users/solidusio/repos","events_url":"https://api.github.com/users/solidusio/events{/privacy}","received_events_url":"https://api.github.com/users/solidusio/received_events","type":"Organization","site_admin":false},"repo":{"id":30985840,"name":"solidus","full_name":"solidusio/solidus","owner":{"login":"solidusio","id":11045486,"avatar_url":"https://avatars.githubusercontent.com/u/11045486?v=3","gravatar_id":"","url":"https://api.github.com/users/solidusio","html_url":"https://github.com/solidusio","followers_url":"https://api.github.com/users/solidusio/followers","following_url":"https://api.github.com/users/solidusio/following{/other_user}","gists_url":"https://api.github.com/users/solidusio/gists{/gist_id}","starred_url":"https://api.github.com/users/solidusio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solidusio/subscriptions","organizations_url":"https://api.github.com/users/solidusio/orgs","repos_url":"https://api.github.com/users/solidusio/repos","events_url":"https://api.github.com/users/solidusio/events{/privacy}","received_events_url":"https://api.github.com/users/solidusio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/solidusio/solidus","description":"Solidus, Rails eCommerce System","fork":false,"url":"https://api.github.com/repos/solidusio/solidus","forks_url":"https://api.github.com/repos/solidusio/solidus/forks","keys_url":"https://api.github.com/repos/solidusio/solidus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/solidusio/solidus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/solidusio/solidus/teams","hooks_url":"https://api.github.com/repos/solidusio/solidus/hooks","issue_events_url":"https://api.github.com/repos/solidusio/solidus/issues/events{/number}","events_url":"https://api.github.com/repos/solidusio/solidus/events","assignees_url":"https://api.github.com/repos/solidusio/solidus/assignees{/user}","branches_url":"https://api.github.com/repos/solidusio/solidus/branches{/branch}","tags_url":"https://api.github.com/repos/solidusio/solidus/tags","blobs_url":"https://api.github.com/repos/solidusio/solidus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/solidusio/solidus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/solidusio/solidus/git/refs{/sha}","trees_url":"https://api.github.com/repos/solidusio/solidus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/solidusio/solidus/statuses/{sha}","languages_url":"https://api.github.com/repos/solidusio/solidus/languages","stargazers_url":"https://api.github.com/repos/solidusio/solidus/stargazers","contributors_url":"https://api.github.com/repos/solidusio/solidus/contributors","subscribers_url":"https://api.github.com/repos/solidusio/solidus/subscribers","subscription_url":"https://api.github.com/repos/solidusio/solidus/subscription","commits_url":"https://api.github.com/repos/solidusio/solidus/commits{/sha}","git_commits_url":"https://api.github.com/repos/solidusio/solidus/git/commits{/sha}","comments_url":"https://api.github.com/repos/solidusio/solidus/comments{/number}","issue_comment_url":"https://api.github.com/repos/solidusio/solidus/issues/comments{/number}","contents_url":"https://api.github.com/repos/solidusio/solidus/contents/{+path}","compare_url":"https://api.github.com/repos/solidusio/solidus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/solidusio/solidus/merges","archive_url":"https://api.github.com/repos/solidusio/solidus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/solidusio/solidus/downloads","issues_url":"https://api.github.com/repos/solidusio/solidus/issues{/number}","pulls_url":"https://api.github.com/repos/solidusio/solidus/pulls{/number}","milestones_url":"https://api.github.com/repos/solidusio/solidus/milestones{/number}","notifications_url":"https://api.github.com/repos/solidusio/solidus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/solidusio/solidus/labels{/name}","releases_url":"https://api.github.com/repos/solidusio/solidus/releases{/id}","deployments_url":"https://api.github.com/repos/solidusio/solidus/deployments","created_at":"2015-02-18T20:41:58Z","updated_at":"2016-12-08T22:06:55Z","pushed_at":"2016-12-09T20:08:38Z","git_url":"git://github.com/solidusio/solidus.git","ssh_url":"git@github.com:solidusio/solidus.git","clone_url":"https://github.com/solidusio/solidus.git","svn_url":"https://github.com/solidusio/solidus","homepage":"https://solidus.io/","size":71816,"stargazers_count":1203,"watchers_count":1203,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":376,"mirror_url":null,"open_issues_count":188,"forks":376,"open_issues":188,"watchers":1203,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1645"},"html":{"href":"https://github.com/solidusio/solidus/pull/1645"},"issue":{"href":"https://api.github.com/repos/solidusio/solidus/issues/1645"},"comments":{"href":"https://api.github.com/repos/solidusio/solidus/issues/1645/comments"},"review_comments":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1645/comments"},"review_comment":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/solidusio/solidus/pulls/1645/commits"},"statuses":{"href":"https://api.github.com/repos/solidusio/solidus/statuses/d1b27f2f17b28a2ffe724e81d3f30f69874ee9e7"}}}}
{"actor":{"display_login":"tvdeyen"}}