active_admin-state_machine 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +136 -0
  4. data/Rakefile +17 -0
  5. data/lib/active_admin/state_machine.rb +6 -0
  6. data/lib/active_admin/state_machine/dsl.rb +60 -0
  7. data/lib/active_admin/state_machine/version.rb +5 -0
  8. data/spec/dummy/README.rdoc +261 -0
  9. data/spec/dummy/Rakefile +7 -0
  10. data/spec/dummy/app/admin/admin_users.rb +20 -0
  11. data/spec/dummy/app/admin/categories.rb +5 -0
  12. data/spec/dummy/app/admin/dashboard.rb +33 -0
  13. data/spec/dummy/app/admin/posts.rb +21 -0
  14. data/spec/dummy/app/assets/javascripts/active_admin.js +1 -0
  15. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  16. data/spec/dummy/app/assets/stylesheets/active_admin.css.scss +29 -0
  17. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  18. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  19. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  20. data/spec/dummy/app/models/ability.rb +12 -0
  21. data/spec/dummy/app/models/admin_user.rb +11 -0
  22. data/spec/dummy/app/models/category.rb +4 -0
  23. data/spec/dummy/app/models/post.rb +31 -0
  24. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  25. data/spec/dummy/config.ru +4 -0
  26. data/spec/dummy/config/application.rb +65 -0
  27. data/spec/dummy/config/boot.rb +10 -0
  28. data/spec/dummy/config/database.sample.yml +25 -0
  29. data/spec/dummy/config/database.travis.yml +4 -0
  30. data/spec/dummy/config/database.yml +12 -0
  31. data/spec/dummy/config/environment.rb +5 -0
  32. data/spec/dummy/config/environments/development.rb +38 -0
  33. data/spec/dummy/config/environments/production.rb +67 -0
  34. data/spec/dummy/config/environments/test.rb +37 -0
  35. data/spec/dummy/config/initializers/active_admin.rb +211 -0
  36. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  37. data/spec/dummy/config/initializers/devise.rb +252 -0
  38. data/spec/dummy/config/initializers/inflections.rb +15 -0
  39. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  40. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  41. data/spec/dummy/config/initializers/session_store.rb +8 -0
  42. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  43. data/spec/dummy/config/locales/devise.en.yml +59 -0
  44. data/spec/dummy/config/locales/en.yml +10 -0
  45. data/spec/dummy/config/routes.rb +61 -0
  46. data/spec/dummy/db/development.sqlite3 +0 -0
  47. data/spec/dummy/db/migrate/20130817004304_devise_create_admin_users.rb +52 -0
  48. data/spec/dummy/db/migrate/20130817004306_create_admin_notes.rb +17 -0
  49. data/spec/dummy/db/migrate/20130817004307_move_admin_notes_to_comments.rb +26 -0
  50. data/spec/dummy/db/migrate/20130817005638_create_posts.rb +11 -0
  51. data/spec/dummy/db/migrate/20130829000200_create_categories.rb +11 -0
  52. data/spec/dummy/db/migrate/20131025231118_add_super_admin_to_admin_users.rb +5 -0
  53. data/spec/dummy/db/schema.rb +65 -0
  54. data/spec/dummy/db/seeds.rb +1 -0
  55. data/spec/dummy/db/test.sqlite3 +0 -0
  56. data/spec/dummy/log/development.log +9116 -0
  57. data/spec/dummy/log/test.log +2969 -0
  58. data/spec/dummy/public/404.html +26 -0
  59. data/spec/dummy/public/422.html +26 -0
  60. data/spec/dummy/public/500.html +25 -0
  61. data/spec/dummy/public/favicon.ico +0 -0
  62. data/spec/dummy/script/rails +6 -0
  63. data/spec/dummy/tmp/cache/assets/C6E/0F0/sprockets%2F930c17aa4002b266315478d747cec213 +0 -0
  64. data/spec/dummy/tmp/cache/assets/CA3/0F0/sprockets%2F6111c5f7d680071cae83281d5237bb52 +0 -0
  65. data/spec/dummy/tmp/cache/assets/CAE/C10/sprockets%2Fa28299b4afd821b21049164940fe6a29 +0 -0
  66. data/spec/dummy/tmp/cache/assets/CDB/040/sprockets%2Fc732474e67003a4eb840eb44c5ca9385 +0 -0
  67. data/spec/dummy/tmp/cache/assets/CE1/700/sprockets%2F9e9ac16860d51b9e1245e02a8bd98125 +0 -0
  68. data/spec/dummy/tmp/cache/assets/CE6/660/sprockets%2F90e738777deb87d405d03a2f251b547d +0 -0
  69. data/spec/dummy/tmp/cache/assets/CED/B50/sprockets%2F23b334e745d2ceb50b677668a367de99 +0 -0
  70. data/spec/dummy/tmp/cache/assets/CF3/0A0/sprockets%2F75abab8c479e90729ca78828102e5e78 +0 -0
  71. data/spec/dummy/tmp/cache/assets/CF6/EE0/sprockets%2F3f96414b8e9655fb831972cc81b6b95d +0 -0
  72. data/spec/dummy/tmp/cache/assets/D00/800/sprockets%2F5fe66f0484322d5cda7408c0cb030c36 +0 -0
  73. data/spec/dummy/tmp/cache/assets/D09/E60/sprockets%2Fd61ab529e52f740f6d26a7b3bc082914 +0 -0
  74. data/spec/dummy/tmp/cache/assets/D0B/400/sprockets%2Ff4f1a7e6cca869f56232e07440d0242e +0 -0
  75. data/spec/dummy/tmp/cache/assets/D0D/8D0/sprockets%2Fb048e1909af567b1e61c8f18dd3b4134 +0 -0
  76. data/spec/dummy/tmp/cache/assets/D0E/750/sprockets%2F535f852b14c3f64b6d4498e281ba6aa3 +0 -0
  77. data/spec/dummy/tmp/cache/assets/D1B/330/sprockets%2Fb7c84f061393bf7dac846cd173863c57 +0 -0
  78. data/spec/dummy/tmp/cache/assets/D20/AE0/sprockets%2F25d0f6af9dd375937908ad493464d3ce +0 -0
  79. data/spec/dummy/tmp/cache/assets/D2F/A20/sprockets%2F006e5a12b1bb0fc15555ad556589be6b +0 -0
  80. data/spec/dummy/tmp/cache/assets/D38/540/sprockets%2F86e1ad844bc9df4491a2a52b870421db +0 -0
  81. data/spec/dummy/tmp/cache/assets/D3E/AA0/sprockets%2F77115ed12f0f2812dd9284b1badf974e +0 -0
  82. data/spec/dummy/tmp/cache/assets/D45/B50/sprockets%2F3eb36e58b929a7cb215ec6cd90730f38 +0 -0
  83. data/spec/dummy/tmp/cache/assets/D45/BD0/sprockets%2F2def1531b613ed7a7dbfb87119f63667 +0 -0
  84. data/spec/dummy/tmp/cache/assets/D48/640/sprockets%2F9f4f18d910b678b1d0777e04cdaf6f24 +0 -0
  85. data/spec/dummy/tmp/cache/assets/D4C/C80/sprockets%2F298e59aa2551dcef562bdfd65908462d +0 -0
  86. data/spec/dummy/tmp/cache/assets/D59/D70/sprockets%2Fed9f0de1b65ae8d7ef89087c83728461 +0 -0
  87. data/spec/dummy/tmp/cache/assets/D63/930/sprockets%2F8877deb95181465893a12fc98feefea9 +0 -0
  88. data/spec/dummy/tmp/cache/assets/D67/9A0/sprockets%2F2b5fbe497968ed201d0ff0dca410d319 +0 -0
  89. data/spec/dummy/tmp/cache/assets/D78/560/sprockets%2Fdbe66652ccfa390de76149634dd82e1f +0 -0
  90. data/spec/dummy/tmp/cache/assets/D93/4C0/sprockets%2F857ecd2092cee11f740b3cf2e373ad2a +0 -0
  91. data/spec/dummy/tmp/cache/assets/D9A/FA0/sprockets%2Fe32c0ff23c6a4084195aafcff444fe63 +0 -0
  92. data/spec/dummy/tmp/cache/assets/DA3/450/sprockets%2Ff6563ad6efdc449e5219ea221c75fcc3 +0 -0
  93. data/spec/dummy/tmp/cache/assets/DA4/050/sprockets%2Fb09f488a4f238bf22bc82cef50a6f84d +0 -0
  94. data/spec/dummy/tmp/cache/assets/DD7/FE0/sprockets%2Ff00de35ea71cb4fc5fc5e96860f5ee55 +0 -0
  95. data/spec/dummy/tmp/cache/assets/DDE/420/sprockets%2Ffb8b186d5bf0307f86f65fc787d2adeb +0 -0
  96. data/spec/dummy/tmp/cache/assets/DE6/B50/sprockets%2Febd2b61aa5d1e7bd84e31523e1bc71ac +0 -0
  97. data/spec/dummy/tmp/cache/assets/DF0/870/sprockets%2F1e4ab2eb47da0bb42b6e37e38639cbae +0 -0
  98. data/spec/dummy/tmp/cache/assets/DFA/CD0/sprockets%2F6bb1e8a62edbd48cf00dc678d1f0f65a +0 -0
  99. data/spec/dummy/tmp/cache/assets/E32/990/sprockets%2F2f6fe5d3fae5b4dba7e7cc36ca68e415 +0 -0
  100. data/spec/dummy/tmp/cache/sass/021f0a44d22f3712e4de7c01de2d6b99f65f2482/_bourbon-deprecated-upcoming.scssc +0 -0
  101. data/spec/dummy/tmp/cache/sass/021f0a44d22f3712e4de7c01de2d6b99f65f2482/_bourbon.scssc +0 -0
  102. data/spec/dummy/tmp/cache/sass/0733f78978a3764d0f20e2bea650007fb2bf064b/_compact.scssc +0 -0
  103. data/spec/dummy/tmp/cache/sass/0733f78978a3764d0f20e2bea650007fb2bf064b/_flex-grid.scssc +0 -0
  104. data/spec/dummy/tmp/cache/sass/0733f78978a3764d0f20e2bea650007fb2bf064b/_grid-width.scssc +0 -0
  105. data/spec/dummy/tmp/cache/sass/0733f78978a3764d0f20e2bea650007fb2bf064b/_linear-gradient.scssc +0 -0
  106. data/spec/dummy/tmp/cache/sass/0733f78978a3764d0f20e2bea650007fb2bf064b/_modular-scale.scssc +0 -0
  107. data/spec/dummy/tmp/cache/sass/0733f78978a3764d0f20e2bea650007fb2bf064b/_px-to-em.scssc +0 -0
  108. data/spec/dummy/tmp/cache/sass/0733f78978a3764d0f20e2bea650007fb2bf064b/_radial-gradient.scssc +0 -0
  109. data/spec/dummy/tmp/cache/sass/0733f78978a3764d0f20e2bea650007fb2bf064b/_tint-shade.scssc +0 -0
  110. data/spec/dummy/tmp/cache/sass/0733f78978a3764d0f20e2bea650007fb2bf064b/_transition-property-name.scssc +0 -0
  111. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_batch_actions.css.scssc +0 -0
  112. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_blank_slates.scssc +0 -0
  113. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_breadcrumbs.scssc +0 -0
  114. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_buttons.scssc +0 -0
  115. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_columns.scssc +0 -0
  116. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_comments.css.scssc +0 -0
  117. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_date_picker.css.scssc +0 -0
  118. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_dropdown_menu.scssc +0 -0
  119. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_flash_messages.css.scssc +0 -0
  120. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_grid.scssc +0 -0
  121. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_index_list.scssc +0 -0
  122. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_links.scssc +0 -0
  123. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_pagination.scssc +0 -0
  124. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_panels.scssc +0 -0
  125. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_popovers.css.scssc +0 -0
  126. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_scopes.scssc +0 -0
  127. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_status_tags.scssc +0 -0
  128. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_table_tools.css.scssc +0 -0
  129. data/spec/dummy/tmp/cache/sass/2fd82df35090e4bb74fb9a41455f20a1e79db68a/_tables.css.scssc +0 -0
  130. data/spec/dummy/tmp/cache/sass/49a924645aad7b7327372ccd94e45cbdf78ae4ff/_all.css.scssc +0 -0
  131. data/spec/dummy/tmp/cache/sass/49a924645aad7b7327372ccd94e45cbdf78ae4ff/_buttons.css.scssc +0 -0
  132. data/spec/dummy/tmp/cache/sass/49a924645aad7b7327372ccd94e45cbdf78ae4ff/_gradients.css.scssc +0 -0
  133. data/spec/dummy/tmp/cache/sass/49a924645aad7b7327372ccd94e45cbdf78ae4ff/_icons.css.scssc +0 -0
  134. data/spec/dummy/tmp/cache/sass/49a924645aad7b7327372ccd94e45cbdf78ae4ff/_reset.css.scssc +0 -0
  135. data/spec/dummy/tmp/cache/sass/49a924645aad7b7327372ccd94e45cbdf78ae4ff/_rounded.css.scssc +0 -0
  136. data/spec/dummy/tmp/cache/sass/49a924645aad7b7327372ccd94e45cbdf78ae4ff/_sections.css.scssc +0 -0
  137. data/spec/dummy/tmp/cache/sass/49a924645aad7b7327372ccd94e45cbdf78ae4ff/_shadows.css.scssc +0 -0
  138. data/spec/dummy/tmp/cache/sass/49a924645aad7b7327372ccd94e45cbdf78ae4ff/_typography.scssc +0 -0
  139. data/spec/dummy/tmp/cache/sass/49a924645aad7b7327372ccd94e45cbdf78ae4ff/_utilities.scssc +0 -0
  140. data/spec/dummy/tmp/cache/sass/49a924645aad7b7327372ccd94e45cbdf78ae4ff/_variables.css.scssc +0 -0
  141. data/spec/dummy/tmp/cache/sass/97d1d5c145c2924a55e7b5d99d290112170b74f0/_footer.scssc +0 -0
  142. data/spec/dummy/tmp/cache/sass/97d1d5c145c2924a55e7b5d99d290112170b74f0/_main_structure.scssc +0 -0
  143. data/spec/dummy/tmp/cache/sass/97d1d5c145c2924a55e7b5d99d290112170b74f0/_title_bar.scssc +0 -0
  144. data/spec/dummy/tmp/cache/sass/a88ac2680a1680d7d2a5f8b0c7dc7f5e3131ade5/_button.scssc +0 -0
  145. data/spec/dummy/tmp/cache/sass/a88ac2680a1680d7d2a5f8b0c7dc7f5e3131ade5/_clearfix.scssc +0 -0
  146. data/spec/dummy/tmp/cache/sass/a88ac2680a1680d7d2a5f8b0c7dc7f5e3131ade5/_font-family.scssc +0 -0
  147. data/spec/dummy/tmp/cache/sass/a88ac2680a1680d7d2a5f8b0c7dc7f5e3131ade5/_hide-text.scssc +0 -0
  148. data/spec/dummy/tmp/cache/sass/a88ac2680a1680d7d2a5f8b0c7dc7f5e3131ade5/_html5-input-types.scssc +0 -0
  149. data/spec/dummy/tmp/cache/sass/a88ac2680a1680d7d2a5f8b0c7dc7f5e3131ade5/_position.scssc +0 -0
  150. data/spec/dummy/tmp/cache/sass/a88ac2680a1680d7d2a5f8b0c7dc7f5e3131ade5/_prefixer.scssc +0 -0
  151. data/spec/dummy/tmp/cache/sass/a88ac2680a1680d7d2a5f8b0c7dc7f5e3131ade5/_retina-image.scssc +0 -0
  152. data/spec/dummy/tmp/cache/sass/a88ac2680a1680d7d2a5f8b0c7dc7f5e3131ade5/_size.scssc +0 -0
  153. data/spec/dummy/tmp/cache/sass/a88ac2680a1680d7d2a5f8b0c7dc7f5e3131ade5/_timing-functions.scssc +0 -0
  154. data/spec/dummy/tmp/cache/sass/a88ac2680a1680d7d2a5f8b0c7dc7f5e3131ade5/_triangle.scssc +0 -0
  155. data/spec/dummy/tmp/cache/sass/c10713f51b89c2fd0ebe39519f07849be30ad7dc/_deprecated-webkit-gradient.scssc +0 -0
  156. data/spec/dummy/tmp/cache/sass/c10713f51b89c2fd0ebe39519f07849be30ad7dc/_gradient-positions-parser.scssc +0 -0
  157. data/spec/dummy/tmp/cache/sass/c10713f51b89c2fd0ebe39519f07849be30ad7dc/_linear-positions-parser.scssc +0 -0
  158. data/spec/dummy/tmp/cache/sass/c10713f51b89c2fd0ebe39519f07849be30ad7dc/_radial-arg-parser.scssc +0 -0
  159. data/spec/dummy/tmp/cache/sass/c10713f51b89c2fd0ebe39519f07849be30ad7dc/_radial-positions-parser.scssc +0 -0
  160. data/spec/dummy/tmp/cache/sass/c10713f51b89c2fd0ebe39519f07849be30ad7dc/_render-gradients.scssc +0 -0
  161. data/spec/dummy/tmp/cache/sass/c10713f51b89c2fd0ebe39519f07849be30ad7dc/_shape-size-stripper.scssc +0 -0
  162. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_animation.scssc +0 -0
  163. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_appearance.scssc +0 -0
  164. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_backface-visibility.scssc +0 -0
  165. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_background-image.scssc +0 -0
  166. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_background.scssc +0 -0
  167. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_border-image.scssc +0 -0
  168. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_border-radius.scssc +0 -0
  169. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_box-sizing.scssc +0 -0
  170. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_columns.scssc +0 -0
  171. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_flex-box.scssc +0 -0
  172. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_font-face.scssc +0 -0
  173. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_hidpi-media-query.scssc +0 -0
  174. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_image-rendering.scssc +0 -0
  175. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_inline-block.scssc +0 -0
  176. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_keyframes.scssc +0 -0
  177. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_linear-gradient.scssc +0 -0
  178. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_perspective.scssc +0 -0
  179. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_placeholder.scssc +0 -0
  180. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_radial-gradient.scssc +0 -0
  181. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_transform.scssc +0 -0
  182. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_transition.scssc +0 -0
  183. data/spec/dummy/tmp/cache/sass/c440ddc8eb3b4ee623e7dfe6ab824cc1e13dc16d/_user-select.scssc +0 -0
  184. data/spec/dummy/tmp/cache/sass/c7fb764b3bec96a92cf65b0d831789c5ca3c5ed7/active_admin.css.scssc +0 -0
  185. data/spec/dummy/tmp/cache/sass/cb0cbb3d3d7b7c51feca169c780bb955b45511b4/_dashboard.scssc +0 -0
  186. data/spec/dummy/tmp/cache/sass/cb0cbb3d3d7b7c51feca169c780bb955b45511b4/_logged_out.scssc +0 -0
  187. data/spec/dummy/tmp/cache/sass/eeb938f07a558025f0485a33a8e74dcc19262df9/_base.css.scssc +0 -0
  188. data/spec/dummy/tmp/cache/sass/eeb938f07a558025f0485a33a8e74dcc19262df9/_forms.css.scssc +0 -0
  189. data/spec/dummy/tmp/cache/sass/eeb938f07a558025f0485a33a8e74dcc19262df9/_header.css.scssc +0 -0
  190. data/spec/dummy/tmp/cache/sass/eeb938f07a558025f0485a33a8e74dcc19262df9/_mixins.css.scssc +0 -0
  191. data/spec/dummy/tmp/cache/sass/eeb938f07a558025f0485a33a8e74dcc19262df9/_typography.css.scssc +0 -0
  192. data/spec/dummy/tmp/cache/sass/eeb938f07a558025f0485a33a8e74dcc19262df9/print.css.scssc +0 -0
  193. data/spec/dummy/tmp/pids/server.pid +1 -0
  194. data/spec/factories/admin_users.rb +8 -0
  195. data/spec/factories/categories.rb +17 -0
  196. data/spec/factories/posts.rb +11 -0
  197. data/spec/features/authorization_spec.rb +23 -0
  198. data/spec/features/custom_block_spec.rb +25 -0
  199. data/spec/features/js_confirmation_spec.rb +51 -0
  200. data/spec/spec_helper.rb +54 -0
  201. data/spec/support/post_helpers.rb +22 -0
  202. metadata +605 -0
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Raise exception on mass assignment protection for Active Record models
33
+ config.active_record.mass_assignment_sanitizer = :strict
34
+
35
+ # Print deprecation notices to the stderr
36
+ config.active_support.deprecation = :stderr
37
+ end
@@ -0,0 +1,211 @@
1
+ ActiveAdmin.setup do |config|
2
+
3
+ # == Site Title
4
+ #
5
+ # Set the title that is displayed on the main layout
6
+ # for each of the active admin pages.
7
+ #
8
+ config.site_title = "Dummy"
9
+
10
+ # Set the link url for the title. For example, to take
11
+ # users to your main site. Defaults to no link.
12
+ #
13
+ # config.site_title_link = "/"
14
+
15
+ # Set an optional image to be displayed for the header
16
+ # instead of a string (overrides :site_title)
17
+ #
18
+ # Note: Recommended image height is 21px to properly fit in the header
19
+ #
20
+ # config.site_title_image = "/images/logo.png"
21
+
22
+ # == Default Namespace
23
+ #
24
+ # Set the default namespace each administration resource
25
+ # will be added to.
26
+ #
27
+ # eg:
28
+ # config.default_namespace = :hello_world
29
+ #
30
+ # This will create resources in the HelloWorld module and
31
+ # will namespace routes to /hello_world/*
32
+ #
33
+ # To set no namespace by default, use:
34
+ # config.default_namespace = false
35
+ #
36
+ # Default:
37
+ # config.default_namespace = :admin
38
+ #
39
+ # You can customize the settings for each namespace by using
40
+ # a namespace block. For example, to change the site title
41
+ # within a namespace:
42
+ #
43
+ # config.namespace :admin do |admin|
44
+ # admin.site_title = "Custom Admin Title"
45
+ # end
46
+ #
47
+ # This will ONLY change the title for the admin section. Other
48
+ # namespaces will continue to use the main "site_title" configuration.
49
+
50
+ # == User Authentication
51
+ #
52
+ # Active Admin will automatically call an authentication
53
+ # method in a before filter of all controller actions to
54
+ # ensure that there is a currently logged in admin user.
55
+ #
56
+ # This setting changes the method which Active Admin calls
57
+ # within the controller.
58
+ config.authentication_method = :authenticate_admin_user!
59
+
60
+
61
+ # == Current User
62
+ #
63
+ # Active Admin will associate actions with the current
64
+ # user performing them.
65
+ #
66
+ # This setting changes the method which Active Admin calls
67
+ # to return the currently logged in user.
68
+ config.current_user_method = :current_admin_user
69
+
70
+
71
+ # == Logging Out
72
+ #
73
+ # Active Admin displays a logout link on each screen. These
74
+ # settings configure the location and method used for the link.
75
+ #
76
+ # This setting changes the path where the link points to. If it's
77
+ # a string, the strings is used as the path. If it's a Symbol, we
78
+ # will call the method to return the path.
79
+ #
80
+ # Default:
81
+ config.logout_link_path = :destroy_admin_user_session_path
82
+
83
+ # This setting changes the http method used when rendering the
84
+ # link. For example :get, :delete, :put, etc..
85
+ #
86
+ # Default:
87
+ # config.logout_link_method = :get
88
+
89
+ # == Root
90
+ #
91
+ # Set the action to call for the root path. You can set different
92
+ # roots for each namespace.
93
+ #
94
+ # Default:
95
+ # config.root_to = 'dashboard#index'
96
+
97
+ # == Admin Comments
98
+ #
99
+ # Admin comments allow you to add comments to any model for admin use.
100
+ # Admin comments are enabled by default.
101
+ #
102
+ # Default:
103
+ config.allow_comments = false
104
+ #
105
+ # You can turn them on and off for any given namespace by using a
106
+ # namespace config block.
107
+ #
108
+ # Eg:
109
+ # config.namespace :without_comments do |without_comments|
110
+ # without_comments.allow_comments = false
111
+ # end
112
+
113
+
114
+ # == Batch Actions
115
+ #
116
+ # Enable and disable Batch Actions
117
+ #
118
+ config.batch_actions = true
119
+
120
+
121
+ # == Controller Filters
122
+ #
123
+ # You can add before, after and around filters to all of your
124
+ # Active Admin resources and pages from here.
125
+ #
126
+ # config.before_filter :do_something_awesome
127
+
128
+
129
+ # == Register Stylesheets & Javascripts
130
+ #
131
+ # We recommend using the built in Active Admin layout and loading
132
+ # up your own stylesheets / javascripts to customize the look
133
+ # and feel.
134
+ #
135
+ # To load a stylesheet:
136
+ # config.register_stylesheet 'my_stylesheet.css'
137
+
138
+ # You can provide an options hash for more control, which is passed along to stylesheet_link_tag():
139
+ # config.register_stylesheet 'my_print_stylesheet.css', :media => :print
140
+ #
141
+ # To load a javascript file:
142
+ # config.register_javascript 'my_javascript.js'
143
+
144
+
145
+ # == CSV options
146
+ #
147
+ # Set the CSV builder separator (default is ",")
148
+ # config.csv_column_separator = ','
149
+ #
150
+ # Set the CSV builder options (default is {})
151
+ # config.csv_options = {}
152
+
153
+
154
+ # == Menu System
155
+ #
156
+ # You can add a navigation menu to be used in your application, or configure a provided menu
157
+ #
158
+ # To change the default utility navigation to show a link to your website & a logout btn
159
+ #
160
+ # config.namespace :admin do |admin|
161
+ # admin.build_menu :utility_navigation do |menu|
162
+ # menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
163
+ # admin.add_logout_button_to_menu menu
164
+ # end
165
+ # end
166
+ #
167
+ # If you wanted to add a static menu item to the default menu provided:
168
+ #
169
+ # config.namespace :admin do |admin|
170
+ # admin.build_menu :default do |menu|
171
+ # menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
172
+ # end
173
+ # end
174
+
175
+ # == Download Links
176
+ #
177
+ # You can disable download links on resource listing pages,
178
+ # or customize the formats shown per namespace/globally
179
+ #
180
+ # To disable/customize for the :admin namespace:
181
+ #
182
+ # config.namespace :admin do |admin|
183
+ #
184
+ # # Disable the links entirely
185
+ # admin.download_links = false
186
+ #
187
+ # # Only show XML & PDF options
188
+ # admin.download_links = [:xml, :pdf]
189
+ #
190
+ # end
191
+
192
+
193
+ # == Pagination
194
+ #
195
+ # Pagination is enabled by default for all resources.
196
+ # You can control the default per page count for all resources here.
197
+ #
198
+ # config.default_per_page = 30
199
+
200
+
201
+ # == Filters
202
+ #
203
+ # By default the index screen includes a “Filters” sidebar on the right
204
+ # hand side with a filter for each attribute of the registered model.
205
+ # You can enable or disable them for all resources here.
206
+ #
207
+ # config.filters = true
208
+
209
+ config.authorization_adapter = "ActiveAdmin::CanCanAdapter"
210
+
211
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,252 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth.
2
+ # Many of these configuration options can be set straight in your model.
3
+ Devise.setup do |config|
4
+ # ==> Mailer Configuration
5
+ # Configure the e-mail address which will be shown in Devise::Mailer,
6
+ # note that it will be overwritten if you use your own mailer class with default "from" parameter.
7
+ config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
8
+
9
+ # Configure the class responsible to send e-mails.
10
+ # config.mailer = "Devise::Mailer"
11
+
12
+ # ==> ORM configuration
13
+ # Load and configure the ORM. Supports :active_record (default) and
14
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
15
+ # available as additional gems.
16
+ require 'devise/orm/active_record'
17
+
18
+ # ==> Configuration for any authentication mechanism
19
+ # Configure which keys are used when authenticating a user. The default is
20
+ # just :email. You can configure it to use [:username, :subdomain], so for
21
+ # authenticating a user, both parameters are required. Remember that those
22
+ # parameters are used only when authenticating and not when retrieving from
23
+ # session. If you need permissions, you should implement that in a before filter.
24
+ # You can also supply a hash where the value is a boolean determining whether
25
+ # or not authentication should be aborted when the value is not present.
26
+ # config.authentication_keys = [ :email ]
27
+
28
+ # Configure parameters from the request object used for authentication. Each entry
29
+ # given should be a request method and it will automatically be passed to the
30
+ # find_for_authentication method and considered in your model lookup. For instance,
31
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
32
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
33
+ # config.request_keys = []
34
+
35
+ # Configure which authentication keys should be case-insensitive.
36
+ # These keys will be downcased upon creating or modifying a user and when used
37
+ # to authenticate or find a user. Default is :email.
38
+ config.case_insensitive_keys = [ :email ]
39
+
40
+ # Configure which authentication keys should have whitespace stripped.
41
+ # These keys will have whitespace before and after removed upon creating or
42
+ # modifying a user and when used to authenticate or find a user. Default is :email.
43
+ config.strip_whitespace_keys = [ :email ]
44
+
45
+ # Tell if authentication through request.params is enabled. True by default.
46
+ # It can be set to an array that will enable params authentication only for the
47
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
48
+ # enable it only for database (email + password) authentication.
49
+ # config.params_authenticatable = true
50
+
51
+ # Tell if authentication through HTTP Auth is enabled. False by default.
52
+ # It can be set to an array that will enable http authentication only for the
53
+ # given strategies, for example, `config.http_authenticatable = [:token]` will
54
+ # enable it only for token authentication. The supported strategies are:
55
+ # :database = Support basic authentication with authentication key + password
56
+ # :token = Support basic authentication with token authentication key
57
+ # :token_options = Support token authentication with options as defined in
58
+ # http://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Token.html
59
+ # config.http_authenticatable = false
60
+
61
+ # If http headers should be returned for AJAX requests. True by default.
62
+ # config.http_authenticatable_on_xhr = true
63
+
64
+ # The realm used in Http Basic Authentication. "Application" by default.
65
+ # config.http_authentication_realm = "Application"
66
+
67
+ # It will change confirmation, password recovery and other workflows
68
+ # to behave the same regardless if the e-mail provided was right or wrong.
69
+ # Does not affect registerable.
70
+ # config.paranoid = true
71
+
72
+ # By default Devise will store the user in session. You can skip storage for
73
+ # :http_auth and :token_auth by adding those symbols to the array below.
74
+ # Notice that if you are skipping storage for all authentication paths, you
75
+ # may want to disable generating routes to Devise's sessions controller by
76
+ # passing :skip => :sessions to `devise_for` in your config/routes.rb
77
+ config.skip_session_storage = [:http_auth]
78
+
79
+ # By default, Devise cleans up the CSRF token on authentication to
80
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
81
+ # requests for sign in and sign up, you need to get a new CSRF token
82
+ # from the server. You can disable this option at your own risk.
83
+ # config.clean_up_csrf_token_on_authentication = true
84
+
85
+ # ==> Configuration for :database_authenticatable
86
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
87
+ # using other encryptors, it sets how many times you want the password re-encrypted.
88
+ #
89
+ # Limiting the stretches to just one in testing will increase the performance of
90
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
91
+ # a value less than 10 in other environments.
92
+ config.stretches = Rails.env.test? ? 1 : 10
93
+
94
+ # Setup a pepper to generate the encrypted password.
95
+ # config.pepper = "2d9d8c21cb198f569399a5550cd5dda1bbcfb25865926070a6f31c42f0d8447f99f00c935ca1fca7ca0493a2060b4053f1990fcc3be195e5f7fabeb004f344b5"
96
+
97
+ # ==> Configuration for :confirmable
98
+ # A period that the user is allowed to access the website even without
99
+ # confirming his account. For instance, if set to 2.days, the user will be
100
+ # able to access the website for two days without confirming his account,
101
+ # access will be blocked just in the third day. Default is 0.days, meaning
102
+ # the user cannot access the website without confirming his account.
103
+ # config.allow_unconfirmed_access_for = 2.days
104
+
105
+ # A period that the user is allowed to confirm their account before their
106
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
107
+ # their account within 3 days after the mail was sent, but on the fourth day
108
+ # their account can't be confirmed with the token any more.
109
+ # Default is nil, meaning there is no restriction on how long a user can take
110
+ # before confirming their account.
111
+ # config.confirm_within = 3.days
112
+
113
+ # If true, requires any email changes to be confirmed (exactly the same way as
114
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
115
+ # db field (see migrations). Until confirmed new email is stored in
116
+ # unconfirmed email column, and copied to email column on successful confirmation.
117
+ config.reconfirmable = true
118
+
119
+ # Defines which key will be used when confirming an account
120
+ # config.confirmation_keys = [ :email ]
121
+
122
+ # ==> Configuration for :rememberable
123
+ # The time the user will be remembered without asking for credentials again.
124
+ # config.remember_for = 2.weeks
125
+
126
+ # If true, extends the user's remember period when remembered via cookie.
127
+ # config.extend_remember_period = false
128
+
129
+ # Options to be passed to the created cookie. For instance, you can set
130
+ # :secure => true in order to force SSL only cookies.
131
+ # config.rememberable_options = {}
132
+
133
+ # ==> Configuration for :validatable
134
+ # Range for password length. Default is 8..128.
135
+ config.password_length = 8..128
136
+
137
+ # Email regex used to validate email formats. It simply asserts that
138
+ # one (and only one) @ exists in the given string. This is mainly
139
+ # to give user feedback and not to assert the e-mail validity.
140
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
141
+
142
+ # ==> Configuration for :timeoutable
143
+ # The time you want to timeout the user session without activity. After this
144
+ # time the user will be asked for credentials again. Default is 30 minutes.
145
+ # config.timeout_in = 30.minutes
146
+
147
+ # If true, expires auth token on session timeout.
148
+ # config.expire_auth_token_on_timeout = false
149
+
150
+ # ==> Configuration for :lockable
151
+ # Defines which strategy will be used to lock an account.
152
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
153
+ # :none = No lock strategy. You should handle locking by yourself.
154
+ # config.lock_strategy = :failed_attempts
155
+
156
+ # Defines which key will be used when locking and unlocking an account
157
+ # config.unlock_keys = [ :email ]
158
+
159
+ # Defines which strategy will be used to unlock an account.
160
+ # :email = Sends an unlock link to the user email
161
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
162
+ # :both = Enables both strategies
163
+ # :none = No unlock strategy. You should handle unlocking by yourself.
164
+ # config.unlock_strategy = :both
165
+
166
+ # Number of authentication tries before locking an account if lock_strategy
167
+ # is failed attempts.
168
+ # config.maximum_attempts = 20
169
+
170
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
171
+ # config.unlock_in = 1.hour
172
+
173
+ # ==> Configuration for :recoverable
174
+ #
175
+ # Defines which key will be used when recovering the password for an account
176
+ # config.reset_password_keys = [ :email ]
177
+
178
+ # Time interval you can reset your password with a reset password key.
179
+ # Don't put a too small interval or your users won't have the time to
180
+ # change their passwords.
181
+ config.reset_password_within = 6.hours
182
+
183
+ # ==> Configuration for :encryptable
184
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
185
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
186
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
187
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
188
+ # REST_AUTH_SITE_KEY to pepper).
189
+ #
190
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
191
+ # config.encryptor = :sha512
192
+
193
+ # ==> Configuration for :token_authenticatable
194
+ # Defines name of the authentication token params key
195
+ # config.token_authentication_key = :auth_token
196
+
197
+ # ==> Scopes configuration
198
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
199
+ # "users/sessions/new". It's turned off by default because it's slower if you
200
+ # are using only default views.
201
+ # config.scoped_views = false
202
+
203
+ # Configure the default scope given to Warden. By default it's the first
204
+ # devise role declared in your routes (usually :user).
205
+ # config.default_scope = :user
206
+
207
+ # Set this configuration to false if you want /users/sign_out to sign out
208
+ # only the current scope. By default, Devise signs out all scopes.
209
+ # config.sign_out_all_scopes = true
210
+
211
+ # ==> Navigation configuration
212
+ # Lists the formats that should be treated as navigational. Formats like
213
+ # :html, should redirect to the sign in page when the user does not have
214
+ # access, but formats like :xml or :json, should return 401.
215
+ #
216
+ # If you have any extra navigational formats, like :iphone or :mobile, you
217
+ # should add them to the navigational formats lists.
218
+ #
219
+ # The "*/*" below is required to match Internet Explorer requests.
220
+ # config.navigational_formats = ["*/*", :html]
221
+
222
+ # The default HTTP method used to sign out a resource. Default is :delete.
223
+ config.sign_out_via = :delete
224
+
225
+ # ==> OmniAuth
226
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
227
+ # up on your models and hooks.
228
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
229
+
230
+ # ==> Warden configuration
231
+ # If you want to use other strategies, that are not supported by Devise, or
232
+ # change the failure app, you can configure them inside the config.warden block.
233
+ #
234
+ # config.warden do |manager|
235
+ # manager.intercept_401 = false
236
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
237
+ # end
238
+
239
+ # ==> Mountable engine configurations
240
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
241
+ # is mountable, there are some extra configurations to be taken into account.
242
+ # The following options are available, assuming the engine is mounted as:
243
+ #
244
+ # mount MyEngine, at: "/my_engine"
245
+ #
246
+ # The router that invoked `devise_for`, in the example above, would be:
247
+ # config.router_name = :my_engine
248
+ #
249
+ # When using omniauth, Devise cannot automatically set Omniauth path,
250
+ # so you need to do it manually. For the users scope, it would be:
251
+ # config.omniauth_path_prefix = "/my_engine/users/auth"
252
+ end