Merge pull request #11354 from abdellani/fix-rename-invoice-generate-update-button

rename 'new invoice' button to 'create or update invoice'
This commit is contained in:
Maikel
2023-08-10 09:59:11 +10:00
committed by GitHub
4 changed files with 12 additions and 12 deletions

View File

@@ -7,7 +7,7 @@
- content_for :page_actions do
- if show_generate_invoice_button?(@order)
%li= button_link_to t(:new_invoice), generate_admin_order_invoices_path(@order), :icon => 'icon-plus', data: { method: 'post' }
%li= button_link_to t(:create_or_update_invoice), generate_admin_order_invoices_path(@order), :icon => 'icon-plus', data: { method: 'post' }
= render partial: 'spree/admin/shared/order_links'
%li= button_link_to t(:back_to_orders_list), admin_orders_path, :icon => 'icon-arrow-left'

View File

@@ -3165,7 +3165,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
no_orders_found: "No Orders Found"
order_information: "Order Information"
new_payment: "New Payment"
new_invoice: "New Invoice"
create_or_update_invoice: "Create or Update Invoice"
date_completed: "Date Completed"
amount: "Amount"
invoice_number: "Invoice Number"

View File

@@ -1066,11 +1066,11 @@ describe '
expect(page.find("table").text).to have_content(table_header)
# the New invoice button should be visible
expect(page).to have_link "New Invoice"
click_link 'New Invoice'
expect(page).to have_link "Create or Update Invoice"
click_link "Create or Update Invoice"
# and disappear after clicking
expect(page).to have_no_link "New Invoice"
expect(page).to have_no_link "Create or Update Invoice"
# creating an invoice, displays a second row
expect(page.find("table").text).to have_content(table_contents)

View File

@@ -38,8 +38,8 @@ describe '
click_link 'Invoices'
expect {
click_link 'New Invoice'
expect(page).to have_no_link "New Invoice"
click_link "Create or Update Invoice"
expect(page).to have_no_link "Create or Update Invoice"
}.to change { order.invoices.count }.by(1)
invoice = order.invoices.first
@@ -54,7 +54,7 @@ describe '
context 'order not updated since latest invoice' do
it 'should not render new invoice button' do
click_link 'Invoices'
expect(page).to_not have_link 'New Invoice'
expect(page).to_not have_link "Create or Update Invoice"
end
end
@@ -70,8 +70,8 @@ describe '
it 'updates the lastest invoice for the order' do
click_link 'Invoices'
expect {
click_link 'New Invoice'
expect(page).to have_no_link "New Invoice"
click_link "Create or Update Invoice"
expect(page).to have_no_link "Create or Update Invoice"
}.to change { order.reload.invoices.count }.by(0)
.and change { latest_invoice.reload.presenter.note }.from("").to(new_note)
@@ -87,8 +87,8 @@ describe '
it 'creates a new invoice for the order' do
click_link 'Invoices'
expect {
click_link 'New Invoice'
expect(page).to have_no_link "New Invoice"
click_link "Create or Update Invoice"
expect(page).to have_no_link "Create or Update Invoice"
}.to change { order.reload.invoices.count }.by(1)
expect(latest_invoice.reload.cancelled).to eq true