From 3034afb62c4540e915d1c1b19c9bcce1dce59769 Mon Sep 17 00:00:00 2001 From: Gregory Daynes Date: Sat, 14 Oct 2017 11:44:49 -0700 Subject: [PATCH 1/2] Update translation for Adjustment Label Updating the translation to reflect what the attribute is called to correct the error message when providing attributes to create. `Spree::Adjustment.create!` requires a description with message 'Description can't be blank', providing it using `description: 'string'` outputs "unknown attribute 'description' for Spree::Adjustment." --- core/config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml index e849e148ed9..c9a0c121652 100644 --- a/core/config/locales/en.yml +++ b/core/config/locales/en.yml @@ -30,7 +30,7 @@ en: spree/adjustment: adjustable: Adjustable amount: Amount - label: Description + label: Label name: Name state: State adjustment_reason_id: Reason From b0a830553ef6e151d4ecda3b945065362feefd75 Mon Sep 17 00:00:00 2001 From: Gregory Daynes Date: Sat, 14 Oct 2017 14:11:47 -0700 Subject: [PATCH 2/2] Update tests with new translation --- backend/spec/features/admin/orders/adjustments_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/spec/features/admin/orders/adjustments_spec.rb b/backend/spec/features/admin/orders/adjustments_spec.rb index 0a85c84f763..b645ac4c76f 100644 --- a/backend/spec/features/admin/orders/adjustments_spec.rb +++ b/backend/spec/features/admin/orders/adjustments_spec.rb @@ -65,7 +65,7 @@ fill_in "adjustment_amount", with: "" fill_in "adjustment_label", with: "" click_button "Continue" - expect(page).to have_content("Description can't be blank") + expect(page).to have_content("Label can't be blank") expect(page).to have_content("Amount is not a number") end end @@ -98,7 +98,7 @@ fill_in "adjustment_amount", with: "" fill_in "adjustment_label", with: "" click_button "Continue" - expect(page).to have_content("Description can't be blank") + expect(page).to have_content("Label can't be blank") expect(page).to have_content("Amount is not a number") end end