Skip to content

Commit

Permalink
[Kusum] #Misc Modified error messages for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
kusumijari committed Feb 29, 2016
1 parent 56faaeb commit 0c2dd4a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions app/models/cabpool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions config/locales/validates_timeliness.en.yml
Original file line number Diff line number Diff line change
@@ -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}"
Expand Down
4 changes: 2 additions & 2 deletions spec/features/new_cabpool_creations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 0c2dd4a

Please sign in to comment.