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.
Signed-off-by: Marcos Tapajós <tapajos@gmail.com>
This commit is contained in:
parent
f76517d0fa
commit
44b56d3d03
|
@ -1,5 +1,5 @@
|
||||||
en:
|
en:
|
||||||
errors:
|
errors:
|
||||||
messages:
|
messages:
|
||||||
taken: "is already taken"
|
taken: "has already been taken"
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ describe "Validations" do
|
||||||
it "should not validate a non-unique document" do
|
it "should not validate a non-unique document" do
|
||||||
@obj = WithUniqueValidation.create(:title => 'title 1')
|
@obj = WithUniqueValidation.create(:title => 'title 1')
|
||||||
@obj.should_not be_valid
|
@obj.should_not be_valid
|
||||||
@obj.errors[:title].should eql(['is already taken'])
|
@obj.errors[:title].should == ["has already been taken"]
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should save already created document" do
|
it "should save already created document" do
|
||||||
|
|
Loading…
Reference in a new issue