summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJames Phillpotts <jphillpotts@scottlogic.co.uk>2014-04-10 10:29:17 +0100
committerAaron O'Mullan <aaron.omullan@friendco.de>2014-04-12 01:26:03 -0700
commitb07681a16a291a38fdbdfa3065a747ab26f9a6c9 (patch)
treeffb07c822518e689e619dc1ac8780f10877f7b7f /test
parentf6595f51119baca04bf91e619f64518d400e5cae (diff)
downloadgitbook-b07681a16a291a38fdbdfa3065a747ab26f9a6c9.zip
gitbook-b07681a16a291a38fdbdfa3065a747ab26f9a6c9.tar.gz
gitbook-b07681a16a291a38fdbdfa3065a747ab26f9a6c9.tar.bz2
Quiz with GFM checkbox lists
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/QUIZ_PAGE.md16
-rw-r--r--test/page.js9
2 files changed, 18 insertions, 7 deletions
diff --git a/test/fixtures/QUIZ_PAGE.md b/test/fixtures/QUIZ_PAGE.md
index f494592..545d083 100644
--- a/test/fixtures/QUIZ_PAGE.md
+++ b/test/fixtures/QUIZ_PAGE.md
@@ -8,14 +8,22 @@ Here's a quiz about Gitbook
| | Good | Bad |
| ---------------- | ---- | --- |
-| What is Gitbook? | ( ) | ( ) |
-
-| | Good | Bad |
-| ---------------- | ---- | --- |
| What is Gitbook? | (x) | ( ) |
> Gitbook is good
+What does Gitbook support?
+- [x] Table-based questions with radio buttons
+- [x] Table-based questions with checkboxes
+- [ ] Telepathy
+- [x] List-based questions with checkboxes
+- [x] List-based questions with radio buttons
+- [ ] Moon-on-a-stick
+
+> Gitbook supports table and list based quiz questions using either radio buttons or checkboxes.
+>
+> Gitbook is not telepathic and does not give you the moon on a stick.
+
---
Some more nice content ....
diff --git a/test/page.js b/test/page.js
index 2954155..7abe0af 100644
--- a/test/page.js
+++ b/test/page.js
@@ -67,9 +67,12 @@ describe('Page parsing', function() {
it('should render a quiz', function() {
assert(QUIZ_LEXED[1].content);
assert(QUIZ_LEXED[1].quiz);
- assert(QUIZ_LEXED[1].quiz.base);
- assert(QUIZ_LEXED[1].quiz.solution);
- assert(QUIZ_LEXED[1].quiz.feedback);
+ assert(QUIZ_LEXED[1].quiz[0].base);
+ assert(QUIZ_LEXED[1].quiz[0].solution);
+ assert(QUIZ_LEXED[1].quiz[0].feedback);
+ assert(QUIZ_LEXED[1].quiz[1].base);
+ assert(QUIZ_LEXED[1].quiz[1].solution);
+ assert(QUIZ_LEXED[1].quiz[1].feedback);
});
});