Skip to content

Commit

Permalink
resolving feature 'ordering' issue causing failures of dependency con…
Browse files Browse the repository at this point in the history
…ditions that do not fail when features are run separately. in short: it's the redcap parser's fault
  • Loading branch information
Mark Yoon committed Apr 3, 2012
1 parent d06dc03 commit 6f5dc6e
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 6 deletions.
2 changes: 0 additions & 2 deletions app/views/surveyor/export.json.rabl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Rabl.configure {|config| config.include_json_root = false }

object @survey
attribute :title
attribute :api_id => :uuid
Expand Down
52 changes: 50 additions & 2 deletions features/export_to_json.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Feature: Survey export
As a user
As an api consumer
I want to represent a survey in JSON
So that I can use it offline

Expand Down Expand Up @@ -38,4 +38,52 @@ Feature: Survey export
{ "uuid": "*", "reference": "2b", "pick": "any", "text": "Choose the colors you don't like", "answers": [{"text": "orange"},{"text": "purple"},{"text": "brown"},{"text": "Omit", "exclusive": "true"}]}]
}]
}
"""
"""

# Scenario: Exporting response sets
# Given I parse
# """
# survey "Simple json response sets" do
# section "Colors" do
#
# question_1 "What is your favorite color?", :pick => :one
# answer "red"
# answer "blue"
# answer "green"
# answer :other
#
# q_2b "What color don't you like?"
# a_1 "color", :string
# end
# end
# """
# When I start the "Simple json" survey
# And I choose "red"
# And I fill in "color" with "orange"
# And I press "Click here to finish"
# Then there should be 1 response set with 2 responses with:
# | answer |
# | red |
# | orange |
# And the json for the last response set should be
# """
# {
# "uuid":"*",
# "survey_id":"*",
# "created_at":"*",
# "completed_at":"*",
# "responses":[{
# "uuid":"*",
# "answer_id":"*",
# "question_id":"*"
# "created_at":"*",
# "modified_at":"*"
# },{
# "uuid":"*",
# "answer_id":"*",
# "question_id":"*"
# "created_at":"*",
# "modified_at":"*"
# }]
# }
# """
2 changes: 1 addition & 1 deletion features/surveyor_parser.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Feature: Survey parser
As a
As a developer
I want to write out the survey in the DSL
So that I can give it to survey participants

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# 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
As a developer
I want to write out the survey in the DSL
So that I can give it to survey participants

Expand Down

0 comments on commit 6f5dc6e

Please sign in to comment.