We need to test the "Most recent poll" block provided by the poll module.
Suggested assertions:
- Make sure the block appears after being enabled on the admin/build/blocks page.
- Make sure the block actually shows the most recent poll (create several in order to verify).
- Make sure nothing appears if there are no polls in existence.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | recentPollTest.5.patch | 3.77 KB | grndlvl |
| #8 | recentPollTest.3.patch | 2.96 KB | catch |
| #6 | recentPollTest.3.patch | 2.96 KB | grndlvl |
| #4 | recentPollTest.2.patch | 2.96 KB | grndlvl |
| #1 | recentPollTest.patch | 2.28 KB | Alpheus |
Comments
Comment #1
Alpheus commentedA patch containing the test for the most recent poll block.
NOTE: On the last run it didn't clean up after itself and it can potentially harm an exisiting drupal instance (Possible database caching issue)
Comment #2
cwgordon7 commentedNo trailing spaces; don't use the 'public' declaration, for consistency; getInfo() keys should be on their own lines; otherwise looks good, though.
Comment #3
Alpheus commentedHad some last-minute problems with my laptop so I had to use another one, I didn't check for all the editor settings; the keyword declarations are a matter of habit (Haven't publicly contributed much to Drupal).
Did you have any issues with errors or caching post-test on live instances or has anyone been able to recreate the bogus behavior reported?
Comment #4
grndlvl commentedApplied changes requested by comment #2.
Also tested patch all looks good.
Comment #5
cwgordon7 commentedThe patch looks great; however, one minor little nitpick that's probably outside the scope of the patch - while you're cleaning up the other test cases' getInfo() implementations, would you mind running their descriptions through t()? :)
Comment #6
grndlvl commentedwent ahead and wrapped the descriptions in t() per comment #5 patch also contains #4.
Comment #7
grndlvl commentedComment #8
catchDid some very minor cleanup on the code comments, ran the tests, should be RTBC.
Comment #9
webchickAs long as we're cleaning things up:
Those both need "Impementation of ..." PHPDoc.
That doesn't seem to be what the code below does? It looks like it's setting it to the 'right' region?
And there is at least one other tests missing here. Namely, if the user votes on a poll, the block should switch from showing a list of choices to showing the list of results. Make sure you're on a page other than the poll page to check this. Ideally, this goes before the test to see if the current poll is overwritten by the newer poll.
Comment #10
grndlvl commentedMade suggested changes from comment #9.
- Now checks if block shows results and is replaced when new poll is created.
Comment #11
grndlvl commentedComment #12
Anonymous (not verified) commentedThe last submitted patch failed testing.
Comment #13
catchMoving this out of the critical bugs queue - see #607038: Meta issue: fix gaps in code coverage.
Comment #14
amateescu commentedPoll.module has a test for this at:
http://drupalcode.org/project/drupal.git/blob/refs/heads/7.x:/modules/po...