Closed baghaii closed 9 years ago
I tried to update this because it was behind master.
Please also add an rspec test. We can't add any new behavior that doesn't include a unit test.
See https://github.com/ignitebaltimore/ignitespeak/blob/master/spec/models/proposal_spec.rb
We use a nice helper library called shoulda-matchers
. Probably this is the assertion to choose: https://github.com/thoughtbot/shoulda-matchers/blob/master/lib/shoulda/matchers/active_model/allow_value_matcher.rb
Be sure to test the positive and negative cases, as well as the "allow blank" case
I think that was all of the changes that you needed, right?
I tried to create the website validator.
This is the first thing that I have ever done with Rails. I ran rake to make sure that the tests did not fail, and I ran foreman to see it fail on a bad name and pass with a good one or an empty one. The error message for the bad name is not particularly meaningful. (It's not telling people what they are doing wrong just that the value is invalid.)