ask 0.4.1 → 0.5.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.
Files changed (78) hide show
  1. data/README.markdown +14 -0
  2. data/Rakefile +1 -1
  3. data/app/assets/javascripts/ask.js.coffee +7 -3
  4. data/app/assets/stylesheets/ask.css.scss +1 -1
  5. data/app/models/answer.rb +20 -2
  6. data/app/models/question.rb +6 -1
  7. data/app/models/upload_question.rb +7 -0
  8. data/app/uploaders/uploaded_file_uploader.rb +55 -0
  9. data/app/views/answerer/_answers.html.erb +22 -0
  10. data/app/views/answerer/_form.html.erb +34 -0
  11. data/app/views/asker/_choice_fields.html.erb +7 -0
  12. data/app/views/asker/_choices.html.erb +27 -0
  13. data/app/views/asker/_form.html.erb +7 -0
  14. data/app/views/asker/_form_preview.html.erb +11 -0
  15. data/app/views/asker/_question_fields.html.erb +46 -0
  16. data/app/views/questions/_checklist_question.html.erb +5 -0
  17. data/app/views/questions/_choose_one_question.html.erb +10 -0
  18. data/app/views/questions/_essay_question.html.erb +1 -0
  19. data/app/views/questions/_form_section.erb +4 -0
  20. data/app/views/questions/_label.html.erb +4 -0
  21. data/app/views/questions/_text_question.html.erb +1 -0
  22. data/app/views/questions/_upload_question.html.erb +6 -0
  23. data/db/migrate/20130202010401_add_upload_field_to_answers.rb +5 -0
  24. data/lib/ask.rb +10 -0
  25. data/lib/ask/acts_as_answerer.rb +4 -3
  26. data/lib/ask/configuration.rb +9 -0
  27. data/lib/ask/version.rb +1 -1
  28. metadata +50 -109
  29. data/app/views/answerer/_answers.html.haml +0 -11
  30. data/app/views/answerer/_form.html.haml +0 -37
  31. data/app/views/asker/_choice_fields.html.haml +0 -6
  32. data/app/views/asker/_choices.html.haml +0 -17
  33. data/app/views/asker/_form.html.haml +0 -5
  34. data/app/views/asker/_form_preview.html.haml +0 -35
  35. data/app/views/asker/_question_fields.html.haml +0 -33
  36. data/test/ask_test.rb +0 -7
  37. data/test/dummy/Rakefile +0 -7
  38. data/test/dummy/app/assets/javascripts/application.js +0 -9
  39. data/test/dummy/app/assets/stylesheets/application.css +0 -7
  40. data/test/dummy/app/controllers/application_controller.rb +0 -3
  41. data/test/dummy/app/helpers/application_helper.rb +0 -2
  42. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  43. data/test/dummy/config.ru +0 -4
  44. data/test/dummy/config/application.rb +0 -45
  45. data/test/dummy/config/boot.rb +0 -10
  46. data/test/dummy/config/database.yml +0 -25
  47. data/test/dummy/config/environment.rb +0 -5
  48. data/test/dummy/config/environments/development.rb +0 -30
  49. data/test/dummy/config/environments/production.rb +0 -60
  50. data/test/dummy/config/environments/test.rb +0 -42
  51. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  52. data/test/dummy/config/initializers/inflections.rb +0 -10
  53. data/test/dummy/config/initializers/mime_types.rb +0 -5
  54. data/test/dummy/config/initializers/secret_token.rb +0 -7
  55. data/test/dummy/config/initializers/session_store.rb +0 -8
  56. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  57. data/test/dummy/config/locales/en.yml +0 -5
  58. data/test/dummy/config/routes.rb +0 -58
  59. data/test/dummy/public/404.html +0 -26
  60. data/test/dummy/public/422.html +0 -26
  61. data/test/dummy/public/500.html +0 -26
  62. data/test/dummy/public/favicon.ico +0 -0
  63. data/test/dummy/script/rails +0 -6
  64. data/test/fixtures/answers.yml +0 -13
  65. data/test/fixtures/choices.yml +0 -9
  66. data/test/fixtures/questions.yml +0 -17
  67. data/test/fixtures/submissions.yml +0 -9
  68. data/test/functional/answers_controller_test.rb +0 -49
  69. data/test/functional/choices_controller_test.rb +0 -49
  70. data/test/functional/questions_controller_test.rb +0 -49
  71. data/test/integration/navigation_test.rb +0 -10
  72. data/test/test_helper.rb +0 -10
  73. data/test/unit/answer_test.rb +0 -7
  74. data/test/unit/choice_test.rb +0 -7
  75. data/test/unit/helpers/answers_helper_test.rb +0 -4
  76. data/test/unit/helpers/choices_helper_test.rb +0 -4
  77. data/test/unit/helpers/questions_helper_test.rb +0 -4
  78. data/test/unit/question_test.rb +0 -7
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/500.html -->
21
- <div class="dialog">
22
- <h1>We're sorry, but something went wrong.</h1>
23
- <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
- </div>
25
- </body>
26
- </html>
File without changes
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
-
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
6
- require 'rails/commands'
@@ -1,13 +0,0 @@
1
- # Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html
2
-
3
- one:
4
- answerer:
5
- question:
6
- choice:
7
- answer: MyText
8
-
9
- two:
10
- answerer:
11
- question:
12
- choice:
13
- answer: MyText
@@ -1,9 +0,0 @@
1
- # Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html
2
-
3
- one:
4
- question:
5
- name: MyString
6
-
7
- two:
8
- question:
9
- name: MyString
@@ -1,17 +0,0 @@
1
- # Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html
2
-
3
- one:
4
- asker:
5
- type:
6
- name: MyString
7
- instructions: MyText
8
- required: false
9
- position: 1
10
-
11
- two:
12
- asker:
13
- type:
14
- name: MyString
15
- instructions: MyText
16
- required: false
17
- position: 1
@@ -1,9 +0,0 @@
1
- # Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html
2
-
3
- one:
4
- submitter:
5
- asker:
6
-
7
- two:
8
- submitter:
9
- asker:
@@ -1,49 +0,0 @@
1
- require 'test_helper'
2
-
3
- class AnswersControllerTest < ActionController::TestCase
4
- setup do
5
- @answer = answers(:one)
6
- end
7
-
8
- test "should get index" do
9
- get :index
10
- assert_response :success
11
- assert_not_nil assigns(:answers)
12
- end
13
-
14
- test "should get new" do
15
- get :new
16
- assert_response :success
17
- end
18
-
19
- test "should create answer" do
20
- assert_difference('Answer.count') do
21
- post :create, answer: @answer.attributes
22
- end
23
-
24
- assert_redirected_to answer_path(assigns(:answer))
25
- end
26
-
27
- test "should show answer" do
28
- get :show, id: @answer.to_param
29
- assert_response :success
30
- end
31
-
32
- test "should get edit" do
33
- get :edit, id: @answer.to_param
34
- assert_response :success
35
- end
36
-
37
- test "should update answer" do
38
- put :update, id: @answer.to_param, answer: @answer.attributes
39
- assert_redirected_to answer_path(assigns(:answer))
40
- end
41
-
42
- test "should destroy answer" do
43
- assert_difference('Answer.count', -1) do
44
- delete :destroy, id: @answer.to_param
45
- end
46
-
47
- assert_redirected_to answers_path
48
- end
49
- end
@@ -1,49 +0,0 @@
1
- require 'test_helper'
2
-
3
- class ChoicesControllerTest < ActionController::TestCase
4
- setup do
5
- @choice = choices(:one)
6
- end
7
-
8
- test "should get index" do
9
- get :index
10
- assert_response :success
11
- assert_not_nil assigns(:choices)
12
- end
13
-
14
- test "should get new" do
15
- get :new
16
- assert_response :success
17
- end
18
-
19
- test "should create choice" do
20
- assert_difference('Choice.count') do
21
- post :create, choice: @choice.attributes
22
- end
23
-
24
- assert_redirected_to choice_path(assigns(:choice))
25
- end
26
-
27
- test "should show choice" do
28
- get :show, id: @choice.to_param
29
- assert_response :success
30
- end
31
-
32
- test "should get edit" do
33
- get :edit, id: @choice.to_param
34
- assert_response :success
35
- end
36
-
37
- test "should update choice" do
38
- put :update, id: @choice.to_param, choice: @choice.attributes
39
- assert_redirected_to choice_path(assigns(:choice))
40
- end
41
-
42
- test "should destroy choice" do
43
- assert_difference('Choice.count', -1) do
44
- delete :destroy, id: @choice.to_param
45
- end
46
-
47
- assert_redirected_to choices_path
48
- end
49
- end
@@ -1,49 +0,0 @@
1
- require 'test_helper'
2
-
3
- class QuestionsControllerTest < ActionController::TestCase
4
- setup do
5
- @question = questions(:one)
6
- end
7
-
8
- test "should get index" do
9
- get :index
10
- assert_response :success
11
- assert_not_nil assigns(:questions)
12
- end
13
-
14
- test "should get new" do
15
- get :new
16
- assert_response :success
17
- end
18
-
19
- test "should create question" do
20
- assert_difference('Question.count') do
21
- post :create, question: @question.attributes
22
- end
23
-
24
- assert_redirected_to question_path(assigns(:question))
25
- end
26
-
27
- test "should show question" do
28
- get :show, id: @question.to_param
29
- assert_response :success
30
- end
31
-
32
- test "should get edit" do
33
- get :edit, id: @question.to_param
34
- assert_response :success
35
- end
36
-
37
- test "should update question" do
38
- put :update, id: @question.to_param, question: @question.attributes
39
- assert_redirected_to question_path(assigns(:question))
40
- end
41
-
42
- test "should destroy question" do
43
- assert_difference('Question.count', -1) do
44
- delete :destroy, id: @question.to_param
45
- end
46
-
47
- assert_redirected_to questions_path
48
- end
49
- end
@@ -1,10 +0,0 @@
1
- require 'test_helper'
2
-
3
- class NavigationTest < ActionDispatch::IntegrationTest
4
- fixtures :all
5
-
6
- # test "the truth" do
7
- # assert true
8
- # end
9
- end
10
-
@@ -1,10 +0,0 @@
1
- # Configure Rails Environment
2
- ENV["RAILS_ENV"] = "test"
3
-
4
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
- require "rails/test_help"
6
-
7
- Rails.backtrace_cleaner.remove_silencers!
8
-
9
- # Load support files
10
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class AnswerTest < ActiveSupport::TestCase
4
- # test "the truth" do
5
- # assert true
6
- # end
7
- end
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class ChoiceTest < ActiveSupport::TestCase
4
- # test "the truth" do
5
- # assert true
6
- # end
7
- end
@@ -1,4 +0,0 @@
1
- require 'test_helper'
2
-
3
- class AnswersHelperTest < ActionView::TestCase
4
- end
@@ -1,4 +0,0 @@
1
- require 'test_helper'
2
-
3
- class ChoicesHelperTest < ActionView::TestCase
4
- end
@@ -1,4 +0,0 @@
1
- require 'test_helper'
2
-
3
- class QuestionsHelperTest < ActionView::TestCase
4
- end
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class QuestionTest < ActiveSupport::TestCase
4
- # test "the truth" do
5
- # assert true
6
- # end
7
- end