breakpointer-surveyor 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +6 -0
- data/MIT-LICENSE +20 -0
- data/README.md +20 -0
- data/Rakefile +57 -0
- data/VERSION +1 -0
- data/app/controllers/answers_controller.rb +87 -0
- data/app/controllers/dependencies_controller.rb +87 -0
- data/app/controllers/dependency_conditions_controller.rb +87 -0
- data/app/controllers/questions_controller.rb +85 -0
- data/app/controllers/sections_controller.rb +87 -0
- data/app/controllers/surveying_controller.rb +139 -0
- data/app/controllers/surveys_controller.rb +87 -0
- data/app/helpers/answers_helper.rb +2 -0
- data/app/helpers/application_helper.rb +3 -0
- data/app/helpers/questions_helper.rb +2 -0
- data/app/helpers/sections_helper.rb +2 -0
- data/app/helpers/survey_form_builder.rb +38 -0
- data/app/helpers/survey_importer_helper.rb +2 -0
- data/app/helpers/surveying_helper.rb +91 -0
- data/app/helpers/surveys_helper.rb +2 -0
- data/app/models/answer.rb +18 -0
- data/app/models/dependency.rb +43 -0
- data/app/models/dependency_condition.rb +76 -0
- data/app/models/question.rb +44 -0
- data/app/models/question_group.rb +5 -0
- data/app/models/response.rb +58 -0
- data/app/models/response_set.rb +174 -0
- data/app/models/survey.rb +54 -0
- data/app/models/survey_section.rb +19 -0
- data/app/models/user.rb +5 -0
- data/app/views/answer_display_types/_any_answer.html.haml +3 -0
- data/app/views/answer_display_types/_any_other_and_string.html.haml +5 -0
- data/app/views/answer_display_types/_any_string.html.haml +4 -0
- data/app/views/answer_display_types/_date.html.haml +3 -0
- data/app/views/answer_display_types/_datetime.html.haml +2 -0
- data/app/views/answer_display_types/_default.html.haml +1 -0
- data/app/views/answer_display_types/_float.html.haml +5 -0
- data/app/views/answer_display_types/_grid_any_answer.html.haml +2 -0
- data/app/views/answer_display_types/_grid_default.html.haml +2 -0
- data/app/views/answer_display_types/_grid_float.html.haml +2 -0
- data/app/views/answer_display_types/_grid_integer.html.haml +2 -0
- data/app/views/answer_display_types/_grid_one_answer.html.haml +2 -0
- data/app/views/answer_display_types/_grid_string.html.haml +2 -0
- data/app/views/answer_display_types/_integer.html.haml +6 -0
- data/app/views/answer_display_types/_one_answer.html.haml +3 -0
- data/app/views/answer_display_types/_one_string.html.haml +6 -0
- data/app/views/answer_display_types/_repeater_integer.html.haml +6 -0
- data/app/views/answer_display_types/_repeater_string.html.haml +7 -0
- data/app/views/answer_display_types/_string.html.haml +7 -0
- data/app/views/answer_display_types/_text.html.haml +6 -0
- data/app/views/answer_display_types/_time.html.haml +2 -0
- data/app/views/layouts/surveys.html.erb +17 -0
- data/app/views/question_display_types/_default.html.haml +12 -0
- data/app/views/question_display_types/_dropdown.html.haml +12 -0
- data/app/views/question_display_types/_grid_default.html.haml +14 -0
- data/app/views/question_display_types/_grid_dropdown.html.haml +15 -0
- data/app/views/question_display_types/_group_default.html.haml +8 -0
- data/app/views/question_display_types/_group_dropdown.html.haml +6 -0
- data/app/views/question_display_types/_image.html.haml +2 -0
- data/app/views/question_display_types/_inline.html.haml +12 -0
- data/app/views/question_display_types/_label.html.haml +4 -0
- data/app/views/question_display_types/_repeater_default.html.haml +10 -0
- data/app/views/question_display_types/_repeater_dropdown.html.haml +8 -0
- data/app/views/question_display_types/_slider.html.haml +17 -0
- data/app/views/question_group_display_types/_default.html.haml +13 -0
- data/app/views/question_group_display_types/_grid.html.haml +24 -0
- data/app/views/question_group_display_types/_repeater.html.haml +20 -0
- data/app/views/surveying/edit.html.haml +38 -0
- data/app/views/surveying/finish.html.haml +1 -0
- data/app/views/surveying/index.html.erb +19 -0
- data/app/views/surveying/new.html.haml +17 -0
- data/app/views/surveying/show.html.haml +8 -0
- data/config/routes.rb +10 -0
- data/generators/surveyor/surveyor_generator.rb +38 -0
- data/generators/surveyor/templates/README +9 -0
- data/generators/surveyor/templates/assets/images/222222_11x11_icon_arrows_leftright.gif +0 -0
- data/generators/surveyor/templates/assets/images/222222_11x11_icon_arrows_updown.gif +0 -0
- data/generators/surveyor/templates/assets/images/222222_11x11_icon_close.gif +0 -0
- data/generators/surveyor/templates/assets/images/222222_11x11_icon_doc.gif +0 -0
- data/generators/surveyor/templates/assets/images/222222_11x11_icon_folder_closed.gif +0 -0
- data/generators/surveyor/templates/assets/images/222222_11x11_icon_folder_open.gif +0 -0
- data/generators/surveyor/templates/assets/images/222222_11x11_icon_minus.gif +0 -0
- data/generators/surveyor/templates/assets/images/222222_11x11_icon_plus.gif +0 -0
- data/generators/surveyor/templates/assets/images/222222_11x11_icon_resize_se.gif +0 -0
- data/generators/surveyor/templates/assets/images/222222_35x9_colorpicker_indicator.gif.gif +0 -0
- data/generators/surveyor/templates/assets/images/222222_7x7_arrow_down.gif +0 -0
- data/generators/surveyor/templates/assets/images/222222_7x7_arrow_left.gif +0 -0
- data/generators/surveyor/templates/assets/images/222222_7x7_arrow_right.gif +0 -0
- data/generators/surveyor/templates/assets/images/222222_7x7_arrow_up.gif +0 -0
- data/generators/surveyor/templates/assets/images/454545_11x11_icon_arrows_leftright.gif +0 -0
- data/generators/surveyor/templates/assets/images/454545_11x11_icon_arrows_updown.gif +0 -0
- data/generators/surveyor/templates/assets/images/454545_11x11_icon_close.gif +0 -0
- data/generators/surveyor/templates/assets/images/454545_11x11_icon_doc.gif +0 -0
- data/generators/surveyor/templates/assets/images/454545_11x11_icon_folder_closed.gif +0 -0
- data/generators/surveyor/templates/assets/images/454545_11x11_icon_folder_open.gif +0 -0
- data/generators/surveyor/templates/assets/images/454545_11x11_icon_minus.gif +0 -0
- data/generators/surveyor/templates/assets/images/454545_11x11_icon_plus.gif +0 -0
- data/generators/surveyor/templates/assets/images/454545_7x7_arrow_down.gif +0 -0
- data/generators/surveyor/templates/assets/images/454545_7x7_arrow_left.gif +0 -0
- data/generators/surveyor/templates/assets/images/454545_7x7_arrow_right.gif +0 -0
- data/generators/surveyor/templates/assets/images/454545_7x7_arrow_up.gif +0 -0
- data/generators/surveyor/templates/assets/images/888888_11x11_icon_arrows_leftright.gif +0 -0
- data/generators/surveyor/templates/assets/images/888888_11x11_icon_arrows_updown.gif +0 -0
- data/generators/surveyor/templates/assets/images/888888_11x11_icon_close.gif +0 -0
- data/generators/surveyor/templates/assets/images/888888_11x11_icon_doc.gif +0 -0
- data/generators/surveyor/templates/assets/images/888888_11x11_icon_folder_closed.gif +0 -0
- data/generators/surveyor/templates/assets/images/888888_11x11_icon_folder_open.gif +0 -0
- data/generators/surveyor/templates/assets/images/888888_11x11_icon_minus.gif +0 -0
- data/generators/surveyor/templates/assets/images/888888_11x11_icon_plus.gif +0 -0
- data/generators/surveyor/templates/assets/images/888888_7x7_arrow_down.gif +0 -0
- data/generators/surveyor/templates/assets/images/888888_7x7_arrow_left.gif +0 -0
- data/generators/surveyor/templates/assets/images/888888_7x7_arrow_right.gif +0 -0
- data/generators/surveyor/templates/assets/images/888888_7x7_arrow_up.gif +0 -0
- data/generators/surveyor/templates/assets/images/dadada_40x100_textures_02_glass_75.png +0 -0
- data/generators/surveyor/templates/assets/images/e6e6e6_40x100_textures_02_glass_75.png +0 -0
- data/generators/surveyor/templates/assets/images/ffffff_40x100_textures_01_flat_0.png +0 -0
- data/generators/surveyor/templates/assets/images/ffffff_40x100_textures_02_glass_65.png +0 -0
- data/generators/surveyor/templates/assets/javascripts/accessibleUISlider.jQuery.js +201 -0
- data/generators/surveyor/templates/assets/javascripts/jquery-1.2.6.js +3549 -0
- data/generators/surveyor/templates/assets/javascripts/jquery-ui-personalized-1.5.3.js +7616 -0
- data/generators/surveyor/templates/assets/javascripts/jquery.form.js +637 -0
- data/generators/surveyor/templates/assets/javascripts/surveyor.js +35 -0
- data/generators/surveyor/templates/assets/stylesheets/jquery-ui-slider-additions.css +71 -0
- data/generators/surveyor/templates/assets/stylesheets/reset.css +46 -0
- data/generators/surveyor/templates/assets/stylesheets/sass/surveyor.sass +321 -0
- data/generators/surveyor/templates/assets/stylesheets/surveyor.css +245 -0
- data/generators/surveyor/templates/assets/stylesheets/ui.theme.css +851 -0
- data/generators/surveyor/templates/migrate/create_answers.rb +46 -0
- data/generators/surveyor/templates/migrate/create_dependencies.rb +21 -0
- data/generators/surveyor/templates/migrate/create_dependency_conditions.rb +29 -0
- data/generators/surveyor/templates/migrate/create_question_groups.rb +18 -0
- data/generators/surveyor/templates/migrate/create_questions.rb +33 -0
- data/generators/surveyor/templates/migrate/create_response_sets.rb +22 -0
- data/generators/surveyor/templates/migrate/create_responses.rb +33 -0
- data/generators/surveyor/templates/migrate/create_survey_sections.rb +25 -0
- data/generators/surveyor/templates/migrate/create_surveys.rb +25 -0
- data/generators/surveyor/templates/surveys/kitchen_sink_survey.rb +201 -0
- data/init.rb +1 -0
- data/install.rb +1 -0
- data/lib/tasks/surveyor_tasks.rake +29 -0
- data/lib/tiny_code.rb +58 -0
- data/lib/user_manager.rb +9 -0
- data/lib/xml_formatter.rb +12 -0
- data/script/surveyor/answer.rb +84 -0
- data/script/surveyor/columnizer.rb +36 -0
- data/script/surveyor/dependency.rb +43 -0
- data/script/surveyor/dependency_condition.rb +74 -0
- data/script/surveyor/dslparse.rb +66 -0
- data/script/surveyor/question.rb +76 -0
- data/script/surveyor/question_group.rb +33 -0
- data/script/surveyor/specs/answer_spec.rb +66 -0
- data/script/surveyor/specs/question_dependency_spec.rb +46 -0
- data/script/surveyor/specs/question_group_spec.rb +9 -0
- data/script/surveyor/specs/question_spec.rb +111 -0
- data/script/surveyor/specs/section_spec.rb +58 -0
- data/script/surveyor/survey.rb +108 -0
- data/script/surveyor/survey_section.rb +153 -0
- data/script/surveyor/whr_dsl.tmproj +244 -0
- data/spec/controllers/answers_controller_spec.rb +64 -0
- data/spec/controllers/dependencies_controller_spec.rb +63 -0
- data/spec/controllers/dependency_conditions_controller_spec.rb +64 -0
- data/spec/controllers/questions_controller_spec.rb +64 -0
- data/spec/controllers/sections_controller_spec.rb +64 -0
- data/spec/controllers/surveying_controller_spec.rb +328 -0
- data/spec/controllers/surveying_routing_spec.rb +45 -0
- data/spec/controllers/surveys_controller_spec.rb +64 -0
- data/spec/fixtures/answers.yml +9 -0
- data/spec/fixtures/dependencies.yml +7 -0
- data/spec/fixtures/dependency_conditions.yml +27 -0
- data/spec/fixtures/question_groups.yml +7 -0
- data/spec/fixtures/questions.yml +15 -0
- data/spec/fixtures/response_sets.yml +13 -0
- data/spec/fixtures/responses.yml +9 -0
- data/spec/fixtures/survey_sections.yml +11 -0
- data/spec/fixtures/surveys.yml +9 -0
- data/spec/fixtures/users.yml +7 -0
- data/spec/helpers/survey_importer_helper_spec.rb +11 -0
- data/spec/helpers/surveying_helper_spec.rb +11 -0
- data/spec/models/answer_spec.rb +62 -0
- data/spec/models/dependency_condition_spec.rb +347 -0
- data/spec/models/dependency_spec.rb +82 -0
- data/spec/models/question_group_spec.rb +11 -0
- data/spec/models/question_spec.rb +70 -0
- data/spec/models/response_set_spec.rb +172 -0
- data/spec/models/response_spec.rb +94 -0
- data/spec/models/survey_section_spec.rb +34 -0
- data/spec/models/survey_spec.rb +72 -0
- data/spec/models/user_spec.rb +11 -0
- data/spec/rcov.opts +2 -0
- data/spec/spec.opts +4 -0
- data/spec/spec_helper.rb +72 -0
- data/spec/views/app/edit.html.erb_spec.rb +20 -0
- data/spec/views/app/index.html.erb_spec.rb +19 -0
- data/spec/views/app/new.html.erb_spec.rb +21 -0
- data/spec/views/app/show.html.erb_spec.rb +17 -0
- data/surveyor.gemspec +258 -0
- data/uninstall.rb +1 -0
- metadata +286 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
|
2
|
+
|
|
3
|
+
# Validations
|
|
4
|
+
describe Survey, "when saving a new one" do
|
|
5
|
+
before(:each) do
|
|
6
|
+
@survey = Survey.new
|
|
7
|
+
@survey.title = "Foo"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "should be invalid without a title" do
|
|
11
|
+
@survey.title = nil
|
|
12
|
+
@survey.should have(1).error_on(:title)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Associations
|
|
17
|
+
describe Survey, "that has sections" do
|
|
18
|
+
before(:each) do
|
|
19
|
+
@survey = Survey.create(:title => "foo")
|
|
20
|
+
@s1 = @survey.sections.create(:title => "wise", :display_order => 2)
|
|
21
|
+
@s2 = @survey.sections.create(:title => "er", :display_order => 3)
|
|
22
|
+
@s3 = @survey.sections.create(:title => "bud", :display_order => 1)
|
|
23
|
+
@q1 = @s1.questions.create(:text => "what is wise?")
|
|
24
|
+
@q2 = @s2.questions.create(:text => "what is er?", :display_order => 2)
|
|
25
|
+
@q3 = @s2.questions.create(:text => "what is mill?", :display_order => 1)
|
|
26
|
+
@q4 = @s3.questions.create(:text => "what is bud?")
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it "should return survey_sections in display order" do
|
|
30
|
+
@survey.sections.should have(3).sections
|
|
31
|
+
@survey.sections.should == [@s3, @s1, @s2]
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it "should return survey_sections_with_questions in display order" do
|
|
35
|
+
@survey.sections_with_questions.map(&:questions).flatten.should have(4).questions
|
|
36
|
+
@survey.sections_with_questions.map(&:questions).flatten.should == [@q4,@q1,@q3,@q2]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Methods
|
|
42
|
+
describe Survey do
|
|
43
|
+
before(:each) do
|
|
44
|
+
@survey = Survey.new
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
it "should be inactive by default" do
|
|
48
|
+
@survey.active?.should == false
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
it "should be active or active as of a certain date/time" do
|
|
52
|
+
@survey.inactive_at = 3.days.ago
|
|
53
|
+
@survey.active_at = 2.days.ago
|
|
54
|
+
@survey.active?.should be_true
|
|
55
|
+
@survey.inactive_at.should be_nil
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
it "should be able to deactivate as of a certain date/time" do
|
|
59
|
+
@survey.active_at = 2.days.ago
|
|
60
|
+
@survey.inactive_at = 3.days.ago
|
|
61
|
+
@survey.active?.should be_false
|
|
62
|
+
@survey.active_at.should be_nil
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
it "should activate and deactivate" do
|
|
66
|
+
@survey.activate!
|
|
67
|
+
@survey.active?.should be_true
|
|
68
|
+
@survey.deactivate!
|
|
69
|
+
@survey.active?.should be_false
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
end
|
data/spec/rcov.opts
ADDED
data/spec/spec.opts
ADDED
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
|
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
|
3
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../../../config/environment")
|
|
4
|
+
|
|
5
|
+
require 'spec'
|
|
6
|
+
require 'spec/rails'
|
|
7
|
+
|
|
8
|
+
# class Test::Unit::TestCase
|
|
9
|
+
# class << self
|
|
10
|
+
# # Class method for test helpers
|
|
11
|
+
# def test_helper(*names)
|
|
12
|
+
# names.each do |name|
|
|
13
|
+
# name = name.to_s
|
|
14
|
+
# name = $1 if name =~ /^(.*?)_test_helper$/i
|
|
15
|
+
# name = name.singularize
|
|
16
|
+
# first_time = true
|
|
17
|
+
# begin
|
|
18
|
+
# constant = (name.camelize + 'TestHelper').constantize
|
|
19
|
+
# self.class_eval { include constant }
|
|
20
|
+
# rescue NameError
|
|
21
|
+
# filename = File.expand_path(SPEC_ROOT + '/../test/helpers/' + name + '_test_helper.rb')
|
|
22
|
+
# require filename if first_time
|
|
23
|
+
# first_time = false
|
|
24
|
+
# retry
|
|
25
|
+
# end
|
|
26
|
+
# end
|
|
27
|
+
# end
|
|
28
|
+
# alias :test_helpers :test_helper
|
|
29
|
+
# end
|
|
30
|
+
# end
|
|
31
|
+
#
|
|
32
|
+
|
|
33
|
+
# Spec::Runner.configure do |config|
|
|
34
|
+
# # If you're not using ActiveRecord you should remove these
|
|
35
|
+
# # lines, delete config/database.yml and disable :active_record
|
|
36
|
+
# # in your config/boot.rb
|
|
37
|
+
# config.use_transactional_fixtures = true
|
|
38
|
+
# config.use_instantiated_fixtures = false
|
|
39
|
+
# config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
|
|
40
|
+
#
|
|
41
|
+
# # == Fixtures
|
|
42
|
+
# #
|
|
43
|
+
# # You can declare fixtures for each example_group like this:
|
|
44
|
+
# # describe "...." do
|
|
45
|
+
# # fixtures :table_a, :table_b
|
|
46
|
+
# #
|
|
47
|
+
# # Alternatively, if you prefer to declare them only once, you can
|
|
48
|
+
# # do so right here. Just uncomment the next line and replace the fixture
|
|
49
|
+
# # names with your fixtures.
|
|
50
|
+
# #
|
|
51
|
+
# # config.global_fixtures = :table_a, :table_b
|
|
52
|
+
# #
|
|
53
|
+
# # If you declare global fixtures, be aware that they will be declared
|
|
54
|
+
# # for all of your examples, even those that don't use them.
|
|
55
|
+
# #
|
|
56
|
+
# # You can also declare which fixtures to use (for example fixtures for test/fixtures):
|
|
57
|
+
# #
|
|
58
|
+
# # config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
|
|
59
|
+
# #
|
|
60
|
+
# # == Mock Framework
|
|
61
|
+
# #
|
|
62
|
+
# # RSpec uses it's own mocking framework by default. If you prefer to
|
|
63
|
+
# # use mocha, flexmock or RR, uncomment the appropriate line:
|
|
64
|
+
# #
|
|
65
|
+
# # config.mock_with :mocha
|
|
66
|
+
# # config.mock_with :flexmock
|
|
67
|
+
# # config.mock_with :rr
|
|
68
|
+
# #
|
|
69
|
+
# # == Notes
|
|
70
|
+
# #
|
|
71
|
+
# # For more information take a look at Spec::Example::Configuration and Spec::Runner
|
|
72
|
+
# end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "/surveys/edit.html.erb" do
|
|
4
|
+
include AppHelper
|
|
5
|
+
|
|
6
|
+
before do
|
|
7
|
+
@survey = mock_model(Survey)
|
|
8
|
+
assigns[:survey] = @survey
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it "should render edit form" do
|
|
12
|
+
pending
|
|
13
|
+
render "/surveys/edit.html.erb"
|
|
14
|
+
|
|
15
|
+
response.should have_tag("form[action=#{survey_path(@survey)}][method=post]") do
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "/surveys/index.html.erb" do
|
|
4
|
+
include AppHelper
|
|
5
|
+
|
|
6
|
+
before(:each) do
|
|
7
|
+
survey_98 = mock_model(Survey)
|
|
8
|
+
survey_99 = mock_model(Survey)
|
|
9
|
+
|
|
10
|
+
assigns[:surveys] = [survey_98, survey_99]
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
it "should render list of surveys" do
|
|
14
|
+
|
|
15
|
+
pending
|
|
16
|
+
render "/surveys/index.html.erb"
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "/surveys/new.html.erb" do
|
|
4
|
+
include AppHelper
|
|
5
|
+
|
|
6
|
+
before(:each) do
|
|
7
|
+
@survey = mock_model(Survey)
|
|
8
|
+
@survey.stub!(:new_record?).and_return(true)
|
|
9
|
+
assigns[:survey] = @survey
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it "should render new form" do
|
|
13
|
+
pending
|
|
14
|
+
render "/surveys/new.html.erb"
|
|
15
|
+
|
|
16
|
+
response.should have_tag("form[action=?][method=post]", surveys_path) do
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "/surveys/show.html.erb" do
|
|
4
|
+
include AppHelper
|
|
5
|
+
|
|
6
|
+
before(:each) do
|
|
7
|
+
@survey = mock_model(Survey)
|
|
8
|
+
|
|
9
|
+
assigns[:survey] = @survey
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it "should render attributes in <p>" do
|
|
13
|
+
pending
|
|
14
|
+
render "/surveys/show.html.erb"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
data/surveyor.gemspec
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
Gem::Specification.new do |s|
|
|
4
|
+
s.name = %q{surveyor}
|
|
5
|
+
s.version = "0.2.0"
|
|
6
|
+
|
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
8
|
+
s.authors = ["Brian Chamberlain", "Mark Yoon"]
|
|
9
|
+
s.date = %q{2009-09-22}
|
|
10
|
+
s.email = ["b-chamberlain@northwestern.edu", "yoon@northwestern.edu"]
|
|
11
|
+
s.extra_rdoc_files = [
|
|
12
|
+
"README.md"
|
|
13
|
+
]
|
|
14
|
+
s.files = [
|
|
15
|
+
".gitignore",
|
|
16
|
+
"MIT-LICENSE",
|
|
17
|
+
"README.md",
|
|
18
|
+
"Rakefile",
|
|
19
|
+
"VERSION",
|
|
20
|
+
"app/controllers/answers_controller.rb",
|
|
21
|
+
"app/controllers/dependencies_controller.rb",
|
|
22
|
+
"app/controllers/dependency_conditions_controller.rb",
|
|
23
|
+
"app/controllers/questions_controller.rb",
|
|
24
|
+
"app/controllers/sections_controller.rb",
|
|
25
|
+
"app/controllers/surveying_controller.rb",
|
|
26
|
+
"app/controllers/surveys_controller.rb",
|
|
27
|
+
"app/helpers/answers_helper.rb",
|
|
28
|
+
"app/helpers/application_helper.rb",
|
|
29
|
+
"app/helpers/questions_helper.rb",
|
|
30
|
+
"app/helpers/sections_helper.rb",
|
|
31
|
+
"app/helpers/survey_form_builder.rb",
|
|
32
|
+
"app/helpers/survey_importer_helper.rb",
|
|
33
|
+
"app/helpers/surveying_helper.rb",
|
|
34
|
+
"app/helpers/surveys_helper.rb",
|
|
35
|
+
"app/models/answer.rb",
|
|
36
|
+
"app/models/dependency.rb",
|
|
37
|
+
"app/models/dependency_condition.rb",
|
|
38
|
+
"app/models/question.rb",
|
|
39
|
+
"app/models/question_group.rb",
|
|
40
|
+
"app/models/response.rb",
|
|
41
|
+
"app/models/response_set.rb",
|
|
42
|
+
"app/models/survey.rb",
|
|
43
|
+
"app/models/survey_section.rb",
|
|
44
|
+
"app/models/user.rb",
|
|
45
|
+
"app/views/answer_display_types/_any_answer.html.haml",
|
|
46
|
+
"app/views/answer_display_types/_any_other_and_string.html.haml",
|
|
47
|
+
"app/views/answer_display_types/_any_string.html.haml",
|
|
48
|
+
"app/views/answer_display_types/_date.html.haml",
|
|
49
|
+
"app/views/answer_display_types/_datetime.html.haml",
|
|
50
|
+
"app/views/answer_display_types/_default.html.haml",
|
|
51
|
+
"app/views/answer_display_types/_float.html.haml",
|
|
52
|
+
"app/views/answer_display_types/_grid_any_answer.html.haml",
|
|
53
|
+
"app/views/answer_display_types/_grid_default.html.haml",
|
|
54
|
+
"app/views/answer_display_types/_grid_float.html.haml",
|
|
55
|
+
"app/views/answer_display_types/_grid_integer.html.haml",
|
|
56
|
+
"app/views/answer_display_types/_grid_one_answer.html.haml",
|
|
57
|
+
"app/views/answer_display_types/_grid_string.html.haml",
|
|
58
|
+
"app/views/answer_display_types/_integer.html.haml",
|
|
59
|
+
"app/views/answer_display_types/_one_answer.html.haml",
|
|
60
|
+
"app/views/answer_display_types/_one_string.html.haml",
|
|
61
|
+
"app/views/answer_display_types/_repeater_integer.html.haml",
|
|
62
|
+
"app/views/answer_display_types/_repeater_string.html.haml",
|
|
63
|
+
"app/views/answer_display_types/_string.html.haml",
|
|
64
|
+
"app/views/answer_display_types/_text.html.haml",
|
|
65
|
+
"app/views/answer_display_types/_time.html.haml",
|
|
66
|
+
"app/views/layouts/surveys.html.erb",
|
|
67
|
+
"app/views/question_display_types/_default.html.haml",
|
|
68
|
+
"app/views/question_display_types/_dropdown.html.haml",
|
|
69
|
+
"app/views/question_display_types/_grid_default.html.haml",
|
|
70
|
+
"app/views/question_display_types/_grid_dropdown.html.haml",
|
|
71
|
+
"app/views/question_display_types/_group_default.html.haml",
|
|
72
|
+
"app/views/question_display_types/_group_dropdown.html.haml",
|
|
73
|
+
"app/views/question_display_types/_image.html.haml",
|
|
74
|
+
"app/views/question_display_types/_inline.html.haml",
|
|
75
|
+
"app/views/question_display_types/_label.html.haml",
|
|
76
|
+
"app/views/question_display_types/_repeater_default.html.haml",
|
|
77
|
+
"app/views/question_display_types/_repeater_dropdown.html.haml",
|
|
78
|
+
"app/views/question_display_types/_slider.html.haml",
|
|
79
|
+
"app/views/question_group_display_types/_default.html.haml",
|
|
80
|
+
"app/views/question_group_display_types/_grid.html.haml",
|
|
81
|
+
"app/views/question_group_display_types/_repeater.html.haml",
|
|
82
|
+
"app/views/surveying/edit.html.haml",
|
|
83
|
+
"app/views/surveying/finish.html.haml",
|
|
84
|
+
"app/views/surveying/index.html.erb",
|
|
85
|
+
"app/views/surveying/new.html.haml",
|
|
86
|
+
"app/views/surveying/show.html.haml",
|
|
87
|
+
"config/routes.rb",
|
|
88
|
+
"generators/surveyor/surveyor_generator.rb",
|
|
89
|
+
"generators/surveyor/templates/README",
|
|
90
|
+
"generators/surveyor/templates/assets/images/222222_11x11_icon_arrows_leftright.gif",
|
|
91
|
+
"generators/surveyor/templates/assets/images/222222_11x11_icon_arrows_updown.gif",
|
|
92
|
+
"generators/surveyor/templates/assets/images/222222_11x11_icon_close.gif",
|
|
93
|
+
"generators/surveyor/templates/assets/images/222222_11x11_icon_doc.gif",
|
|
94
|
+
"generators/surveyor/templates/assets/images/222222_11x11_icon_folder_closed.gif",
|
|
95
|
+
"generators/surveyor/templates/assets/images/222222_11x11_icon_folder_open.gif",
|
|
96
|
+
"generators/surveyor/templates/assets/images/222222_11x11_icon_minus.gif",
|
|
97
|
+
"generators/surveyor/templates/assets/images/222222_11x11_icon_plus.gif",
|
|
98
|
+
"generators/surveyor/templates/assets/images/222222_11x11_icon_resize_se.gif",
|
|
99
|
+
"generators/surveyor/templates/assets/images/222222_35x9_colorpicker_indicator.gif.gif",
|
|
100
|
+
"generators/surveyor/templates/assets/images/222222_7x7_arrow_down.gif",
|
|
101
|
+
"generators/surveyor/templates/assets/images/222222_7x7_arrow_left.gif",
|
|
102
|
+
"generators/surveyor/templates/assets/images/222222_7x7_arrow_right.gif",
|
|
103
|
+
"generators/surveyor/templates/assets/images/222222_7x7_arrow_up.gif",
|
|
104
|
+
"generators/surveyor/templates/assets/images/454545_11x11_icon_arrows_leftright.gif",
|
|
105
|
+
"generators/surveyor/templates/assets/images/454545_11x11_icon_arrows_updown.gif",
|
|
106
|
+
"generators/surveyor/templates/assets/images/454545_11x11_icon_close.gif",
|
|
107
|
+
"generators/surveyor/templates/assets/images/454545_11x11_icon_doc.gif",
|
|
108
|
+
"generators/surveyor/templates/assets/images/454545_11x11_icon_folder_closed.gif",
|
|
109
|
+
"generators/surveyor/templates/assets/images/454545_11x11_icon_folder_open.gif",
|
|
110
|
+
"generators/surveyor/templates/assets/images/454545_11x11_icon_minus.gif",
|
|
111
|
+
"generators/surveyor/templates/assets/images/454545_11x11_icon_plus.gif",
|
|
112
|
+
"generators/surveyor/templates/assets/images/454545_7x7_arrow_down.gif",
|
|
113
|
+
"generators/surveyor/templates/assets/images/454545_7x7_arrow_left.gif",
|
|
114
|
+
"generators/surveyor/templates/assets/images/454545_7x7_arrow_right.gif",
|
|
115
|
+
"generators/surveyor/templates/assets/images/454545_7x7_arrow_up.gif",
|
|
116
|
+
"generators/surveyor/templates/assets/images/888888_11x11_icon_arrows_leftright.gif",
|
|
117
|
+
"generators/surveyor/templates/assets/images/888888_11x11_icon_arrows_updown.gif",
|
|
118
|
+
"generators/surveyor/templates/assets/images/888888_11x11_icon_close.gif",
|
|
119
|
+
"generators/surveyor/templates/assets/images/888888_11x11_icon_doc.gif",
|
|
120
|
+
"generators/surveyor/templates/assets/images/888888_11x11_icon_folder_closed.gif",
|
|
121
|
+
"generators/surveyor/templates/assets/images/888888_11x11_icon_folder_open.gif",
|
|
122
|
+
"generators/surveyor/templates/assets/images/888888_11x11_icon_minus.gif",
|
|
123
|
+
"generators/surveyor/templates/assets/images/888888_11x11_icon_plus.gif",
|
|
124
|
+
"generators/surveyor/templates/assets/images/888888_7x7_arrow_down.gif",
|
|
125
|
+
"generators/surveyor/templates/assets/images/888888_7x7_arrow_left.gif",
|
|
126
|
+
"generators/surveyor/templates/assets/images/888888_7x7_arrow_right.gif",
|
|
127
|
+
"generators/surveyor/templates/assets/images/888888_7x7_arrow_up.gif",
|
|
128
|
+
"generators/surveyor/templates/assets/images/dadada_40x100_textures_02_glass_75.png",
|
|
129
|
+
"generators/surveyor/templates/assets/images/e6e6e6_40x100_textures_02_glass_75.png",
|
|
130
|
+
"generators/surveyor/templates/assets/images/ffffff_40x100_textures_01_flat_0.png",
|
|
131
|
+
"generators/surveyor/templates/assets/images/ffffff_40x100_textures_02_glass_65.png",
|
|
132
|
+
"generators/surveyor/templates/assets/javascripts/accessibleUISlider.jQuery.js",
|
|
133
|
+
"generators/surveyor/templates/assets/javascripts/jquery-1.2.6.js",
|
|
134
|
+
"generators/surveyor/templates/assets/javascripts/jquery-ui-personalized-1.5.3.js",
|
|
135
|
+
"generators/surveyor/templates/assets/javascripts/jquery.form.js",
|
|
136
|
+
"generators/surveyor/templates/assets/javascripts/surveyor.js",
|
|
137
|
+
"generators/surveyor/templates/assets/stylesheets/jquery-ui-slider-additions.css",
|
|
138
|
+
"generators/surveyor/templates/assets/stylesheets/reset.css",
|
|
139
|
+
"generators/surveyor/templates/assets/stylesheets/sass/surveyor.sass",
|
|
140
|
+
"generators/surveyor/templates/assets/stylesheets/surveyor.css",
|
|
141
|
+
"generators/surveyor/templates/assets/stylesheets/ui.theme.css",
|
|
142
|
+
"generators/surveyor/templates/migrate/create_answers.rb",
|
|
143
|
+
"generators/surveyor/templates/migrate/create_dependencies.rb",
|
|
144
|
+
"generators/surveyor/templates/migrate/create_dependency_conditions.rb",
|
|
145
|
+
"generators/surveyor/templates/migrate/create_question_groups.rb",
|
|
146
|
+
"generators/surveyor/templates/migrate/create_questions.rb",
|
|
147
|
+
"generators/surveyor/templates/migrate/create_response_sets.rb",
|
|
148
|
+
"generators/surveyor/templates/migrate/create_responses.rb",
|
|
149
|
+
"generators/surveyor/templates/migrate/create_survey_sections.rb",
|
|
150
|
+
"generators/surveyor/templates/migrate/create_surveys.rb",
|
|
151
|
+
"generators/surveyor/templates/surveys/kitchen_sink_survey.rb",
|
|
152
|
+
"init.rb",
|
|
153
|
+
"install.rb",
|
|
154
|
+
"lib/tasks/surveyor_tasks.rake",
|
|
155
|
+
"lib/tiny_code.rb",
|
|
156
|
+
"lib/user_manager.rb",
|
|
157
|
+
"lib/xml_formatter.rb",
|
|
158
|
+
"script/surveyor/answer.rb",
|
|
159
|
+
"script/surveyor/columnizer.rb",
|
|
160
|
+
"script/surveyor/dependency.rb",
|
|
161
|
+
"script/surveyor/dependency_condition.rb",
|
|
162
|
+
"script/surveyor/dslparse.rb",
|
|
163
|
+
"script/surveyor/question.rb",
|
|
164
|
+
"script/surveyor/question_group.rb",
|
|
165
|
+
"script/surveyor/specs/answer_spec.rb",
|
|
166
|
+
"script/surveyor/specs/question_dependency_spec.rb",
|
|
167
|
+
"script/surveyor/specs/question_group_spec.rb",
|
|
168
|
+
"script/surveyor/specs/question_spec.rb",
|
|
169
|
+
"script/surveyor/specs/section_spec.rb",
|
|
170
|
+
"script/surveyor/survey.rb",
|
|
171
|
+
"script/surveyor/survey_section.rb",
|
|
172
|
+
"script/surveyor/whr_dsl.tmproj",
|
|
173
|
+
"spec/controllers/answers_controller_spec.rb",
|
|
174
|
+
"spec/controllers/dependencies_controller_spec.rb",
|
|
175
|
+
"spec/controllers/dependency_conditions_controller_spec.rb",
|
|
176
|
+
"spec/controllers/questions_controller_spec.rb",
|
|
177
|
+
"spec/controllers/sections_controller_spec.rb",
|
|
178
|
+
"spec/controllers/surveying_controller_spec.rb",
|
|
179
|
+
"spec/controllers/surveying_routing_spec.rb",
|
|
180
|
+
"spec/controllers/surveys_controller_spec.rb",
|
|
181
|
+
"spec/fixtures/answers.yml",
|
|
182
|
+
"spec/fixtures/dependencies.yml",
|
|
183
|
+
"spec/fixtures/dependency_conditions.yml",
|
|
184
|
+
"spec/fixtures/question_groups.yml",
|
|
185
|
+
"spec/fixtures/questions.yml",
|
|
186
|
+
"spec/fixtures/response_sets.yml",
|
|
187
|
+
"spec/fixtures/responses.yml",
|
|
188
|
+
"spec/fixtures/survey_sections.yml",
|
|
189
|
+
"spec/fixtures/surveys.yml",
|
|
190
|
+
"spec/fixtures/users.yml",
|
|
191
|
+
"spec/helpers/survey_importer_helper_spec.rb",
|
|
192
|
+
"spec/helpers/surveying_helper_spec.rb",
|
|
193
|
+
"spec/models/answer_spec.rb",
|
|
194
|
+
"spec/models/dependency_condition_spec.rb",
|
|
195
|
+
"spec/models/dependency_spec.rb",
|
|
196
|
+
"spec/models/question_group_spec.rb",
|
|
197
|
+
"spec/models/question_spec.rb",
|
|
198
|
+
"spec/models/response_set_spec.rb",
|
|
199
|
+
"spec/models/response_spec.rb",
|
|
200
|
+
"spec/models/survey_section_spec.rb",
|
|
201
|
+
"spec/models/survey_spec.rb",
|
|
202
|
+
"spec/models/user_spec.rb",
|
|
203
|
+
"spec/rcov.opts",
|
|
204
|
+
"spec/spec.opts",
|
|
205
|
+
"spec/spec_helper.rb",
|
|
206
|
+
"spec/views/app/edit.html.erb_spec.rb",
|
|
207
|
+
"spec/views/app/index.html.erb_spec.rb",
|
|
208
|
+
"spec/views/app/new.html.erb_spec.rb",
|
|
209
|
+
"spec/views/app/show.html.erb_spec.rb",
|
|
210
|
+
"surveyor.gemspec",
|
|
211
|
+
"uninstall.rb"
|
|
212
|
+
]
|
|
213
|
+
s.homepage = %q{http://github.com/breakpointer/surveyor}
|
|
214
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
|
215
|
+
s.require_paths = ["lib"]
|
|
216
|
+
s.rubygems_version = %q{1.3.4}
|
|
217
|
+
s.summary = %q{A rails (gem) plugin to enable surveys in your application}
|
|
218
|
+
s.test_files = [
|
|
219
|
+
"spec/controllers/answers_controller_spec.rb",
|
|
220
|
+
"spec/controllers/dependencies_controller_spec.rb",
|
|
221
|
+
"spec/controllers/dependency_conditions_controller_spec.rb",
|
|
222
|
+
"spec/controllers/questions_controller_spec.rb",
|
|
223
|
+
"spec/controllers/sections_controller_spec.rb",
|
|
224
|
+
"spec/controllers/surveying_controller_spec.rb",
|
|
225
|
+
"spec/controllers/surveying_routing_spec.rb",
|
|
226
|
+
"spec/controllers/surveys_controller_spec.rb",
|
|
227
|
+
"spec/helpers/survey_importer_helper_spec.rb",
|
|
228
|
+
"spec/helpers/surveying_helper_spec.rb",
|
|
229
|
+
"spec/models/answer_spec.rb",
|
|
230
|
+
"spec/models/dependency_condition_spec.rb",
|
|
231
|
+
"spec/models/dependency_spec.rb",
|
|
232
|
+
"spec/models/question_group_spec.rb",
|
|
233
|
+
"spec/models/question_spec.rb",
|
|
234
|
+
"spec/models/response_set_spec.rb",
|
|
235
|
+
"spec/models/response_spec.rb",
|
|
236
|
+
"spec/models/survey_section_spec.rb",
|
|
237
|
+
"spec/models/survey_spec.rb",
|
|
238
|
+
"spec/models/user_spec.rb",
|
|
239
|
+
"spec/spec_helper.rb",
|
|
240
|
+
"spec/views/app/edit.html.erb_spec.rb",
|
|
241
|
+
"spec/views/app/index.html.erb_spec.rb",
|
|
242
|
+
"spec/views/app/new.html.erb_spec.rb",
|
|
243
|
+
"spec/views/app/show.html.erb_spec.rb"
|
|
244
|
+
]
|
|
245
|
+
|
|
246
|
+
if s.respond_to? :specification_version then
|
|
247
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
|
248
|
+
s.specification_version = 3
|
|
249
|
+
|
|
250
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
|
251
|
+
s.add_runtime_dependency(%q<haml>, [">= 0"])
|
|
252
|
+
else
|
|
253
|
+
s.add_dependency(%q<haml>, [">= 0"])
|
|
254
|
+
end
|
|
255
|
+
else
|
|
256
|
+
s.add_dependency(%q<haml>, [">= 0"])
|
|
257
|
+
end
|
|
258
|
+
end
|