mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
Shared money input should respond to change in currency (#654)
* Add step method to currency * Change amount placeholder and step, when currency select change * Lint * Add test with auth * Extract request to specific service
This commit is contained in:
12
test/controllers/currencies_controller_test.rb
Normal file
12
test/controllers/currencies_controller_test.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
require "test_helper"
|
||||
|
||||
class CurrenciesControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
sign_in @user = users(:family_admin)
|
||||
end
|
||||
|
||||
test "should show currency" do
|
||||
get currency_url(id: "EUR", format: :json)
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
@@ -46,4 +46,8 @@ class Money::CurrencyTest < ActiveSupport::TestCase
|
||||
assert_equal "12", value4.cents_str(2)
|
||||
assert_equal "123", value4.cents_str(3)
|
||||
end
|
||||
|
||||
test "step returns the smallest value of the currency" do
|
||||
assert_equal 0.01, @currency.step
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user