From 44b56d3d03ab5dfb3f2cd75c47aa8e81e15f3067 Mon Sep 17 00:00:00 2001 From: Simone Carletti Date: Mon, 21 Feb 2011 11:41:40 +0100 Subject: [PATCH] Change Uniqueness validator message to follow ActiveRecord and other ORM behavior. Keeping the same message allows tools like Shoulda to work out of the box. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcos Tapajós --- lib/couchrest/model/validations/locale/en.yml | 2 +- spec/couchrest/validations.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/couchrest/model/validations/locale/en.yml b/lib/couchrest/model/validations/locale/en.yml index 942261f..016350b 100644 --- a/lib/couchrest/model/validations/locale/en.yml +++ b/lib/couchrest/model/validations/locale/en.yml @@ -1,5 +1,5 @@ en: errors: messages: - taken: "is already taken" + taken: "has already been taken" diff --git a/spec/couchrest/validations.rb b/spec/couchrest/validations.rb index ef01df6..063f62b 100644 --- a/spec/couchrest/validations.rb +++ b/spec/couchrest/validations.rb @@ -25,7 +25,7 @@ describe "Validations" do it "should not validate a non-unique document" do @obj = WithUniqueValidation.create(:title => 'title 1') @obj.should_not be_valid - @obj.errors[:title].should eql(['is already taken']) + @obj.errors[:title].should == ["has already been taken"] end it "should save already created document" do