We need to test the poll module's form validation.
Suggested assertions:
- Cannot set an option to have a negative amount of votes.
- Cannot have less than two voting options.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | poll.test.patch | 1.82 KB | dawehner |
| #6 | poll.test.patch | 1.77 KB | chrisshattuck |
| #1 | poll.test.patch | 1.75 KB | chrisshattuck |
Comments
Comment #1
chrisshattuck commentedPatch for two tests above.
Comment #2
cwgordon7 commentedComment #3
chrisshattuck commentedAh, thanks cwgordon7. stompeers = patch noob.
Comment #4
chrisshattuck commentedAlso, what needs work? Any feedback?
Comment #5
cwgordon7 commentedSorry, I meant to mention what needed work with the patch. There is trailing whitespace on several lines, and also, it would be preferable if you could use more descriptive messages in your assertions. For example, the second parameter of assertText should not just be the text you were searching for repeated, but something like t('Cannot submit poll with less than two voting options.'), etc.
Comment #6
chrisshattuck commentedHere is the re-rolled patch, with updated verbiage and white space removed.
Comment #7
dawehnerthe patch looks fine.
Shouldn't the user be named $admin_user?
Comment #8
dawehnerso code needs work
Comment #9
catchMoving this out of the critical bugs queue - see #607038: Meta issue: fix gaps in code coverage.
Comment #10
dawehnerWhy does this user need administer nodes.
Anyway i updated the patch
Comment #12
amateescu commentedThis was fixed in #1295546: Weight and number of votes not getting saved when updating a poll.. Can't find a better status than closed (duplicate)..