added specs and validations for Role model#5792
Conversation
There was a problem hiding this comment.
Space inside { detected.
Space inside } detected.
|
Mh, I'm not sure I like shoulda-matchers, it feels inconsistent with the expect syntax. |
|
@jhass, the one-line syntax used by shoulda-matchers is supported by RSpec, even when using the expect syntax: https://github.com/rspec/rspec-expectations/blob/master/Should.md#one-liners I feel that the inconsistency is a small trade-off for being able to write a one-liner instead of multiple lines. It's a solid Thoughtbot gem with great support & documentation. It's probably saved me hundreds of hours and thousands of lines of spec code over the years. Check it out...let me know what you think...and in the meantime, I'll start making Hound happier... 😄 |
|
Mh, okay deal, we can try it for a while. |
e4471dc to
fc45ebd
Compare
There was a problem hiding this comment.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
fc45ebd to
6c3f6cb
Compare
- added shoulda-matchers gem for one-line specs - added FactoryGirl syntax methods
6c3f6cb to
d4f1a5d
Compare
|
Thank you! |
added specs and validations for Role model
Partial fix for #4020
I also added a few validations that seemed to make sense for roles, and tweaked the
Role.is_admin?method to return a boolean. Hopefully CI will catch any issues that these changes may cause, but please let me know if I should back out any of those changes to the model itself.