thoughtbot/shoulda-matchers — pull request #381 by petedmarsh (2013-11-12 18:46:11+00:00)
Title: Change `validate_uniqueness_of_matcher` to respect column limit

Previously `validate_uniquness_of_matcher` created records with a string of 16 characters in length. If the column under test test had a limit of fewer than 16 characters it would fail.

This changes `validate_uniquness_of_matcher` to test using a string of at most 16 characters of length, using fewer characters if the subject has a limit of < 16. (I figured that you wouldn't really want to use a string of exactly the limit in every case because the limit could be very high).

I'm fairly sure the test I added could be improved, I would be happy to do so if someone could suggest how :)