answers-core 0.0.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 (293) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +6 -0
  3. data/answers-core.gemspec +30 -0
  4. data/app/assets/fonts/answers/League_Gothic-webfont.eot +0 -0
  5. data/app/assets/fonts/answers/League_Gothic-webfont.svg +230 -0
  6. data/app/assets/fonts/answers/League_Gothic-webfont.ttf +0 -0
  7. data/app/assets/fonts/answers/League_Gothic-webfont.woff +0 -0
  8. data/app/assets/images/OaklandCityTree.png +0 -0
  9. data/app/assets/images/background_image.jpg +0 -0
  10. data/app/assets/images/background_pattern.png +0 -0
  11. data/app/assets/images/beta.png +0 -0
  12. data/app/assets/images/bg_transparent.png +0 -0
  13. data/app/assets/images/border.png +0 -0
  14. data/app/assets/images/brigade.png +0 -0
  15. data/app/assets/images/cfa.png +0 -0
  16. data/app/assets/images/cfa_logo.png +0 -0
  17. data/app/assets/images/cfa_logo_footer.png +0 -0
  18. data/app/assets/images/favicon.ico +0 -0
  19. data/app/assets/images/forest.jpeg +0 -0
  20. data/app/assets/images/getting_started_btn.png +0 -0
  21. data/app/assets/images/govuk.png +0 -0
  22. data/app/assets/images/openoaklandlogo.png +0 -0
  23. data/app/assets/images/quick_answers_icon.png +0 -0
  24. data/app/assets/images/quick_answers_icon_small.png +0 -0
  25. data/app/assets/images/searchIcon.png +0 -0
  26. data/app/assets/images/wmd-buttons.png +0 -0
  27. data/app/assets/images/yellow_bg.png +0 -0
  28. data/app/assets/javascripts/answers.js +19 -0
  29. data/app/assets/javascripts/answers/Markdown.Extra.js +304 -0
  30. data/app/assets/javascripts/answers/active_admin.js +62 -0
  31. data/app/assets/javascripts/answers/pagedown/LICENSE.txt +32 -0
  32. data/app/assets/javascripts/answers/pagedown/Markdown.Converter.js +1332 -0
  33. data/app/assets/javascripts/answers/pagedown/Markdown.Editor.js +2212 -0
  34. data/app/assets/javascripts/answers/pagedown/Markdown.Sanitizer.js +108 -0
  35. data/app/assets/javascripts/answers/pagedown/README.txt +0 -0
  36. data/app/assets/javascripts/answers/pagedown/demo/browser/demo.css +120 -0
  37. data/app/assets/javascripts/answers/pagedown/demo/browser/demo.html +83 -0
  38. data/app/assets/javascripts/answers/pagedown/demo/node/demo.js +44 -0
  39. data/app/assets/javascripts/answers/pagedown/local/Markdown.local.fr.js +43 -0
  40. data/app/assets/javascripts/answers/pagedown/node-pagedown.js +2 -0
  41. data/app/assets/javascripts/answers/pagedown/package.json +12 -0
  42. data/app/assets/javascripts/answers/pagedown/resources/wmd-buttons.psd +0 -0
  43. data/app/assets/javascripts/answers/pagedown/wmd-buttons.png +0 -0
  44. data/app/assets/javascripts/answers/skip_nav.js +8 -0
  45. data/app/assets/stylesheets/answers/active_admin.css.scss +17 -0
  46. data/app/assets/stylesheets/answers/active_admin_custom.css.scss +35 -0
  47. data/app/assets/stylesheets/answers/formatting.css +82 -0
  48. data/app/assets/stylesheets/answers/mobile.css +149 -0
  49. data/app/assets/stylesheets/answers/tags.css.scss +3 -0
  50. data/app/assets/stylesheets/answers/theme.css +916 -0
  51. data/app/controllers/answers/answers_controller.rb +26 -0
  52. data/app/controllers/answers/api/v1/answers_controller.rb +38 -0
  53. data/app/controllers/answers/api/v1/api_controller.rb +13 -0
  54. data/app/controllers/answers/api/v1/questions_controller.rb +39 -0
  55. data/app/controllers/answers/api/v1/taggings_controller.rb +46 -0
  56. data/app/controllers/answers/api/v1/tags_controller.rb +38 -0
  57. data/app/controllers/answers/application_controller.rb +27 -0
  58. data/app/controllers/answers/home_controller.rb +17 -0
  59. data/app/controllers/answers/questions_controller.rb +33 -0
  60. data/app/controllers/answers/search_controller.rb +22 -0
  61. data/app/controllers/answers/tags_controller.rb +36 -0
  62. data/app/helpers/answers/tags_helper.rb +7 -0
  63. data/app/models/.gitkeep +0 -0
  64. data/app/models/answers/ability.rb +28 -0
  65. data/app/models/answers/administrator.rb +5 -0
  66. data/app/models/answers/answer.rb +6 -0
  67. data/app/models/answers/api/v1/api_user.rb +5 -0
  68. data/app/models/answers/question.rb +31 -0
  69. data/app/models/answers/user.rb +30 -0
  70. data/app/views/answers/admin/contacts/_article.html.erb +0 -0
  71. data/app/views/answers/admin/dashboard/_dashboard.html.erb +5 -0
  72. data/app/views/answers/admin/guide_steps/_form.html.erb +17 -0
  73. data/app/views/answers/api/v1/answers/_answer.json.jbuilder +2 -0
  74. data/app/views/answers/api/v1/answers/index.json.jbuilder +1 -0
  75. data/app/views/answers/api/v1/answers/show.json.jbuilder +1 -0
  76. data/app/views/answers/api/v1/questions/_question.json.jbuilder +2 -0
  77. data/app/views/answers/api/v1/questions/index.json.jbuilder +1 -0
  78. data/app/views/answers/api/v1/questions/show.json.jbuilder +1 -0
  79. data/app/views/answers/api/v1/taggings/_tagging.json.jbuilder +3 -0
  80. data/app/views/answers/api/v1/taggings/index.json.jbuilder +1 -0
  81. data/app/views/answers/api/v1/taggings/show.json.jbuilder +1 -0
  82. data/app/views/answers/api/v1/tags/_tag.json.jbuilder +2 -0
  83. data/app/views/answers/api/v1/tags/index.json.jbuilder +1 -0
  84. data/app/views/answers/api/v1/tags/show.json.jbuilder +1 -0
  85. data/app/views/answers/devise/confirmations/new.html.erb +12 -0
  86. data/app/views/answers/devise/mailer/confirmation_instructions.html.erb +5 -0
  87. data/app/views/answers/devise/mailer/reset_password_instructions.html.erb +8 -0
  88. data/app/views/answers/devise/mailer/unlock_instructions.html.erb +7 -0
  89. data/app/views/answers/devise/passwords/edit.html.erb +24 -0
  90. data/app/views/answers/devise/passwords/new.html.erb +20 -0
  91. data/app/views/answers/devise/registrations/edit.html.erb +25 -0
  92. data/app/views/answers/devise/registrations/new.html.erb +18 -0
  93. data/app/views/answers/devise/sessions/new.html.erb +25 -0
  94. data/app/views/answers/devise/shared/_links.erb +25 -0
  95. data/app/views/answers/devise/unlocks/new.html.erb +12 -0
  96. data/app/views/answers/home/_article.html.erb +3 -0
  97. data/app/views/answers/home/_category.html.erb +8 -0
  98. data/app/views/answers/home/about.html.erb +72 -0
  99. data/app/views/answers/home/index.html.erb +44 -0
  100. data/app/views/answers/questions/index.html.erb +21 -0
  101. data/app/views/answers/questions/show.html.erb +31 -0
  102. data/app/views/answers/search/index.html.erb +32 -0
  103. data/app/views/answers/shared/_articles_sidebar.html.erb +22 -0
  104. data/app/views/answers/shared/_autocomplete.html.erb +8 -0
  105. data/app/views/answers/shared/_categories_sidebar.html.erb +12 -0
  106. data/app/views/answers/shared/_search_form.html.erb +4 -0
  107. data/app/views/answers/shared/admin/_administration.html.erb +38 -0
  108. data/app/views/answers/shared/admin/_article_actions.html.erb +86 -0
  109. data/app/views/answers/shared/admin/_article_content.html.erb +27 -0
  110. data/app/views/answers/shared/admin/_article_details.html.erb +11 -0
  111. data/app/views/answers/shared/admin/_article_form.html.erb +20 -0
  112. data/app/views/answers/shared/admin/_author_pic.html.erb +0 -0
  113. data/app/views/answers/tags/index.html.erb +34 -0
  114. data/app/views/answers/tags/show.html.erb +31 -0
  115. data/app/views/layouts/answers/application.html.erb +97 -0
  116. data/config.ru +5 -0
  117. data/config/initializers/active_admin.rb +245 -0
  118. data/config/initializers/devise.rb +228 -0
  119. data/config/locales/devise.en.yml +57 -0
  120. data/config/locales/en.yml +129 -0
  121. data/config/routes.rb +22 -0
  122. data/config/secrets.yml +68 -0
  123. data/db/migrate/20140911060606_answers_up.rb +79 -0
  124. data/lib/answers-core.rb +1 -0
  125. data/lib/answers.rb +175 -0
  126. data/lib/answers/admin/answer.rb +29 -0
  127. data/lib/answers/admin/dashboard.rb +75 -0
  128. data/lib/answers/admin/question.rb +57 -0
  129. data/lib/answers/admin/tag.rb +12 -0
  130. data/lib/answers/admin/users.rb +65 -0
  131. data/lib/answers/core.rb +25 -0
  132. data/lib/answers/core/configuration.rb +90 -0
  133. data/lib/answers/core/engine.rb +116 -0
  134. data/lib/answers/engine.rb +62 -0
  135. data/lib/answers/errors.rb +13 -0
  136. data/lib/answers/plugin.rb +75 -0
  137. data/lib/answers/plugins.rb +73 -0
  138. data/lib/answers/version.rb +16 -0
  139. data/lib/api_client.rb +20 -0
  140. data/lib/assets/.gitkeep +0 -0
  141. data/lib/assets/eng_stop.csv +1 -0
  142. data/lib/generators/answers/clash_keywords.yml +3 -0
  143. data/lib/generators/answers/cms/cms_generator.rb +314 -0
  144. data/lib/generators/answers/cms/templates/.gitignore +91 -0
  145. data/lib/generators/answers/cms/templates/app/decorators/controllers/answers/.keep +0 -0
  146. data/lib/generators/answers/cms/templates/app/decorators/models/answers/.keep +0 -0
  147. data/lib/generators/answers/cms/templates/app/views/sitemap/index.xml.builder +15 -0
  148. data/lib/generators/answers/cms/templates/config/database.yml.mysql +20 -0
  149. data/lib/generators/answers/cms/templates/config/database.yml.postgresql +58 -0
  150. data/lib/generators/answers/cms/templates/config/database.yml.sqlite3 +18 -0
  151. data/lib/generators/answers/core/core_generator.rb +10 -0
  152. data/lib/generators/answers/core/templates/config/initializers/answers/core.rb.erb +35 -0
  153. data/lib/generators/answers/dummy/dummy_generator.rb +86 -0
  154. data/lib/generators/answers/dummy/templates/rails/Rakefile +7 -0
  155. data/lib/generators/answers/dummy/templates/rails/application.js +3 -0
  156. data/lib/generators/answers/dummy/templates/rails/application.rb.erb +12 -0
  157. data/lib/generators/answers/dummy/templates/rails/boot.rb.erb +6 -0
  158. data/lib/generators/answers/dummy/templates/rails/database.yml +34 -0
  159. data/lib/generators/answers/dummy/templates/rails/routes.rb +3 -0
  160. data/lib/generators/answers/engine/USAGE +24 -0
  161. data/lib/generators/answers/engine/engine_generator.rb +44 -0
  162. data/lib/generators/answers/engine/templates/.gitignore +2 -0
  163. data/lib/generators/answers/engine/templates/Gemfile +42 -0
  164. data/lib/generators/answers/engine/templates/Rakefile +19 -0
  165. data/lib/generators/answers/engine/templates/answers-extension_plural_name.gemspec +19 -0
  166. data/lib/generators/answers/engine/templates/app/controllers/answers/namespace/admin/plural_name_controller.rb.erb +14 -0
  167. data/lib/generators/answers/engine/templates/app/controllers/answers/namespace/plural_name_controller.rb.erb +34 -0
  168. data/lib/generators/answers/engine/templates/app/models/answers/namespace/singular_name.rb.erb +37 -0
  169. data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/_actions.html.erb +25 -0
  170. data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/_form.html.erb +65 -0
  171. data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/_plural_name.html.erb +2 -0
  172. data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/_records.html.erb +16 -0
  173. data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/_singular_name.html.erb +33 -0
  174. data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/_sortable_list.html.erb +5 -0
  175. data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/edit.html.erb +1 -0
  176. data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/index.html.erb +7 -0
  177. data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/new.html.erb +1 -0
  178. data/lib/generators/answers/engine/templates/app/views/answers/namespace/plural_name/index.html.erb +11 -0
  179. data/lib/generators/answers/engine/templates/app/views/answers/namespace/plural_name/show.html.erb +39 -0
  180. data/lib/generators/answers/engine/templates/config/locales/cs.yml +28 -0
  181. data/lib/generators/answers/engine/templates/config/locales/en.yml +28 -0
  182. data/lib/generators/answers/engine/templates/config/locales/es.yml +29 -0
  183. data/lib/generators/answers/engine/templates/config/locales/fr.yml +28 -0
  184. data/lib/generators/answers/engine/templates/config/locales/it.yml +28 -0
  185. data/lib/generators/answers/engine/templates/config/locales/nb.yml +28 -0
  186. data/lib/generators/answers/engine/templates/config/locales/nl.yml +28 -0
  187. data/lib/generators/answers/engine/templates/config/locales/sk.yml +28 -0
  188. data/lib/generators/answers/engine/templates/config/locales/tr.yml +28 -0
  189. data/lib/generators/answers/engine/templates/config/locales/zh-CN.yml +30 -0
  190. data/lib/generators/answers/engine/templates/config/routes.rb.erb +19 -0
  191. data/lib/generators/answers/engine/templates/db/migrate/1_create_namespace_plural_name.rb.erb +39 -0
  192. data/lib/generators/answers/engine/templates/db/seeds.rb.erb +21 -0
  193. data/lib/generators/answers/engine/templates/lib/answers-extension_plural_name.rb.erb +1 -0
  194. data/lib/generators/answers/engine/templates/lib/answers/plural_name.rb.erb +21 -0
  195. data/lib/generators/answers/engine/templates/lib/answers/plural_name/engine.rb.erb +23 -0
  196. data/lib/generators/answers/engine/templates/lib/generators/answers/extension_plural_name_generator.rb.erb +19 -0
  197. data/lib/generators/answers/engine/templates/lib/tasks/answers/extension_plural_name.rake +13 -0
  198. data/lib/generators/answers/engine/templates/readme.md +10 -0
  199. data/lib/generators/answers/engine/templates/script/rails +10 -0
  200. data/lib/generators/answers/engine/templates/spec/features/answers/namespace/admin/plural_name_spec.rb.erb +200 -0
  201. data/lib/generators/answers/engine/templates/spec/models/answers/namespace/singular_name_spec.rb.erb +20 -0
  202. data/lib/generators/answers/engine/templates/spec/spec_helper.rb +31 -0
  203. data/lib/generators/answers/engine/templates/spec/support/factories/answers/plural_name.rb.erb +7 -0
  204. data/lib/generators/answers/engine/templates/tasks/rspec.rake +6 -0
  205. data/lib/generators/answers/engine/templates/tasks/testing.rake +8 -0
  206. data/lib/generators/answers/generator.rb +292 -0
  207. data/lib/markdownifier.rb +11 -0
  208. data/log/.gitkeep +0 -0
  209. data/log/development.log +12870 -0
  210. data/log/newrelic_agent.log +1339 -0
  211. data/log/test.log +233181 -0
  212. data/public/404.html +25 -0
  213. data/public/422.html +25 -0
  214. data/public/500.html +24 -0
  215. data/public/favicon.ico +0 -0
  216. data/public/robots.txt +5 -0
  217. data/script/delayed_job +5 -0
  218. data/spec/controllers/answers_controller_spec.rb +55 -0
  219. data/spec/controllers/api/v1/answers_controller_spec.rb +144 -0
  220. data/spec/controllers/api/v1/questions_controller_spec.rb +144 -0
  221. data/spec/controllers/api/v1/taggings_controller_spec.rb +126 -0
  222. data/spec/controllers/api/v1/tags_controller_spec.rb +126 -0
  223. data/spec/controllers/home_controller_spec.rb +60 -0
  224. data/spec/controllers/questions_controller_spec.rb +55 -0
  225. data/spec/controllers/tags_controller_spec.rb +42 -0
  226. data/spec/factories/answers.rb +10 -0
  227. data/spec/factories/questions.rb +8 -0
  228. data/spec/factories/tags.rb +8 -0
  229. data/spec/factories/user.rb +32 -0
  230. data/spec/features/admin_dashboard_spec.rb +53 -0
  231. data/spec/features/admin_user_spec.rb +61 -0
  232. data/spec/features/searches_spec.rb +101 -0
  233. data/spec/fixtures/Article/_before_validation/sets_access_count_if_nil.yml +223 -0
  234. data/spec/fixtures/Article/_delete_orphaned_keywords/updating_an_article/destroys_orphaned_keywords_associated.yml +223 -0
  235. data/spec/fixtures/Article/_delete_orphaned_keywords/when_deleting_an_article/destroys_all_keywords_associated.yml +223 -0
  236. data/spec/fixtures/Article/_find_by_friendly_id/when_an_article_does_not_exist/does_not_raise_an_exception.yml +223 -0
  237. data/spec/fixtures/Article/_find_by_friendly_id/when_an_article_exists/returns_the_corresponding_article.yml +223 -0
  238. data/spec/fixtures/Article/_find_by_type/excludes_articles_not_matching_specified_type.yml +223 -0
  239. data/spec/fixtures/Article/_find_by_type/returns_articles_matching_type.yml +223 -0
  240. data/spec/fixtures/Article/_hits/before_an_article_has_been_viewed/has_zero_hits.yml +223 -0
  241. data/spec/fixtures/Article/_hits/returns_number_of_views/has_seven_views.yml +223 -0
  242. data/spec/fixtures/Article/_indexable_/returns_false_if_article_is_not_published.yml +223 -0
  243. data/spec/fixtures/Article/_indexable_/returns_true_if_article_is_published.yml +223 -0
  244. data/spec/fixtures/Article/_legacy_/returns_true_if_render_markdown_is_false.yml +223 -0
  245. data/spec/fixtures/Article/_qm_after_create/creates_wordcounts_for_relevant_keywords.yml +223 -0
  246. data/spec/fixtures/Article/_record_hit/viewing_an_article/increases_hit_by_one.yml +223 -0
  247. data/spec/fixtures/Article/_related/has_no_related_articles/.yml +223 -0
  248. data/spec/fixtures/Article/_related/has_related_articles/.yml +223 -0
  249. data/spec/fixtures/Article/_remove_stop_words/removes_common_english_words_from_the_string.yml +223 -0
  250. data/spec/fixtures/Article/_search/_search_titles/query_is_present_in_the_title/.yml +223 -0
  251. data/spec/fixtures/Article/_search/_search_titles/returns_an_empty_array_when_the_search_term_is_present_in_an_article_but_not_the_title.yml +223 -0
  252. data/spec/fixtures/Article/_search/matches_articles_in_the_database.yml +223 -0
  253. data/spec/fixtures/Article/_search/query_does_not_match_anything_in_the_database/returns_an_empty_array.yml +223 -0
  254. data/spec/fixtures/Article/_search/query_is_a_single_space/.yml +223 -0
  255. data/spec/fixtures/Article/_search/query_is_an_empty_string/.yml +223 -0
  256. data/spec/fixtures/Article/_to_s/when_an_article_has_a_category/returns_a_string_containing_title_id_and_category.yml +223 -0
  257. data/spec/fixtures/Article/can_be_published/an_unpublished_article/is_published.yml +223 -0
  258. data/spec/fixtures/Article/can_be_published/an_unpublished_article/returns_status_Published.yml +223 -0
  259. data/spec/fixtures/Article/has_a_friendly_url.yml +223 -0
  260. data/spec/fixtures/Article/is_valid_with_a_title.yml +223 -0
  261. data/spec/fixtures/Searches/search_results/1_result_found/.yml +22047 -0
  262. data/spec/fixtures/Searches/search_results/no_results_found/.yml +393 -0
  263. data/spec/fixtures/Searches/search_results/several_results_found/should_contain_the_title_and_preview_of_both_articles.yml +223 -0
  264. data/spec/fixtures/Searches/search_results/several_results_found/show_the_query.yml +277 -0
  265. data/spec/fixtures/articles.yml +428 -0
  266. data/spec/fixtures/categories.yml +17 -0
  267. data/spec/fixtures/contacts.yml +11 -0
  268. data/spec/fixtures/dragon_keyword_cassette.yml +77 -0
  269. data/spec/fixtures/oakland_answers.yml +2379 -0
  270. data/spec/helpers/tags_helper_spec.rb +15 -0
  271. data/spec/lib/markdownifier_spec.rb +12 -0
  272. data/spec/models/ability_spec.rb +36 -0
  273. data/spec/models/answer_spec.rb +5 -0
  274. data/spec/models/question_spec.rb +70 -0
  275. data/spec/models/user_spec.rb +55 -0
  276. data/spec/routing/answers_routing_spec.rb +19 -0
  277. data/spec/routing/questions_routing_spec.rb +19 -0
  278. data/spec/routing/routes_spec.rb +13 -0
  279. data/spec/security/brakeman_spec.rb +37 -0
  280. data/spec/spec_helper.rb +61 -0
  281. data/spec/support/login_helpers.rb +10 -0
  282. data/spec/support/wait_for_ajax_helper.rb +7 -0
  283. data/spec/support/wait_for_dom_helper.rb +12 -0
  284. data/spec/views/questions/index.html.erb_spec.rb +16 -0
  285. data/spec/views/questions/show.html.erb_spec.rb +14 -0
  286. data/spec/views/tags/index.html.erb_spec.rb +5 -0
  287. data/spec/views/tags/show.html.erb_spec.rb +5 -0
  288. data/vendor/assets/javascripts/.gitkeep +0 -0
  289. data/vendor/assets/stylesheets/.gitkeep +0 -0
  290. data/vendor/assets/stylesheets/bootstrap.css +3990 -0
  291. data/vendor/crudgen/lib/generators/crudgen/install_generator.rb +23 -0
  292. data/vendor/plugins/.gitkeep +0 -0
  293. metadata +484 -0
data/public/404.html ADDED
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</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
+ <div class="dialog">
21
+ <h1>The page you were looking for doesn't exist.</h1>
22
+ <p>You may have mistyped the address or the page may have moved.</p>
23
+ </div>
24
+ </body>
25
+ </html>
data/public/422.html ADDED
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</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
+ <div class="dialog">
21
+ <h1>The change you wanted was rejected.</h1>
22
+ <p>Maybe you tried to change something you didn't have access to.</p>
23
+ </div>
24
+ </body>
25
+ </html>
data/public/500.html ADDED
@@ -0,0 +1,24 @@
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
+ <div class="dialog">
21
+ <h1>We're sorry, but something went wrong.</h1>
22
+ </div>
23
+ </body>
24
+ </html>
Binary file
data/public/robots.txt ADDED
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
4
+ require 'delayed/command'
5
+ Delayed::Command.new(ARGV).daemonize
@@ -0,0 +1,55 @@
1
+ require 'spec_helper'
2
+
3
+ # This spec was generated by rspec-rails when you ran the scaffold generator.
4
+ # It demonstrates how one might use RSpec to specify the controller code that
5
+ # was generated by Rails when you ran the scaffold generator.
6
+ #
7
+ # It assumes that the implementation code is generated by the rails scaffold
8
+ # generator. If you are using any extension libraries to generate different
9
+ # controller code, this generated spec may or may not pass.
10
+ #
11
+ # It only uses APIs available in rails and/or rspec-rails. There are a number
12
+ # of tools you can use to make these specs even more expressive, but we're
13
+ # sticking to rails and rspec-rails APIs to keep things simple and stable.
14
+ #
15
+ # Compared to earlier versions of this generator, there is very limited use of
16
+ # stubs and message expectations in this spec. Stubs are only used when there
17
+ # is no simpler way to get a handle on the object needed for the example.
18
+ # Message expectations are only used when there is no simpler way to specify
19
+ # that an instance is receiving a specific message.
20
+
21
+ RSpec.describe Answers::AnswersController, :type => :controller do
22
+
23
+ # This should return the minimal set of attributes required to create a valid
24
+ # Answer. As you add validations to Answer, be sure to
25
+ # adjust the attributes here as well.
26
+ let(:valid_attributes) {
27
+ skip("Add a hash of attributes valid for your model")
28
+ }
29
+
30
+ let(:invalid_attributes) {
31
+ skip("Add a hash of attributes invalid for your model")
32
+ }
33
+
34
+ # This should return the minimal set of values that should be in the session
35
+ # in order to pass any filters (e.g. authentication) defined in
36
+ # AnswersController. Be sure to keep this updated too.
37
+ let(:valid_session) { {} }
38
+
39
+ describe "GET index" do
40
+ it "assigns all answers as @answers" do
41
+ answer = Answers::Answer.create! valid_attributes
42
+ get :index, {}, valid_session
43
+ expect(assigns(:answers)).to eq([answer])
44
+ end
45
+ end
46
+
47
+ describe "GET show" do
48
+ it "assigns the requested answer as @answer" do
49
+ answer = Answers::Answer.create! valid_attributes
50
+ get :show, {:id => answer.to_param}, valid_session
51
+ expect(assigns(:answer)).to eq(answer)
52
+ end
53
+ end
54
+
55
+ end
@@ -0,0 +1,144 @@
1
+ require 'spec_helper'
2
+
3
+ # This spec was generated by rspec-rails when you ran the scaffold generator.
4
+ # It demonstrates how one might use RSpec to specify the controller code that
5
+ # was generated by Rails when you ran the scaffold generator.
6
+ #
7
+ # It assumes that the implementation code is generated by the rails scaffold
8
+ # generator. If you are using any extension libraries to generate different
9
+ # controller code, this generated spec may or may not pass.
10
+ #
11
+ # It only uses APIs available in rails and/or rspec-rails. There are a number
12
+ # of tools you can use to make these specs even more expressive, but we're
13
+ # sticking to rails and rspec-rails APIs to keep things simple and stable.
14
+ #
15
+ # Compared to earlier versions of this generator, there is very limited use of
16
+ # stubs and message expectations in this spec. Stubs are only used when there
17
+ # is no simpler way to get a handle on the object needed for the example.
18
+ # Message expectations are only used when there is no simpler way to specify
19
+ # that an instance is receiving a specific message.
20
+
21
+ RSpec.describe Answers::Api::V1::AnswersController, :type => :controller do
22
+
23
+ # This should return the minimal set of attributes required to create a valid
24
+ # Answer. As you add validations to Answer, be sure to
25
+ # adjust the attributes here as well.
26
+ let(:valid_attributes) {
27
+ skip("Add a hash of attributes valid for your model")
28
+ }
29
+
30
+ let(:invalid_attributes) {
31
+ skip("Add a hash of attributes invalid for your model")
32
+ }
33
+
34
+ # This should return the minimal set of values that should be in the session
35
+ # in order to pass any filters (e.g. authentication) defined in
36
+ # AnswersController. Be sure to keep this updated too.
37
+ let(:valid_session) { {} }
38
+
39
+ describe "GET index" do
40
+ it "assigns all answers as @answers" do
41
+ answer = Answers::Answer.create! valid_attributes
42
+ get :index, {}, valid_session
43
+ expect(assigns(:answers)).to eq([answer])
44
+ end
45
+ end
46
+
47
+ describe "GET show" do
48
+ it "assigns the requested answer as @answer" do
49
+ answer = Answers::Answer.create! valid_attributes
50
+ get :show, {:id => answer.to_param}, valid_session
51
+ expect(assigns(:answer)).to eq(answer)
52
+ end
53
+ end
54
+
55
+ describe "POST create" do
56
+ describe "with valid params" do
57
+ it "creates a new Answer" do
58
+ expect {
59
+ post :create, {:answer => valid_attributes}, valid_session
60
+ }.to change(Answers::Answer, :count).by(1)
61
+ end
62
+
63
+ it "assigns a newly created answer as @answer" do
64
+ post :create, {:answer => valid_attributes}, valid_session
65
+ expect(assigns(:answer)).to be_a(Answers::Answer)
66
+ expect(assigns(:answer)).to be_persisted
67
+ end
68
+
69
+ it "redirects to the created answer" do
70
+ post :create, {:answer => valid_attributes}, valid_session
71
+ expect(response).to redirect_to(Answers::Answer.last)
72
+ end
73
+ end
74
+
75
+ describe "with invalid params" do
76
+ it "assigns a newly created but unsaved answer as @answer" do
77
+ post :create, {:answer => invalid_attributes}, valid_session
78
+ expect(assigns(:answer)).to be_a_new(Answers::Answer)
79
+ end
80
+
81
+ it "re-renders the 'new' template" do
82
+ post :create, {:answer => invalid_attributes}, valid_session
83
+ expect(response).to render_template("new")
84
+ end
85
+ end
86
+ end
87
+
88
+ describe "PUT update" do
89
+ describe "with valid params" do
90
+ let(:new_attributes) {
91
+ skip("Add a hash of attributes valid for your model")
92
+ }
93
+
94
+ it "updates the requested answer" do
95
+ answer = Answers::Answer.create! valid_attributes
96
+ put :update, {:id => answer.to_param, :answer => new_attributes}, valid_session
97
+ answer.reload
98
+ skip("Add assertions for updated state")
99
+ end
100
+
101
+ it "assigns the requested answer as @answer" do
102
+ answer = Answers::Answer.create! valid_attributes
103
+ put :update, {:id => answer.to_param, :answer => valid_attributes}, valid_session
104
+ expect(assigns(:answer)).to eq(answer)
105
+ end
106
+
107
+ it "redirects to the answer" do
108
+ answer = Answers::Answer.create! valid_attributes
109
+ put :update, {:id => answer.to_param, :answer => valid_attributes}, valid_session
110
+ expect(response).to redirect_to(answer)
111
+ end
112
+ end
113
+
114
+ describe "with invalid params" do
115
+ it "assigns the answer as @answer" do
116
+ answer = Answers::Answer.create! valid_attributes
117
+ put :update, {:id => answer.to_param, :answer => invalid_attributes}, valid_session
118
+ expect(assigns(:answer)).to eq(answer)
119
+ end
120
+
121
+ it "re-renders the 'edit' template" do
122
+ answer = Answers::Answer.create! valid_attributes
123
+ put :update, {:id => answer.to_param, :answer => invalid_attributes}, valid_session
124
+ expect(response).to render_template("edit")
125
+ end
126
+ end
127
+ end
128
+
129
+ describe "DELETE destroy" do
130
+ it "destroys the requested answer" do
131
+ answer = Answers::Answer.create! valid_attributes
132
+ expect {
133
+ delete :destroy, {:id => answer.to_param}, valid_session
134
+ }.to change(Answers::Answer, :count).by(-1)
135
+ end
136
+
137
+ it "redirects to the answers list" do
138
+ answer = Answers::Answer.create! valid_attributes
139
+ delete :destroy, {:id => answer.to_param}, valid_session
140
+ expect(response).to redirect_to(answers_url)
141
+ end
142
+ end
143
+
144
+ end
@@ -0,0 +1,144 @@
1
+ require 'spec_helper'
2
+
3
+ # This spec was generated by rspec-rails when you ran the scaffold generator.
4
+ # It demonstrates how one might use RSpec to specify the controller code that
5
+ # was generated by Rails when you ran the scaffold generator.
6
+ #
7
+ # It assumes that the implementation code is generated by the rails scaffold
8
+ # generator. If you are using any extension libraries to generate different
9
+ # controller code, this generated spec may or may not pass.
10
+ #
11
+ # It only uses APIs available in rails and/or rspec-rails. There are a number
12
+ # of tools you can use to make these specs even more expressive, but we're
13
+ # sticking to rails and rspec-rails APIs to keep things simple and stable.
14
+ #
15
+ # Compared to earlier versions of this generator, there is very limited use of
16
+ # stubs and message expectations in this spec. Stubs are only used when there
17
+ # is no simpler way to get a handle on the object needed for the example.
18
+ # Message expectations are only used when there is no simpler way to specify
19
+ # that an instance is receiving a specific message.
20
+
21
+ RSpec.describe Answers::Api::V1::QuestionsController, :type => :controller do
22
+
23
+ # This should return the minimal set of attributes required to create a valid
24
+ # Question. As you add validations to Question, be sure to
25
+ # adjust the attributes here as well.
26
+ let(:valid_attributes) {
27
+ skip("Add a hash of attributes valid for your model")
28
+ }
29
+
30
+ let(:invalid_attributes) {
31
+ skip("Add a hash of attributes invalid for your model")
32
+ }
33
+
34
+ # This should return the minimal set of values that should be in the session
35
+ # in order to pass any filters (e.g. authentication) defined in
36
+ # QuestionsController. Be sure to keep this updated too.
37
+ let(:valid_session) { {} }
38
+
39
+ describe "GET index" do
40
+ it "assigns all questions as @questions" do
41
+ question = Answers::Question.create! valid_attributes
42
+ get :index, {}, valid_session
43
+ expect(assigns(:questions)).to eq([question])
44
+ end
45
+ end
46
+
47
+ describe "GET show" do
48
+ it "assigns the requested question as @question" do
49
+ question = Answers::Question.create! valid_attributes
50
+ get :show, {:id => question.to_param}, valid_session
51
+ expect(assigns(:question)).to eq(question)
52
+ end
53
+ end
54
+
55
+ describe "POST create" do
56
+ describe "with valid params" do
57
+ it "creates a new Answers::Question" do
58
+ expect {
59
+ post :create, {:question => valid_attributes}, valid_session
60
+ }.to change(Answers::Question, :count).by(1)
61
+ end
62
+
63
+ it "assigns a newly created question as @question" do
64
+ post :create, {:question => valid_attributes}, valid_session
65
+ expect(assigns(:question)).to be_a(Answers::Question)
66
+ expect(assigns(:question)).to be_persisted
67
+ end
68
+
69
+ it "redirects to the created question" do
70
+ post :create, {:question => valid_attributes}, valid_session
71
+ expect(response).to redirect_to(Answers::Question.last)
72
+ end
73
+ end
74
+
75
+ describe "with invalid params" do
76
+ it "assigns a newly created but unsaved question as @question" do
77
+ post :create, {:question => invalid_attributes}, valid_session
78
+ expect(assigns(:question)).to be_a_new(Answers::Question)
79
+ end
80
+
81
+ it "re-renders the 'new' template" do
82
+ post :create, {:question => invalid_attributes}, valid_session
83
+ expect(response).to render_template("new")
84
+ end
85
+ end
86
+ end
87
+
88
+ describe "PUT update" do
89
+ describe "with valid params" do
90
+ let(:new_attributes) {
91
+ skip("Add a hash of attributes valid for your model")
92
+ }
93
+
94
+ it "updates the requested question" do
95
+ question = Answers::Question.create! valid_attributes
96
+ put :update, {:id => question.to_param, :question => new_attributes}, valid_session
97
+ question.reload
98
+ skip("Add assertions for updated state")
99
+ end
100
+
101
+ it "assigns the requested question as @question" do
102
+ question = Answers::Question.create! valid_attributes
103
+ put :update, {:id => question.to_param, :question => valid_attributes}, valid_session
104
+ expect(assigns(:question)).to eq(question)
105
+ end
106
+
107
+ it "redirects to the question" do
108
+ question = Answers::Question.create! valid_attributes
109
+ put :update, {:id => question.to_param, :question => valid_attributes}, valid_session
110
+ expect(response).to redirect_to(question)
111
+ end
112
+ end
113
+
114
+ describe "with invalid params" do
115
+ it "assigns the question as @question" do
116
+ question = Answers::Question.create! valid_attributes
117
+ put :update, {:id => question.to_param, :question => invalid_attributes}, valid_session
118
+ expect(assigns(:question)).to eq(question)
119
+ end
120
+
121
+ it "re-renders the 'edit' template" do
122
+ question = Answers::Question.create! valid_attributes
123
+ put :update, {:id => question.to_param, :question => invalid_attributes}, valid_session
124
+ expect(response).to render_template("edit")
125
+ end
126
+ end
127
+ end
128
+
129
+ describe "DELETE destroy" do
130
+ it "destroys the requested question" do
131
+ question = Answers::Question.create! valid_attributes
132
+ expect {
133
+ delete :destroy, {:id => question.to_param}, valid_session
134
+ }.to change(Answers::Question, :count).by(-1)
135
+ end
136
+
137
+ it "redirects to the questions list" do
138
+ question = Answers::Question.create! valid_attributes
139
+ delete :destroy, {:id => question.to_param}, valid_session
140
+ expect(response).to redirect_to(questions_url)
141
+ end
142
+ end
143
+
144
+ end
@@ -0,0 +1,126 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Answers::Api::V1::TaggingsController, :type => :controller do
4
+
5
+ # This should return the minimal set of attributes required to create a valid
6
+ # ActsAsTaggableOn::Tag. As you add validations to ActsAsTaggableOn::Tag, be sure to
7
+ # adjust the attributes here as well.
8
+ let(:valid_attributes) {
9
+ skip("Add a hash of attributes valid for your model")
10
+ }
11
+
12
+ let(:invalid_attributes) {
13
+ skip("Add a hash of attributes invalid for your model")
14
+ }
15
+
16
+ # This should return the minimal set of values that should be in the session
17
+ # in order to pass any filters (e.g. authentication) defined in
18
+ # ActsAsTaggableOn::TagsController. Be sure to keep this updated too.
19
+ let(:valid_session) { {} }
20
+
21
+ describe "GET index" do
22
+ it "assigns all taggings as @taggings" do
23
+ tagging = ActsAsTaggableOn::Tagging.create! valid_attributes
24
+ get :index, {}, valid_session
25
+ expect(assigns(:taggings)).to eq([tagging])
26
+ end
27
+ end
28
+
29
+ describe "GET show" do
30
+ it "assigns the requested tagging as @tagging" do
31
+ tagging = ActsAsTaggableOn::Tagging.create! valid_attributes
32
+ get :show, {:id => tagging.to_param}, valid_session
33
+ expect(assigns(:tagging)).to eq(tagging)
34
+ end
35
+ end
36
+
37
+ describe "POST create" do
38
+ describe "with valid params" do
39
+ it "creates a new ActsAsTaggableOn::Tag" do
40
+ expect {
41
+ post :create, {:tagging => valid_attributes}, valid_session
42
+ }.to change(ActsAsTaggableOn::Tagging, :count).by(1)
43
+ end
44
+
45
+ it "assigns a newly created tagging as @tagging" do
46
+ post :create, {:tagging => valid_attributes}, valid_session
47
+ expect(assigns(:tagging)).to be_a(ActsAsTaggableOn::Tagging)
48
+ expect(assigns(:tagging)).to be_persisted
49
+ end
50
+
51
+ it "redirects to the created tagging" do
52
+ post :create, {:tagging => valid_attributes}, valid_session
53
+ expect(response).to redirect_to(ActsAsTaggableOn::Tagging.last)
54
+ end
55
+ end
56
+
57
+ describe "with invalid params" do
58
+ it "assigns a newly created but unsaved tagging as @tagging" do
59
+ post :create, {:tagging => invalid_attributes}, valid_session
60
+ expect(assigns(:tagging)).to be_a_new(ActsAsTaggableOn::Tagging)
61
+ end
62
+
63
+ it "re-renders the 'new' template" do
64
+ post :create, {:tagging => invalid_attributes}, valid_session
65
+ expect(response).to render_template("new")
66
+ end
67
+ end
68
+ end
69
+
70
+ describe "PUT update" do
71
+ describe "with valid params" do
72
+ let(:new_attributes) {
73
+ skip("Add a hash of attributes valid for your model")
74
+ }
75
+
76
+ it "updates the requested tagging" do
77
+ tagging = ActsAsTaggableOn::Tagging.create! valid_attributes
78
+ put :update, {:id => tagging.to_param, :tagging => new_attributes}, valid_session
79
+ tagging.reload
80
+ skip("Add assertions for updated state")
81
+ end
82
+
83
+ it "assigns the requested tagging as @tagging" do
84
+ tagging = ActsAsTaggableOn::Tagging.create! valid_attributes
85
+ put :update, {:id => tagging.to_param, :tagging => valid_attributes}, valid_session
86
+ expect(assigns(:tagging)).to eq(tagging)
87
+ end
88
+
89
+ it "redirects to the tagging" do
90
+ tagging = ActsAsTaggableOn::Tagging.create! valid_attributes
91
+ put :update, {:id => tagging.to_param, :tagging => valid_attributes}, valid_session
92
+ expect(response).to redirect_to(tagging)
93
+ end
94
+ end
95
+
96
+ describe "with invalid params" do
97
+ it "assigns the tagging as @tagging" do
98
+ tagging = ActsAsTaggableOn::Tagging.create! valid_attributes
99
+ put :update, {:id => tagging.to_param, :tagging => invalid_attributes}, valid_session
100
+ expect(assigns(:tagging)).to eq(tagging)
101
+ end
102
+
103
+ it "re-renders the 'edit' template" do
104
+ tagging = ActsAsTaggableOn::Tagging.create! valid_attributes
105
+ put :update, {:id => tagging.to_param, :tagging => invalid_attributes}, valid_session
106
+ expect(response).to render_template("edit")
107
+ end
108
+ end
109
+ end
110
+
111
+ describe "DELETE destroy" do
112
+ it "destroys the requested tagging" do
113
+ tagging = ActsAsTaggableOn::Tagging.create! valid_attributes
114
+ expect {
115
+ delete :destroy, {:id => tagging.to_param}, valid_session
116
+ }.to change(ActsAsTaggableOn::Tagging, :count).by(-1)
117
+ end
118
+
119
+ it "redirects to the taggings list" do
120
+ tagging = ActsAsTaggableOn::Tagging.create! valid_attributes
121
+ delete :destroy, {:id => tagging.to_param}, valid_session
122
+ expect(response).to redirect_to(taggings_url)
123
+ end
124
+ end
125
+
126
+ end