Skip to content

Commit

Permalink
Expose the amount percentage for tax rates
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Nov 30, 2023
1 parent 0d180f5 commit db06f7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/app/models/spree/tax_rate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ def adjustment_label(amount)
)
end

def display_amount
amount_for_adjustment_label
end

private

def amount_for_adjustment_label
Expand Down
6 changes: 6 additions & 0 deletions core/spec/models/spree/tax_rate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,10 @@
end
end
end

describe "#display_amount" do
subject(:rate) { create(:tax_rate, amount: 0.1).display_amount }

it { is_expected.to eq("10.0%") }
end
end

0 comments on commit db06f7b

Please sign in to comment.