From 0c2dd4a873d2840ead65a0c45f1ae60053606a38 Mon Sep 17 00:00:00 2001 From: Kusum Ijari Date: Mon, 29 Feb 2016 21:48:44 +0530 Subject: [PATCH] [Kusum] #Misc Modified error messages for consistency --- app/models/cabpool.rb | 8 ++++---- config/locales/en.yml | 2 +- config/locales/validates_timeliness.en.yml | 6 +++--- spec/features/new_cabpool_creations_spec.rb | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/models/cabpool.rb b/app/models/cabpool.rb index 7f6c5ac..2772ebc 100644 --- a/app/models/cabpool.rb +++ b/app/models/cabpool.rb @@ -20,14 +20,14 @@ def ordered_localities def invalidate_empty_localities if localities.empty? - errors.add(:localities, "Should not be empty") + errors.add(:localities, "This should not be empty") end end def invalidate_duplicate_localities difference = localities.size - localities.uniq.size if difference != 0 - errors.add(:localities, "Already Exists") + errors.add(:localities, "This already Exists") end end @@ -44,13 +44,13 @@ def available_slots private def invalidate_empty_cabpool_type if cabpool_type.nil? - errors.add(:cabpool_types, "Should not be empty") + errors.add(:cabpool_types, "This should not be empty") end end def invalidate_empty_users if users.length == 0 - errors.add(:users, "Should not be empty") + errors.add(:users, "This should not be empty") end end diff --git a/config/locales/en.yml b/config/locales/en.yml index 568a78d..e1a9bcf 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -41,7 +41,7 @@ en: locality: attributes: name: - taken: "already exists. Please choose it from the drop down menu." + taken: "This already exists. Please choose it from the drop down menu." user: attributes: locality: diff --git a/config/locales/validates_timeliness.en.yml b/config/locales/validates_timeliness.en.yml index fb5860e..48195ff 100644 --- a/config/locales/validates_timeliness.en.yml +++ b/config/locales/validates_timeliness.en.yml @@ -1,9 +1,9 @@ en: errors: messages: - invalid_date: "It is not a valid date." - invalid_time: "It is not a valid time." - invalid_datetime: "It is not a valid datetime." + invalid_date: "This is not a valid date." + invalid_time: "This is not a valid time." + invalid_datetime: "This is not a valid datetime." is_at: "Must be at %{restriction}" before: "Must be before %{restriction}" on_or_before: "Must be on or before %{restriction}" diff --git a/spec/features/new_cabpool_creations_spec.rb b/spec/features/new_cabpool_creations_spec.rb index 36899af..de62373 100644 --- a/spec/features/new_cabpool_creations_spec.rb +++ b/spec/features/new_cabpool_creations_spec.rb @@ -21,8 +21,8 @@ expect(page.current_path).to eq '/cabpools' expect(page.body).to have_content("This is not a number.") - expect(page.body).to have_content("It is not a valid time") - expect(page.body).to have_content("Should not be empty") + expect(page.body).to have_content("This is not a valid time") + expect(page.body).to have_content("This should not be empty") visit new_cabpool_path fill_in 'cabpool_number_of_people', with: '4' fill_in 'cabpool_timein', with: '12:23 PM'