Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messages for wallet payment source #3196

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,10 @@ en:
spree/wallet_payment_source:
attributes:
payment_source:
has_to_be_payment_source_class: has to be a Spree::PaymentSource
not_owned_by_user: does not belong to user
has_to_be_payment_source_class: is not a valid payment source
not_owned_by_user: does not belong to the user associated with the order
user_id:
payment_source_already_exists: already has the Spree::PaymentSource in their wallet
payment_source_already_exists: already has this payment source in their wallet
models:
spree/address:
one: Address
Expand Down
6 changes: 3 additions & 3 deletions core/spec/models/spree/wallet_payment_source_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

expect(wallet_payment_source).not_to be_valid
expect(wallet_payment_source.errors.messages).to eq(
{ payment_source: ["has to be a Spree::PaymentSource"] }
{ payment_source: ["is not a valid payment source"] }
)
end
end
Expand All @@ -43,7 +43,7 @@
)
expect(wallet_payment_source).not_to be_valid
expect(wallet_payment_source.errors.messages).to eq(
{ user_id: ["already has the Spree::PaymentSource in their wallet"] }
{ user_id: ["already has this payment source in their wallet"] }
)
end

Expand All @@ -54,7 +54,7 @@
)
expect(wallet_payment_source).not_to be_valid
expect(wallet_payment_source.errors.messages).to eq(
{ payment_source: ["does not belong to user"] }
{ payment_source: ["does not belong to the user associated with the order"] }
)
end

Expand Down