wafflemix 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (276) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +96 -0
  3. data/Rakefile +40 -0
  4. data/app/assets/javascripts/mercury/page_editor.js.coffee +254 -0
  5. data/app/assets/javascripts/wafflemix/admin/admin.js.coffee +73 -0
  6. data/app/assets/javascripts/wafflemix/admin/admin_js.js +16 -0
  7. data/app/assets/javascripts/wafflemix/admin/bootstrap-datepicker.js +454 -0
  8. data/app/assets/javascripts/wafflemix/admin/jquery.nested_sortable.js +608 -0
  9. data/app/assets/javascripts/wafflemix/application.js +43 -0
  10. data/app/assets/javascripts/wafflemix/assets.js +2 -0
  11. data/app/assets/javascripts/wafflemix/contact_forms.js +2 -0
  12. data/app/assets/javascripts/wafflemix/mercury.js +469 -0
  13. data/app/assets/javascripts/wafflemix/pages.js +2 -0
  14. data/app/assets/javascripts/wafflemix/portfolios.js +2 -0
  15. data/app/assets/javascripts/wafflemix/posts.js +2 -0
  16. data/app/assets/javascripts/wafflemix/roles.js +2 -0
  17. data/app/assets/javascripts/wafflemix/users.js +2 -0
  18. data/app/assets/stylesheets/wafflemix/admin/admin.css.sass +76 -0
  19. data/app/assets/stylesheets/wafflemix/admin/bootstrap-datepicker.css +7 -0
  20. data/app/assets/stylesheets/wafflemix/application.css +15 -0
  21. data/app/assets/stylesheets/wafflemix/assets.css +4 -0
  22. data/app/assets/stylesheets/wafflemix/clearfix.css +20 -0
  23. data/app/assets/stylesheets/wafflemix/contact_forms.css +4 -0
  24. data/app/assets/stylesheets/wafflemix/main.css.sass +11 -0
  25. data/app/assets/stylesheets/wafflemix/mercury.css +23 -0
  26. data/app/assets/stylesheets/wafflemix/pages.css +4 -0
  27. data/app/assets/stylesheets/wafflemix/partials/_base.css.sass +131 -0
  28. data/app/assets/stylesheets/wafflemix/portfolios.css +4 -0
  29. data/app/assets/stylesheets/wafflemix/posts.css +4 -0
  30. data/app/assets/stylesheets/wafflemix/roles.css +4 -0
  31. data/app/assets/stylesheets/wafflemix/users.css +4 -0
  32. data/app/controllers/wafflemix/admin/assets_controller.rb +95 -0
  33. data/app/controllers/wafflemix/admin/categories_controller.rb +77 -0
  34. data/app/controllers/wafflemix/admin/contact_forms_controller.rb +77 -0
  35. data/app/controllers/wafflemix/admin/content_sections_controller.rb +85 -0
  36. data/app/controllers/wafflemix/admin/pages_controller.rb +93 -0
  37. data/app/controllers/wafflemix/admin/portfolios_controller.rb +93 -0
  38. data/app/controllers/wafflemix/admin/posts_controller.rb +82 -0
  39. data/app/controllers/wafflemix/admin/roles_controller.rb +77 -0
  40. data/app/controllers/wafflemix/admin/slides_controller.rb +88 -0
  41. data/app/controllers/wafflemix/admin/users_controller.rb +78 -0
  42. data/app/controllers/wafflemix/application_controller.rb +11 -0
  43. data/app/controllers/wafflemix/assets_controller.rb +71 -0
  44. data/app/controllers/wafflemix/categories_controller.rb +34 -0
  45. data/app/controllers/wafflemix/contact_forms_controller.rb +47 -0
  46. data/app/controllers/wafflemix/pages_controller.rb +56 -0
  47. data/app/controllers/wafflemix/portfolios_controller.rb +35 -0
  48. data/app/controllers/wafflemix/posts_controller.rb +52 -0
  49. data/app/helpers/wafflemix/admin/slides_helper.rb +11 -0
  50. data/app/helpers/wafflemix/application_helper.rb +88 -0
  51. data/app/helpers/wafflemix/assets_helper.rb +4 -0
  52. data/app/helpers/wafflemix/categories_helper.rb +4 -0
  53. data/app/helpers/wafflemix/contact_forms_helper.rb +4 -0
  54. data/app/helpers/wafflemix/content_sections_helper.rb +4 -0
  55. data/app/helpers/wafflemix/pages_helper.rb +23 -0
  56. data/app/helpers/wafflemix/portfolios_helper.rb +11 -0
  57. data/app/helpers/wafflemix/posts_helper.rb +5 -0
  58. data/app/helpers/wafflemix/roles_helper.rb +4 -0
  59. data/app/helpers/wafflemix/users_helper.rb +4 -0
  60. data/app/models/user.rb +10 -0
  61. data/app/models/wafflemix/Categorical.rb +8 -0
  62. data/app/models/wafflemix/asset.rb +22 -0
  63. data/app/models/wafflemix/category.rb +8 -0
  64. data/app/models/wafflemix/contact_form.rb +19 -0
  65. data/app/models/wafflemix/content_section.rb +21 -0
  66. data/app/models/wafflemix/image.rb +8 -0
  67. data/app/models/wafflemix/meta_content.rb +5 -0
  68. data/app/models/wafflemix/page.rb +39 -0
  69. data/app/models/wafflemix/portfolio.rb +16 -0
  70. data/app/models/wafflemix/post.rb +33 -0
  71. data/app/models/wafflemix/role.rb +10 -0
  72. data/app/models/wafflemix/slide.rb +14 -0
  73. data/app/models/wafflemix/user.rb +11 -0
  74. data/app/models/wafflemix/user_role.rb +8 -0
  75. data/app/views/devise/_links.erb +25 -0
  76. data/app/views/devise/confirmations/new.html.erb +12 -0
  77. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  78. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  79. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  80. data/app/views/devise/passwords/edit.html.erb +16 -0
  81. data/app/views/devise/passwords/new.html.erb +12 -0
  82. data/app/views/devise/registrations/edit.html.erb +25 -0
  83. data/app/views/devise/registrations/new.html.erb +18 -0
  84. data/app/views/devise/sessions/new.html.erb +17 -0
  85. data/app/views/devise/unlocks/new.html.erb +12 -0
  86. data/app/views/layouts/mercury.html.erb +24 -0
  87. data/app/views/layouts/wafflemix/admin.html.erb +19 -0
  88. data/app/views/layouts/wafflemix/example_layout.html.erb +35 -0
  89. data/app/views/wafflemix/admin/assets/_form.html.erb +22 -0
  90. data/app/views/wafflemix/admin/assets/add_image.js.erb +1 -0
  91. data/app/views/wafflemix/admin/assets/edit.html.erb +6 -0
  92. data/app/views/wafflemix/admin/assets/index.html.erb +41 -0
  93. data/app/views/wafflemix/admin/assets/new.html.erb +5 -0
  94. data/app/views/wafflemix/admin/assets/show.html.erb +20 -0
  95. data/app/views/wafflemix/admin/categories/_form.html.erb +29 -0
  96. data/app/views/wafflemix/admin/categories/edit.html.erb +6 -0
  97. data/app/views/wafflemix/admin/categories/index.html.erb +36 -0
  98. data/app/views/wafflemix/admin/categories/new.html.erb +5 -0
  99. data/app/views/wafflemix/admin/categories/show.html.erb +25 -0
  100. data/app/views/wafflemix/admin/contact_forms/_form.html.erb +15 -0
  101. data/app/views/wafflemix/admin/contact_forms/edit.html.erb +6 -0
  102. data/app/views/wafflemix/admin/contact_forms/index.html.erb +38 -0
  103. data/app/views/wafflemix/admin/contact_forms/new.html.erb +5 -0
  104. data/app/views/wafflemix/admin/contact_forms/show.html.erb +25 -0
  105. data/app/views/wafflemix/admin/content_sections/_form.html.erb +33 -0
  106. data/app/views/wafflemix/admin/content_sections/create.js.erb +3 -0
  107. data/app/views/wafflemix/admin/content_sections/destroy.js.erb +4 -0
  108. data/app/views/wafflemix/admin/content_sections/edit.html.erb +6 -0
  109. data/app/views/wafflemix/admin/content_sections/index.html.erb +29 -0
  110. data/app/views/wafflemix/admin/content_sections/new.html.erb +5 -0
  111. data/app/views/wafflemix/admin/content_sections/show.html.erb +25 -0
  112. data/app/views/wafflemix/admin/pages/_form.html.erb +47 -0
  113. data/app/views/wafflemix/admin/pages/_page.html.erb +15 -0
  114. data/app/views/wafflemix/admin/pages/edit.html.erb +3 -0
  115. data/app/views/wafflemix/admin/pages/index.html.erb +21 -0
  116. data/app/views/wafflemix/admin/pages/new.html.erb +3 -0
  117. data/app/views/wafflemix/admin/pages/show.html.erb +40 -0
  118. data/app/views/wafflemix/admin/portfolios/_form.html.erb +174 -0
  119. data/app/views/wafflemix/admin/portfolios/_portfolio.html.erb +11 -0
  120. data/app/views/wafflemix/admin/portfolios/edit.html.erb +5 -0
  121. data/app/views/wafflemix/admin/portfolios/index.html.erb +21 -0
  122. data/app/views/wafflemix/admin/portfolios/new.html.erb +5 -0
  123. data/app/views/wafflemix/admin/portfolios/show.html.erb +20 -0
  124. data/app/views/wafflemix/admin/posts/_form.html.erb +191 -0
  125. data/app/views/wafflemix/admin/posts/edit.html.erb +5 -0
  126. data/app/views/wafflemix/admin/posts/index.html.erb +38 -0
  127. data/app/views/wafflemix/admin/posts/new.html.erb +3 -0
  128. data/app/views/wafflemix/admin/posts/show.html.erb +20 -0
  129. data/app/views/wafflemix/admin/roles/_form.html.erb +21 -0
  130. data/app/views/wafflemix/admin/roles/edit.html.erb +6 -0
  131. data/app/views/wafflemix/admin/roles/index.html.erb +34 -0
  132. data/app/views/wafflemix/admin/roles/new.html.erb +5 -0
  133. data/app/views/wafflemix/admin/roles/show.html.erb +10 -0
  134. data/app/views/wafflemix/admin/slides/_form.html.erb +170 -0
  135. data/app/views/wafflemix/admin/slides/_slide.html.erb +11 -0
  136. data/app/views/wafflemix/admin/slides/edit.html.erb +5 -0
  137. data/app/views/wafflemix/admin/slides/index.html.erb +21 -0
  138. data/app/views/wafflemix/admin/slides/new.html.erb +5 -0
  139. data/app/views/wafflemix/admin/slides/show.html.erb +10 -0
  140. data/app/views/wafflemix/admin/users/_form.html.erb +29 -0
  141. data/app/views/wafflemix/admin/users/edit.html.erb +6 -0
  142. data/app/views/wafflemix/admin/users/index.html.erb +36 -0
  143. data/app/views/wafflemix/admin/users/new.html.erb +5 -0
  144. data/app/views/wafflemix/admin/users/show.html.erb +14 -0
  145. data/app/views/wafflemix/categories/index.erb +16 -0
  146. data/app/views/wafflemix/categories/show.html.erb +16 -0
  147. data/app/views/wafflemix/contact_forms/_form.html.erb +33 -0
  148. data/app/views/wafflemix/contact_forms/new.html.erb +19 -0
  149. data/app/views/wafflemix/contact_forms/show.html.erb +25 -0
  150. data/app/views/wafflemix/pages/home.html.erb +7 -0
  151. data/app/views/wafflemix/pages/index.html.erb +31 -0
  152. data/app/views/wafflemix/pages/show.html.erb +14 -0
  153. data/app/views/wafflemix/portfolios/index.html.erb +21 -0
  154. data/app/views/wafflemix/portfolios/show.html.erb +36 -0
  155. data/app/views/wafflemix/posts/_sidebar.html.erb +12 -0
  156. data/app/views/wafflemix/posts/index.html.erb +16 -0
  157. data/app/views/wafflemix/posts/show.html.erb +40 -0
  158. data/app/views/wafflemix/posts/tagged.html.erb +16 -0
  159. data/config/initializers/devise.rb +227 -0
  160. data/config/initializers/dragonfly.rb +16 -0
  161. data/config/initializers/formtastic.rb +78 -0
  162. data/config/initializers/spam_filter.rb +4 -0
  163. data/config/locales/devise.en.yml +57 -0
  164. data/config/routes.rb +55 -0
  165. data/db/migrate/20120814113226_create_wafflemix_pages.rb +19 -0
  166. data/db/migrate/20120901141321_create_wafflemix_users.rb +29 -0
  167. data/db/migrate/20120901150334_create_wafflemix_assets.rb +11 -0
  168. data/db/migrate/20120901151421_create_wafflemix_roles.rb +9 -0
  169. data/db/migrate/20120901151704_create_wafflemix_user_roles.rb +13 -0
  170. data/db/migrate/20120915124116_add_ancestry_to_pages.rb +7 -0
  171. data/db/migrate/20120918100336_create_wafflemix_categories.rb +15 -0
  172. data/db/migrate/20120923131130_create_wafflemix_slides.rb +11 -0
  173. data/db/migrate/20120923131307_create_wafflemix_content_sections.rb +12 -0
  174. data/db/migrate/20120923135949_add_position_to_slides.rb +5 -0
  175. data/db/migrate/20121005124419_update_asset_table.rb +10 -0
  176. data/db/migrate/20121113131239_create_wafflemix_posts.rb +15 -0
  177. data/db/migrate/20121113132413_add_translation_table_for_posts.rb +9 -0
  178. data/db/migrate/20121114135432_update_draft_to_boolean_on_posts.rb +11 -0
  179. data/db/migrate/20121120125114_add_page_translations.rb +9 -0
  180. data/db/migrate/20121205221122_acts_as_taggable_on_migration.rb +30 -0
  181. data/db/migrate/20121206132733_re_do_categories.rb +19 -0
  182. data/db/migrate/20121206132923_add_new_categories_table.rb +11 -0
  183. data/db/migrate/20121206133026_add_category_joins_table.rb +14 -0
  184. data/db/migrate/20121211095114_finalize_asset_table.rb +11 -0
  185. data/db/migrate/20121211095847_store_asset_url.rb +5 -0
  186. data/db/migrate/20130202161212_create_wafflemix_images.rb +11 -0
  187. data/db/migrate/20130202182435_add_extra_fields_to_slides.rb +6 -0
  188. data/db/migrate/20130204225256_create_wafflemix_portfolios.rb +11 -0
  189. data/db/migrate/20130204230818_add_ancestry_to_portfolio.rb +6 -0
  190. data/db/migrate/20130216190558_create_wafflemix_meta_contents.rb +13 -0
  191. data/db/migrate/20130219121412_create_wafflemix_contact_forms.rb +12 -0
  192. data/db/migrate/20130219130609_add_spam_to_contact_forms.rb +5 -0
  193. data/lib/tasks/wafflemix_tasks.rake +15 -0
  194. data/lib/templates/erb/scaffold/_form.html.erb +11 -0
  195. data/lib/wafflemix/engine.rb +9 -0
  196. data/lib/wafflemix/version.rb +3 -0
  197. data/lib/wafflemix.rb +17 -0
  198. data/test/dummy/README.rdoc +261 -0
  199. data/test/dummy/Rakefile +7 -0
  200. data/test/dummy/app/assets/javascripts/application.js +15 -0
  201. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  202. data/test/dummy/app/controllers/application_controller.rb +3 -0
  203. data/test/dummy/app/helpers/application_helper.rb +2 -0
  204. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  205. data/test/dummy/config/application.rb +64 -0
  206. data/test/dummy/config/boot.rb +10 -0
  207. data/test/dummy/config/environment.rb +5 -0
  208. data/test/dummy/config/environments/development.rb +39 -0
  209. data/test/dummy/config/environments/production.rb +69 -0
  210. data/test/dummy/config/environments/test.rb +37 -0
  211. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  212. data/test/dummy/config/initializers/inflections.rb +15 -0
  213. data/test/dummy/config/initializers/local_s3.rb +3 -0
  214. data/test/dummy/config/initializers/mime_types.rb +5 -0
  215. data/test/dummy/config/initializers/secret_token.rb +7 -0
  216. data/test/dummy/config/initializers/session_store.rb +8 -0
  217. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  218. data/test/dummy/config/locales/en.yml +5 -0
  219. data/test/dummy/config/routes.rb +5 -0
  220. data/test/dummy/config.ru +4 -0
  221. data/test/dummy/db/schema.rb +87 -0
  222. data/test/dummy/public/404.html +26 -0
  223. data/test/dummy/public/422.html +26 -0
  224. data/test/dummy/public/500.html +25 -0
  225. data/test/dummy/public/favicon.ico +0 -0
  226. data/test/dummy/script/rails +6 -0
  227. data/test/fixtures/wafflemix/assets.yml +11 -0
  228. data/test/fixtures/wafflemix/categories.yml +13 -0
  229. data/test/fixtures/wafflemix/contact_forms.yml +13 -0
  230. data/test/fixtures/wafflemix/content_sections.yml +13 -0
  231. data/test/fixtures/wafflemix/images.yml +11 -0
  232. data/test/fixtures/wafflemix/meta_contents.yml +15 -0
  233. data/test/fixtures/wafflemix/pages.yml +19 -0
  234. data/test/fixtures/wafflemix/portfolios.yml +11 -0
  235. data/test/fixtures/wafflemix/posts.yml +11 -0
  236. data/test/fixtures/wafflemix/roles.yml +7 -0
  237. data/test/fixtures/wafflemix/slides.yml +7 -0
  238. data/test/fixtures/wafflemix/user_roles.yml +9 -0
  239. data/test/fixtures/wafflemix/users.yml +11 -0
  240. data/test/functional/wafflemix/assets_controller_test.rb +51 -0
  241. data/test/functional/wafflemix/categories_controller_test.rb +51 -0
  242. data/test/functional/wafflemix/contact_forms_controller_test.rb +51 -0
  243. data/test/functional/wafflemix/content_sections_controller_test.rb +51 -0
  244. data/test/functional/wafflemix/pages_controller_test.rb +51 -0
  245. data/test/functional/wafflemix/portfolios_controller_test.rb +51 -0
  246. data/test/functional/wafflemix/posts_controller_test.rb +51 -0
  247. data/test/functional/wafflemix/roles_controller_test.rb +51 -0
  248. data/test/functional/wafflemix/slides_controller_test.rb +51 -0
  249. data/test/functional/wafflemix/users_controller_test.rb +51 -0
  250. data/test/integration/navigation_test.rb +10 -0
  251. data/test/test_helper.rb +15 -0
  252. data/test/unit/helpers/wafflemix/assets_helper_test.rb +6 -0
  253. data/test/unit/helpers/wafflemix/categories_helper_test.rb +6 -0
  254. data/test/unit/helpers/wafflemix/contact_forms_helper_test.rb +6 -0
  255. data/test/unit/helpers/wafflemix/content_sections_helper_test.rb +6 -0
  256. data/test/unit/helpers/wafflemix/pages_helper_test.rb +6 -0
  257. data/test/unit/helpers/wafflemix/portfolios_helper_test.rb +6 -0
  258. data/test/unit/helpers/wafflemix/posts_helper_test.rb +6 -0
  259. data/test/unit/helpers/wafflemix/roles_helper_test.rb +6 -0
  260. data/test/unit/helpers/wafflemix/slides_helper_test.rb +6 -0
  261. data/test/unit/helpers/wafflemix/users_helper_test.rb +6 -0
  262. data/test/unit/wafflemix/asset_test.rb +9 -0
  263. data/test/unit/wafflemix/category_test.rb +9 -0
  264. data/test/unit/wafflemix/contact_form_test.rb +9 -0
  265. data/test/unit/wafflemix/content_section_test.rb +9 -0
  266. data/test/unit/wafflemix/image_test.rb +9 -0
  267. data/test/unit/wafflemix/meta_content_test.rb +9 -0
  268. data/test/unit/wafflemix/page_test.rb +9 -0
  269. data/test/unit/wafflemix/portfolio_test.rb +9 -0
  270. data/test/unit/wafflemix/post_test.rb +9 -0
  271. data/test/unit/wafflemix/role_test.rb +9 -0
  272. data/test/unit/wafflemix/slide_test.rb +9 -0
  273. data/test/unit/wafflemix/user_role_test.rb +9 -0
  274. data/test/unit/wafflemix/user_test.rb +9 -0
  275. data/test/wafflemix_test.rb +7 -0
  276. metadata +654 -0
@@ -0,0 +1,51 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class CategoriesControllerTest < ActionController::TestCase
5
+ setup do
6
+ @category = categories(:one)
7
+ end
8
+
9
+ test "should get index" do
10
+ get :index
11
+ assert_response :success
12
+ assert_not_nil assigns(:categories)
13
+ end
14
+
15
+ test "should get new" do
16
+ get :new
17
+ assert_response :success
18
+ end
19
+
20
+ test "should create category" do
21
+ assert_difference('Category.count') do
22
+ post :create, category: { ancestry: @category.ancestry, categorical: @category.categorical, name: @category.name, position: @category.position }
23
+ end
24
+
25
+ assert_redirected_to category_path(assigns(:category))
26
+ end
27
+
28
+ test "should show category" do
29
+ get :show, id: @category
30
+ assert_response :success
31
+ end
32
+
33
+ test "should get edit" do
34
+ get :edit, id: @category
35
+ assert_response :success
36
+ end
37
+
38
+ test "should update category" do
39
+ put :update, id: @category, category: { ancestry: @category.ancestry, categorical: @category.categorical, name: @category.name, position: @category.position }
40
+ assert_redirected_to category_path(assigns(:category))
41
+ end
42
+
43
+ test "should destroy category" do
44
+ assert_difference('Category.count', -1) do
45
+ delete :destroy, id: @category
46
+ end
47
+
48
+ assert_redirected_to categories_path
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,51 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class ContactFormsControllerTest < ActionController::TestCase
5
+ setup do
6
+ @contact_form = contact_forms(:one)
7
+ end
8
+
9
+ test "should get index" do
10
+ get :index
11
+ assert_response :success
12
+ assert_not_nil assigns(:contact_forms)
13
+ end
14
+
15
+ test "should get new" do
16
+ get :new
17
+ assert_response :success
18
+ end
19
+
20
+ test "should create contact_form" do
21
+ assert_difference('ContactForm.count') do
22
+ post :create, contact_form: { email: @contact_form.email, message: @contact_form.message, name: @contact_form.name, subject: @contact_form.subject }
23
+ end
24
+
25
+ assert_redirected_to contact_form_path(assigns(:contact_form))
26
+ end
27
+
28
+ test "should show contact_form" do
29
+ get :show, id: @contact_form
30
+ assert_response :success
31
+ end
32
+
33
+ test "should get edit" do
34
+ get :edit, id: @contact_form
35
+ assert_response :success
36
+ end
37
+
38
+ test "should update contact_form" do
39
+ put :update, id: @contact_form, contact_form: { email: @contact_form.email, message: @contact_form.message, name: @contact_form.name, subject: @contact_form.subject }
40
+ assert_redirected_to contact_form_path(assigns(:contact_form))
41
+ end
42
+
43
+ test "should destroy contact_form" do
44
+ assert_difference('ContactForm.count', -1) do
45
+ delete :destroy, id: @contact_form
46
+ end
47
+
48
+ assert_redirected_to contact_forms_path
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,51 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class ContentSectionsControllerTest < ActionController::TestCase
5
+ setup do
6
+ @content_section = content_sections(:one)
7
+ end
8
+
9
+ test "should get index" do
10
+ get :index
11
+ assert_response :success
12
+ assert_not_nil assigns(:content_sections)
13
+ end
14
+
15
+ test "should get new" do
16
+ get :new
17
+ assert_response :success
18
+ end
19
+
20
+ test "should create content_section" do
21
+ assert_difference('ContentSection.count') do
22
+ post :create, content_section: { content: @content_section.content, contentable_id: @content_section.contentable_id, contentable_type: @content_section.contentable_type, name: @content_section.name }
23
+ end
24
+
25
+ assert_redirected_to content_section_path(assigns(:content_section))
26
+ end
27
+
28
+ test "should show content_section" do
29
+ get :show, id: @content_section
30
+ assert_response :success
31
+ end
32
+
33
+ test "should get edit" do
34
+ get :edit, id: @content_section
35
+ assert_response :success
36
+ end
37
+
38
+ test "should update content_section" do
39
+ put :update, id: @content_section, content_section: { content: @content_section.content, contentable_id: @content_section.contentable_id, contentable_type: @content_section.contentable_type, name: @content_section.name }
40
+ assert_redirected_to content_section_path(assigns(:content_section))
41
+ end
42
+
43
+ test "should destroy content_section" do
44
+ assert_difference('ContentSection.count', -1) do
45
+ delete :destroy, id: @content_section
46
+ end
47
+
48
+ assert_redirected_to content_sections_path
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,51 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class PagesControllerTest < ActionController::TestCase
5
+ setup do
6
+ @page = pages(:one)
7
+ end
8
+
9
+ test "should get index" do
10
+ get :index
11
+ assert_response :success
12
+ assert_not_nil assigns(:pages)
13
+ end
14
+
15
+ test "should get new" do
16
+ get :new
17
+ assert_response :success
18
+ end
19
+
20
+ test "should create page" do
21
+ assert_difference('Page.count') do
22
+ post :create, page: { deletable: @page.deletable, draft: @page.draft, link_url: @page.link_url, parent_id: @page.parent_id, position: @page.position, show_in_menu: @page.show_in_menu, skip_to_first: @page.skip_to_first }
23
+ end
24
+
25
+ assert_redirected_to page_path(assigns(:page))
26
+ end
27
+
28
+ test "should show page" do
29
+ get :show, id: @page
30
+ assert_response :success
31
+ end
32
+
33
+ test "should get edit" do
34
+ get :edit, id: @page
35
+ assert_response :success
36
+ end
37
+
38
+ test "should update page" do
39
+ put :update, id: @page, page: { deletable: @page.deletable, draft: @page.draft, link_url: @page.link_url, parent_id: @page.parent_id, position: @page.position, show_in_menu: @page.show_in_menu, skip_to_first: @page.skip_to_first }
40
+ assert_redirected_to page_path(assigns(:page))
41
+ end
42
+
43
+ test "should destroy page" do
44
+ assert_difference('Page.count', -1) do
45
+ delete :destroy, id: @page
46
+ end
47
+
48
+ assert_redirected_to pages_path
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,51 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class PortfoliosControllerTest < ActionController::TestCase
5
+ setup do
6
+ @portfolio = portfolios(:one)
7
+ end
8
+
9
+ test "should get index" do
10
+ get :index
11
+ assert_response :success
12
+ assert_not_nil assigns(:portfolios)
13
+ end
14
+
15
+ test "should get new" do
16
+ get :new
17
+ assert_response :success
18
+ end
19
+
20
+ test "should create portfolio" do
21
+ assert_difference('Portfolio.count') do
22
+ post :create, portfolio: { content: @portfolio.content, intro: @portfolio.intro, title: @portfolio.title }
23
+ end
24
+
25
+ assert_redirected_to portfolio_path(assigns(:portfolio))
26
+ end
27
+
28
+ test "should show portfolio" do
29
+ get :show, id: @portfolio
30
+ assert_response :success
31
+ end
32
+
33
+ test "should get edit" do
34
+ get :edit, id: @portfolio
35
+ assert_response :success
36
+ end
37
+
38
+ test "should update portfolio" do
39
+ put :update, id: @portfolio, portfolio: { content: @portfolio.content, intro: @portfolio.intro, title: @portfolio.title }
40
+ assert_redirected_to portfolio_path(assigns(:portfolio))
41
+ end
42
+
43
+ test "should destroy portfolio" do
44
+ assert_difference('Portfolio.count', -1) do
45
+ delete :destroy, id: @portfolio
46
+ end
47
+
48
+ assert_redirected_to portfolios_path
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,51 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class PostsControllerTest < ActionController::TestCase
5
+ setup do
6
+ @post = posts(:one)
7
+ end
8
+
9
+ test "should get index" do
10
+ get :index
11
+ assert_response :success
12
+ assert_not_nil assigns(:posts)
13
+ end
14
+
15
+ test "should get new" do
16
+ get :new
17
+ assert_response :success
18
+ end
19
+
20
+ test "should create post" do
21
+ assert_difference('Post.count') do
22
+ post :create, post: { draft: @post.draft, link_url: @post.link_url, published_at: @post.published_at }
23
+ end
24
+
25
+ assert_redirected_to post_path(assigns(:post))
26
+ end
27
+
28
+ test "should show post" do
29
+ get :show, id: @post
30
+ assert_response :success
31
+ end
32
+
33
+ test "should get edit" do
34
+ get :edit, id: @post
35
+ assert_response :success
36
+ end
37
+
38
+ test "should update post" do
39
+ put :update, id: @post, post: { draft: @post.draft, link_url: @post.link_url, published_at: @post.published_at }
40
+ assert_redirected_to post_path(assigns(:post))
41
+ end
42
+
43
+ test "should destroy post" do
44
+ assert_difference('Post.count', -1) do
45
+ delete :destroy, id: @post
46
+ end
47
+
48
+ assert_redirected_to posts_path
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,51 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class RolesControllerTest < ActionController::TestCase
5
+ setup do
6
+ @role = roles(:one)
7
+ end
8
+
9
+ test "should get index" do
10
+ get :index
11
+ assert_response :success
12
+ assert_not_nil assigns(:roles)
13
+ end
14
+
15
+ test "should get new" do
16
+ get :new
17
+ assert_response :success
18
+ end
19
+
20
+ test "should create role" do
21
+ assert_difference('Role.count') do
22
+ post :create, role: { name: @role.name }
23
+ end
24
+
25
+ assert_redirected_to role_path(assigns(:role))
26
+ end
27
+
28
+ test "should show role" do
29
+ get :show, id: @role
30
+ assert_response :success
31
+ end
32
+
33
+ test "should get edit" do
34
+ get :edit, id: @role
35
+ assert_response :success
36
+ end
37
+
38
+ test "should update role" do
39
+ put :update, id: @role, role: { name: @role.name }
40
+ assert_redirected_to role_path(assigns(:role))
41
+ end
42
+
43
+ test "should destroy role" do
44
+ assert_difference('Role.count', -1) do
45
+ delete :destroy, id: @role
46
+ end
47
+
48
+ assert_redirected_to roles_path
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,51 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class SlidesControllerTest < ActionController::TestCase
5
+ setup do
6
+ @slide = slides(:one)
7
+ end
8
+
9
+ test "should get index" do
10
+ get :index
11
+ assert_response :success
12
+ assert_not_nil assigns(:slides)
13
+ end
14
+
15
+ test "should get new" do
16
+ get :new
17
+ assert_response :success
18
+ end
19
+
20
+ test "should create slide" do
21
+ assert_difference('Slide.count') do
22
+ post :create, slide: { name: @slide.name }
23
+ end
24
+
25
+ assert_redirected_to slide_path(assigns(:slide))
26
+ end
27
+
28
+ test "should show slide" do
29
+ get :show, id: @slide
30
+ assert_response :success
31
+ end
32
+
33
+ test "should get edit" do
34
+ get :edit, id: @slide
35
+ assert_response :success
36
+ end
37
+
38
+ test "should update slide" do
39
+ put :update, id: @slide, slide: { name: @slide.name }
40
+ assert_redirected_to slide_path(assigns(:slide))
41
+ end
42
+
43
+ test "should destroy slide" do
44
+ assert_difference('Slide.count', -1) do
45
+ delete :destroy, id: @slide
46
+ end
47
+
48
+ assert_redirected_to slides_path
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,51 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class UsersControllerTest < ActionController::TestCase
5
+ setup do
6
+ @user = users(:one)
7
+ end
8
+
9
+ test "should get index" do
10
+ get :index
11
+ assert_response :success
12
+ assert_not_nil assigns(:users)
13
+ end
14
+
15
+ test "should get new" do
16
+ get :new
17
+ assert_response :success
18
+ end
19
+
20
+ test "should create user" do
21
+ assert_difference('User.count') do
22
+ post :create, user: { email: @user.email, password: @user.password, username: @user.username }
23
+ end
24
+
25
+ assert_redirected_to user_path(assigns(:user))
26
+ end
27
+
28
+ test "should show user" do
29
+ get :show, id: @user
30
+ assert_response :success
31
+ end
32
+
33
+ test "should get edit" do
34
+ get :edit, id: @user
35
+ assert_response :success
36
+ end
37
+
38
+ test "should update user" do
39
+ put :update, id: @user, user: { email: @user.email, password: @user.password, username: @user.username }
40
+ assert_redirected_to user_path(assigns(:user))
41
+ end
42
+
43
+ test "should destroy user" do
44
+ assert_difference('User.count', -1) do
45
+ delete :destroy, id: @user
46
+ end
47
+
48
+ assert_redirected_to users_path
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,10 @@
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
+
@@ -0,0 +1,15 @@
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 }
11
+
12
+ # Load fixtures from the engine
13
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
15
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class AssetsHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class CategoriesHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class ContactFormsHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class ContentSectionsHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class PagesHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class PortfoliosHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class PostsHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class RolesHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class SlidesHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class UsersHelperTest < ActionView::TestCase
5
+ end
6
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class AssetTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class CategoryTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class ContactFormTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class ContentSectionTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class ImageTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class MetaContentTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class PageTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class PortfolioTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class PostTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Wafflemix
4
+ class RoleTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end