From 5a0cb948c933851b56114daeb2c91b3152a518c4 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Thu, 14 Oct 2010 12:46:10 -0700 Subject: [PATCH] [#4649] Change the flash message to say deleted and not destroyed --- app/controllers/deliverables_controller.rb | 2 +- config/locales/en.yml | 2 +- test/integration/deliverables_delete_test.rb | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/deliverables_controller.rb b/app/controllers/deliverables_controller.rb index a013fd1..3fb4f0b 100644 --- a/app/controllers/deliverables_controller.rb +++ b/app/controllers/deliverables_controller.rb @@ -37,7 +37,7 @@ class DeliverablesController < InheritedResources::Base end def destroy - destroy!(:notice => l(:text_flash_deliverable_destroyed, :name => resource.title)) { contract_url(@project, @contract) } + destroy!(:notice => l(:text_flash_deliverable_deleted, :name => resource.title)) { contract_url(@project, @contract) } end protected diff --git a/config/locales/en.yml b/config/locales/en.yml index 54ae01b..88cde12 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -69,7 +69,7 @@ en: text_retainer_monthly_message: "Enter budget for a representative month. Any overrides to individual months can be done via the editor after saving." text_flash_deliverable_created: "Deliverable: {{name}} was successfully created." text_flash_deliverable_updated: "Deliverable: {{name}} was successfully updated." - text_flash_deliverable_destroyed: "Deliverable: {{name}} was successfully destroyed." + text_flash_deliverable_deleted: "Deliverable: {{name}} was successfully deleted." field_budget: Budget field_markup: Markup field_paid: Paid diff --git a/test/integration/deliverables_delete_test.rb b/test/integration/deliverables_delete_test.rb index 6a63904..a19669d 100644 --- a/test/integration/deliverables_delete_test.rb +++ b/test/integration/deliverables_delete_test.rb @@ -39,6 +39,9 @@ class DeliverablesDeleteTest < ActionController::IntegrationTest assert_response :success assert_template 'contracts/show' + assert_select '.flash.notice', /successfully deleted/ + + assert_nil Deliverable.find_by_id(@deliverable.id), "Deliverable not deleted" end end