Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

validates_presence_of doesn't expect a space #55

Open
nathanl opened this issue May 12, 2012 · 0 comments
Open

validates_presence_of doesn't expect a space #55

nathanl opened this issue May 12, 2012 · 0 comments

Comments

@nathanl
Copy link

nathanl commented May 12, 2012

Using validates_presence_of(:description), I'm getting this error:

Expected errors to include "Description must not be blank" when description is set to nil, got errors: ["Description must not be blank "]

The only difference between the expected and actual error is a space at the end.

Note that if I write my own validation, the actual error message doesn't have a space at the end.

it "should validate the presence of description" do
  @robot.description = nil
  @robot.valid?
  @robot.errors.full_messages.should include("Description must not be blank")
end

How can I either cause the error not to have a space or specify the expected message as having one?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant