surveyor 0.18.2 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. data/.gitignore +2 -1
  2. data/CHANGELOG +12 -0
  3. data/Rakefile +1 -0
  4. data/VERSION +1 -1
  5. data/app/helpers/surveyor_helper.rb +40 -22
  6. data/app/views/layouts/surveyor_default.html.erb +0 -1
  7. data/app/views/partials/_answer.html.haml +19 -58
  8. data/app/views/partials/_dependents.html.haml +5 -0
  9. data/app/views/partials/_question.html.haml +24 -72
  10. data/app/views/partials/_question_group.html.haml +30 -39
  11. data/app/views/partials/_section.html.haml +10 -11
  12. data/app/views/partials/_section_menu.html.haml +5 -0
  13. data/app/views/surveyor/edit.html.haml +13 -25
  14. data/app/views/surveyor/new.html.haml +6 -3
  15. data/features/{redcap.feature → redcap_parser.feature} +0 -0
  16. data/features/step_definitions/parser_steps.rb +71 -0
  17. data/features/step_definitions/surveyor_steps.rb +8 -78
  18. data/features/support/paths.rb +2 -0
  19. data/features/surveyor.feature +30 -168
  20. data/features/surveyor_parser.feature +157 -0
  21. data/generators/surveyor/surveyor_generator.rb +2 -1
  22. data/generators/surveyor/templates/assets/images/next.gif +0 -0
  23. data/generators/surveyor/templates/assets/images/prev.gif +0 -0
  24. data/generators/surveyor/templates/assets/javascripts/jquery.surveyor.js +46 -0
  25. data/generators/surveyor/templates/assets/javascripts/jquery.tools.min.js +204 -0
  26. data/generators/surveyor/templates/assets/stylesheets/dateinput.css +149 -0
  27. data/generators/surveyor/templates/assets/stylesheets/sass/surveyor.sass +84 -226
  28. data/generators/surveyor/templates/migrate/add_default_value_to_answers.rb +9 -0
  29. data/lib/formtastic/surveyor_builder.rb +83 -0
  30. data/lib/surveyor.rb +5 -0
  31. data/lib/surveyor/models/answer_methods.rb +8 -3
  32. data/lib/surveyor/models/question_group_methods.rb +1 -1
  33. data/lib/surveyor/models/question_methods.rb +6 -2
  34. data/lib/surveyor/models/response_methods.rb +2 -12
  35. data/lib/surveyor/models/response_set_methods.rb +25 -71
  36. data/lib/surveyor/surveyor_controller_methods.rb +29 -28
  37. data/lib/tasks/surveyor_tasks.rake +1 -15
  38. data/spec/controllers/surveyor_controller_spec.rb +40 -8
  39. data/spec/helpers/surveyor_helper_spec.rb +53 -0
  40. data/spec/models/answer_spec.rb +14 -9
  41. data/spec/models/dependency_condition_spec.rb +56 -61
  42. data/spec/models/question_group_spec.rb +3 -3
  43. data/spec/models/question_spec.rb +10 -0
  44. data/spec/models/response_set_spec.rb +72 -62
  45. data/surveyor.gemspec +21 -58
  46. data/testbed/Gemfile +1 -0
  47. metadata +34 -60
  48. data/app/helpers/survey_form_builder.rb +0 -37
  49. data/generators/surveyor/templates/assets/images/222222_11x11_icon_arrows_leftright.gif +0 -0
  50. data/generators/surveyor/templates/assets/images/222222_11x11_icon_arrows_updown.gif +0 -0
  51. data/generators/surveyor/templates/assets/images/222222_11x11_icon_close.gif +0 -0
  52. data/generators/surveyor/templates/assets/images/222222_11x11_icon_doc.gif +0 -0
  53. data/generators/surveyor/templates/assets/images/222222_11x11_icon_folder_closed.gif +0 -0
  54. data/generators/surveyor/templates/assets/images/222222_11x11_icon_folder_open.gif +0 -0
  55. data/generators/surveyor/templates/assets/images/222222_11x11_icon_minus.gif +0 -0
  56. data/generators/surveyor/templates/assets/images/222222_11x11_icon_plus.gif +0 -0
  57. data/generators/surveyor/templates/assets/images/222222_11x11_icon_resize_se.gif +0 -0
  58. data/generators/surveyor/templates/assets/images/222222_35x9_colorpicker_indicator.gif.gif +0 -0
  59. data/generators/surveyor/templates/assets/images/222222_7x7_arrow_down.gif +0 -0
  60. data/generators/surveyor/templates/assets/images/222222_7x7_arrow_left.gif +0 -0
  61. data/generators/surveyor/templates/assets/images/222222_7x7_arrow_right.gif +0 -0
  62. data/generators/surveyor/templates/assets/images/222222_7x7_arrow_up.gif +0 -0
  63. data/generators/surveyor/templates/assets/images/454545_11x11_icon_arrows_leftright.gif +0 -0
  64. data/generators/surveyor/templates/assets/images/454545_11x11_icon_arrows_updown.gif +0 -0
  65. data/generators/surveyor/templates/assets/images/454545_11x11_icon_close.gif +0 -0
  66. data/generators/surveyor/templates/assets/images/454545_11x11_icon_doc.gif +0 -0
  67. data/generators/surveyor/templates/assets/images/454545_11x11_icon_folder_closed.gif +0 -0
  68. data/generators/surveyor/templates/assets/images/454545_11x11_icon_folder_open.gif +0 -0
  69. data/generators/surveyor/templates/assets/images/454545_11x11_icon_minus.gif +0 -0
  70. data/generators/surveyor/templates/assets/images/454545_11x11_icon_plus.gif +0 -0
  71. data/generators/surveyor/templates/assets/images/454545_7x7_arrow_down.gif +0 -0
  72. data/generators/surveyor/templates/assets/images/454545_7x7_arrow_left.gif +0 -0
  73. data/generators/surveyor/templates/assets/images/454545_7x7_arrow_right.gif +0 -0
  74. data/generators/surveyor/templates/assets/images/454545_7x7_arrow_up.gif +0 -0
  75. data/generators/surveyor/templates/assets/images/888888_11x11_icon_arrows_leftright.gif +0 -0
  76. data/generators/surveyor/templates/assets/images/888888_11x11_icon_arrows_updown.gif +0 -0
  77. data/generators/surveyor/templates/assets/images/888888_11x11_icon_close.gif +0 -0
  78. data/generators/surveyor/templates/assets/images/888888_11x11_icon_doc.gif +0 -0
  79. data/generators/surveyor/templates/assets/images/888888_11x11_icon_folder_closed.gif +0 -0
  80. data/generators/surveyor/templates/assets/images/888888_11x11_icon_folder_open.gif +0 -0
  81. data/generators/surveyor/templates/assets/images/888888_11x11_icon_minus.gif +0 -0
  82. data/generators/surveyor/templates/assets/images/888888_11x11_icon_plus.gif +0 -0
  83. data/generators/surveyor/templates/assets/images/888888_7x7_arrow_down.gif +0 -0
  84. data/generators/surveyor/templates/assets/images/888888_7x7_arrow_left.gif +0 -0
  85. data/generators/surveyor/templates/assets/images/888888_7x7_arrow_right.gif +0 -0
  86. data/generators/surveyor/templates/assets/images/888888_7x7_arrow_up.gif +0 -0
  87. data/generators/surveyor/templates/assets/images/dadada_40x100_textures_02_glass_75.png +0 -0
  88. data/generators/surveyor/templates/assets/images/e6e6e6_40x100_textures_02_glass_75.png +0 -0
  89. data/generators/surveyor/templates/assets/images/ffffff_40x100_textures_01_flat_0.png +0 -0
  90. data/generators/surveyor/templates/assets/images/ffffff_40x100_textures_02_glass_65.png +0 -0
  91. data/generators/surveyor/templates/assets/javascripts/accessibleUISlider.jQuery.js +0 -201
  92. data/generators/surveyor/templates/assets/javascripts/jquery-1.2.6.js +0 -3549
  93. data/generators/surveyor/templates/assets/javascripts/jquery-ui-personalized-1.5.3.js +0 -7616
  94. data/generators/surveyor/templates/assets/javascripts/jquery.form.js +0 -637
  95. data/generators/surveyor/templates/assets/javascripts/surveyor.js +0 -40
  96. data/generators/surveyor/templates/assets/stylesheets/jquery-ui-slider-additions.css +0 -71
  97. data/generators/surveyor/templates/assets/stylesheets/ui.theme.css +0 -851
  98. data/spec/views/surveyor/show.html.haml_spec.rb +0 -32
  99. data/uninstall.rb +0 -1
@@ -1,32 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
-
3
-
4
- describe "surveyor/show" do
5
- before(:each) do
6
- @survey = Factory(:survey, :title => "xyz", :access_code => "xyz", :sections => [Factory(:survey_section)])
7
- @survey.sections.first.questions=Array.new(3) {Factory(:question)}
8
- template.stub!(:next_number).and_return(1)
9
- end
10
-
11
- it "should render _question partial,if question is not part of a question_group" do
12
- @survey.sections.first.questions.each{|q| q.stub(:part_of_group?).and_return(false)}
13
- assigns[:survey] = @survey
14
- expect_render_partial_calls('question', 3)
15
- end
16
-
17
- it "should render _question_group partial for a group of questions" do
18
- question_group = Factory.create(:question_group)
19
- # Assosciate all questions with the question_group
20
- @survey.sections.first.questions.each{|q| q.question_group = question_group}
21
- assigns[:survey] = @survey
22
- expect_render_partial_calls('question_group', 1)
23
- end
24
-
25
- def expect_render_partial_calls(partial_name, num_calls)
26
- # Excpection regaring calls to render :partial
27
- template.should_receive(:render).exactly(num_calls).times.with(hash_including(:partial => "/partials/#{partial_name}"))
28
- render "surveyor/show.html.haml"
29
- end
30
-
31
-
32
- end
data/uninstall.rb DELETED
@@ -1 +0,0 @@
1
- # Uninstall hook code here