forked from NUBIC/surveyor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathz_redcap_parser.feature
60 lines (57 loc) · 2.02 KB
/
z_redcap_parser.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# The redcap parser feature should run last. If it runs in between other features that use the surveyor parser,
# it causes the DependencyCondition before_save :resolve_references hook to stop running, causing hard to trace failures.
Feature: Survey import from REDCap
As a developer
I want to write out the survey in the DSL
So that I can give it to survey participants
Scenario: Basic questions from REDCap
Given I parse redcap file "REDCapDemoDatabase_DataDictionary.csv"
Then there should be 1 survey with:
||
And there should be 143 questions with:
||
And there should be 233 answers with:
||
And there should be 3 resolved dependency_conditions with:
||
And there should be 2 dependencies with:
| rule |
| A |
| A and B |
Scenario: Question level dependencies from REDCap
Given I parse redcap file "redcap_siblings.csv"
Then there should be 1 survey with:
||
And there should be 2 questions with:
||
And there should be 2 answers with:
||
And there should be 1 resolved dependency_conditions with:
| rule_key |
| A |
And there should be 1 dependencies with:
| rule |
| A |
Scenario: with different headers from REDCap
Given I parse redcap file "redcap_new_headers.csv"
Then there should be 1 survey with:
||
And there should be 1 questions with:
||
And there should be 2 answers with:
||
Scenario: with different whitespace from REDCap
Given I parse redcap file "redcap_whitespace.csv"
Then there should be 1 survey with:
||
And there should be 2 questions with:
||
And there should be 7 answers with:
| reference_identifier | text |
| 1 | Lexapro |
| 2 | Celexa |
| 3 | Prozac |
| 4 | Paxil |
| 5 | Zoloft |
| 0 | No |
| 1 | Yes |