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.
- data/README.markdown +14 -0
- data/Rakefile +1 -1
- data/app/assets/javascripts/ask.js.coffee +7 -3
- data/app/assets/stylesheets/ask.css.scss +1 -1
- data/app/models/answer.rb +20 -2
- data/app/models/question.rb +6 -1
- data/app/models/upload_question.rb +7 -0
- data/app/uploaders/uploaded_file_uploader.rb +55 -0
- data/app/views/answerer/_answers.html.erb +22 -0
- data/app/views/answerer/_form.html.erb +34 -0
- data/app/views/asker/_choice_fields.html.erb +7 -0
- data/app/views/asker/_choices.html.erb +27 -0
- data/app/views/asker/_form.html.erb +7 -0
- data/app/views/asker/_form_preview.html.erb +11 -0
- data/app/views/asker/_question_fields.html.erb +46 -0
- data/app/views/questions/_checklist_question.html.erb +5 -0
- data/app/views/questions/_choose_one_question.html.erb +10 -0
- data/app/views/questions/_essay_question.html.erb +1 -0
- data/app/views/questions/_form_section.erb +4 -0
- data/app/views/questions/_label.html.erb +4 -0
- data/app/views/questions/_text_question.html.erb +1 -0
- data/app/views/questions/_upload_question.html.erb +6 -0
- data/db/migrate/20130202010401_add_upload_field_to_answers.rb +5 -0
- data/lib/ask.rb +10 -0
- data/lib/ask/acts_as_answerer.rb +4 -3
- data/lib/ask/configuration.rb +9 -0
- data/lib/ask/version.rb +1 -1
- metadata +50 -109
- data/app/views/answerer/_answers.html.haml +0 -11
- data/app/views/answerer/_form.html.haml +0 -37
- data/app/views/asker/_choice_fields.html.haml +0 -6
- data/app/views/asker/_choices.html.haml +0 -17
- data/app/views/asker/_form.html.haml +0 -5
- data/app/views/asker/_form_preview.html.haml +0 -35
- data/app/views/asker/_question_fields.html.haml +0 -33
- data/test/ask_test.rb +0 -7
- data/test/dummy/Rakefile +0 -7
- data/test/dummy/app/assets/javascripts/application.js +0 -9
- data/test/dummy/app/assets/stylesheets/application.css +0 -7
- data/test/dummy/app/controllers/application_controller.rb +0 -3
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -45
- data/test/dummy/config/boot.rb +0 -10
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -30
- data/test/dummy/config/environments/production.rb +0 -60
- data/test/dummy/config/environments/test.rb +0 -42
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/inflections.rb +0 -10
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/secret_token.rb +0 -7
- data/test/dummy/config/initializers/session_store.rb +0 -8
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -5
- data/test/dummy/config/routes.rb +0 -58
- data/test/dummy/public/404.html +0 -26
- data/test/dummy/public/422.html +0 -26
- data/test/dummy/public/500.html +0 -26
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +0 -6
- data/test/fixtures/answers.yml +0 -13
- data/test/fixtures/choices.yml +0 -9
- data/test/fixtures/questions.yml +0 -17
- data/test/fixtures/submissions.yml +0 -9
- data/test/functional/answers_controller_test.rb +0 -49
- data/test/functional/choices_controller_test.rb +0 -49
- data/test/functional/questions_controller_test.rb +0 -49
- data/test/integration/navigation_test.rb +0 -10
- data/test/test_helper.rb +0 -10
- data/test/unit/answer_test.rb +0 -7
- data/test/unit/choice_test.rb +0 -7
- data/test/unit/helpers/answers_helper_test.rb +0 -4
- data/test/unit/helpers/choices_helper_test.rb +0 -4
- data/test/unit/helpers/questions_helper_test.rb +0 -4
- data/test/unit/question_test.rb +0 -7
data/test/dummy/public/500.html
DELETED
@@ -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
|
data/test/dummy/script/rails
DELETED
@@ -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'
|
data/test/fixtures/answers.yml
DELETED
data/test/fixtures/choices.yml
DELETED
data/test/fixtures/questions.yml
DELETED
@@ -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,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
|
data/test/test_helper.rb
DELETED
@@ -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 }
|
data/test/unit/answer_test.rb
DELETED
data/test/unit/choice_test.rb
DELETED