Groups
Sign in
Groups
shoulda
Conversations
About
Send feedback
Help
Testing validates_inclusion_of / booleans?
186 views
Skip to first unread message
Arron Washington
unread,
Aug 18, 2008, 7:39:24 PM
8/18/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to shoulda
Yo.
Just started playing around with Shoulda as an experiment, but I can't
seem to find a way to test booleans?
model/user.rb
validates_inclusion_of :is_a_serial_killer, :in => [true, false]
What would be the Shoulda unit test equivalent?
david.l...@gmail.com
unread,
Aug 18, 2008, 8:29:21 PM
8/18/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sho...@googlegroups.com
should_allow_values_for :is_a_serial_killer, true, false
should_not_allow_values_for :is_a_serial_killer, "some string", 666
-David
Arron Washington
unread,
Aug 18, 2008, 10:23:20 PM
8/18/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to shoulda
Shazbot.
I saw that, but was hoping there'd be something less... verbose, like
should_only_allow_values.
Well, this'll do I guess. Thanks.
david.l...@gmail.com
unread,
Aug 18, 2008, 11:09:01 PM
8/18/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sho...@googlegroups.com
feel free to contribute a new macro, it's open source :)
-D
Arron Washington
unread,
Aug 19, 2008, 8:58:24 PM
8/19/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to shoulda
Yeah, I could do that. =D
Reply all
Reply to author
Forward
0 new messages