mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Show successful message
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
angular.module("admin.customers").directive 'editAddressDialog', ($compile, $templateCache, $filter, DialogDefaults, Customers) ->
|
||||
angular.module("admin.customers").directive 'editAddressDialog', ($compile, $templateCache, $filter, DialogDefaults, Customers, StatusMessage) ->
|
||||
restrict: 'A'
|
||||
scope: true
|
||||
link: (scope, element, attr) ->
|
||||
@@ -14,6 +14,7 @@ angular.module("admin.customers").directive 'editAddressDialog', ($compile, $tem
|
||||
Customers.update(scope.address, scope.customer, scope.current_address).$promise.then (data) ->
|
||||
scope.customer = data
|
||||
template.dialog('close')
|
||||
StatusMessage.display('success', "Address updated successfully.")
|
||||
else
|
||||
scope.errors.push("Sorry! Please input all of the required fields!")
|
||||
|
||||
|
||||
@@ -164,10 +164,9 @@ feature 'Customers' do
|
||||
fill_in 'address1', with: "New Address1"
|
||||
click_button 'Update Address'
|
||||
|
||||
expect(page).to have_content 'Address updated successfully.'
|
||||
expect(page).to have_link 'New Address1'
|
||||
|
||||
RackRequestBlocker.wait_for_requests_complete
|
||||
|
||||
expect(customer4.reload.bill_address.address1).to eq 'New Address1'
|
||||
end
|
||||
|
||||
@@ -186,7 +185,8 @@ feature 'Customers' do
|
||||
select 'Victoria', from: 'state'
|
||||
click_button 'Update Address'
|
||||
|
||||
RackRequestBlocker.wait_for_requests_complete
|
||||
expect(page).to have_content 'Address updated successfully.'
|
||||
expect(page).to have_link 'New Address1'
|
||||
|
||||
ship_address = customer4.reload.ship_address
|
||||
|
||||
|
||||
Reference in New Issue
Block a user