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,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,20 @@
1
+ ActiveAdmin.register AdminUser do
2
+ index do
3
+ column :email
4
+ column :current_sign_in_at
5
+ column :last_sign_in_at
6
+ column :sign_in_count
7
+ default_actions
8
+ end
9
+
10
+ filter :email
11
+
12
+ form do |f|
13
+ f.inputs "Admin Details" do
14
+ f.input :email
15
+ f.input :password
16
+ f.input :password_confirmation
17
+ end
18
+ f.actions
19
+ end
20
+ end
@@ -0,0 +1,5 @@
1
+ ActiveAdmin.register Category do
2
+ action_item only: :show do
3
+ link_to "Posts", admin_category_posts_path(resource)
4
+ end
5
+ end
@@ -0,0 +1,33 @@
1
+ ActiveAdmin.register_page "Dashboard" do
2
+
3
+ menu :priority => 1, :label => proc{ I18n.t("active_admin.dashboard") }
4
+
5
+ content :title => proc{ I18n.t("active_admin.dashboard") } do
6
+ div :class => "blank_slate_container", :id => "dashboard_default_message" do
7
+ span :class => "blank_slate" do
8
+ span I18n.t("active_admin.dashboard_welcome.welcome")
9
+ small I18n.t("active_admin.dashboard_welcome.call_to_action")
10
+ end
11
+ end
12
+
13
+ # Here is an example of a simple dashboard with columns and panels.
14
+ #
15
+ # columns do
16
+ # column do
17
+ # panel "Recent Posts" do
18
+ # ul do
19
+ # Post.recent(5).map do |post|
20
+ # li link_to(post.title, admin_post_path(post))
21
+ # end
22
+ # end
23
+ # end
24
+ # end
25
+
26
+ # column do
27
+ # panel "Info" do
28
+ # para "Welcome to ActiveAdmin."
29
+ # end
30
+ # end
31
+ # end
32
+ end # content
33
+ end
@@ -0,0 +1,21 @@
1
+ ActiveAdmin.register Post do
2
+ belongs_to :category
3
+
4
+ state_action :peer_review
5
+ state_action :publish, confirm: true # Has I18n in locale
6
+ state_action :archive, confirm: ->{ "Do you want to archive?" }
7
+
8
+ # No I18n for confirm message
9
+ state_action :reopen, confirm: true, http_verb: :get do
10
+ redirect_to admin_dashboard_path
11
+ end
12
+
13
+ form do |f|
14
+ f.inputs "Post Details" do
15
+ f.input :title
16
+ f.input :body
17
+ end
18
+ f.actions
19
+ end
20
+
21
+ end
@@ -0,0 +1 @@
1
+ //= require active_admin/base
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .
@@ -0,0 +1,29 @@
1
+ // SASS variable overrides must be declared before loading up Active Admin's styles.
2
+ //
3
+ // To view the variables that Active Admin provides, take a look at
4
+ // `app/assets/stylesheets/active_admin/mixins/_variables.css.scss` in the
5
+ // Active Admin source.
6
+ //
7
+ // For example, to change the sidebar width:
8
+ // $sidebar-width: 242px;
9
+
10
+ // Active Admin's got SASS!
11
+ @import "active_admin/mixins";
12
+ @import "active_admin/base";
13
+
14
+ // Overriding any non-variable SASS must be done after the fact.
15
+ // For example, to change the default status-tag color:
16
+ //
17
+ // body.active_admin {
18
+ // .status_tag { background: #6090DB; }
19
+ // }
20
+ //
21
+ // Notice that Active Admin CSS rules are nested within a
22
+ // 'body.active_admin' selector to prevent conflicts with
23
+ // other pages in the app. It is best to wrap your changes in a
24
+ // namespace so they are properly recognized. You have options
25
+ // if you e.g. want different styles for different namespaces:
26
+ //
27
+ // .active_admin applies to any Active Admin namespace
28
+ // .admin_namespace applies to the admin namespace (eg: /admin)
29
+ // .other_namespace applies to a custom namespace named other (eg: /other)
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,12 @@
1
+ class Ability
2
+ include CanCan::Ability
3
+
4
+ def initialize(user)
5
+ if user.super_admin?
6
+ can :manage, :all
7
+ else
8
+ can :read, ActiveAdmin::Page, name: "Dashboard"
9
+ can [:read, :show, :index], [Category, Post]
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ class AdminUser < ActiveRecord::Base
2
+ # Include default devise modules. Others available are:
3
+ # :token_authenticatable, :confirmable,
4
+ # :lockable, :timeoutable and :omniauthable
5
+ devise :database_authenticatable,
6
+ :recoverable, :rememberable, :trackable, :validatable
7
+
8
+ # Setup accessible (or protected) attributes for your model
9
+ attr_accessible :email, :password, :password_confirmation, :remember_me
10
+ # attr_accessible :title, :body
11
+ end
@@ -0,0 +1,4 @@
1
+ class Category < ActiveRecord::Base
2
+ attr_accessible :name
3
+ has_many :posts
4
+ end
@@ -0,0 +1,31 @@
1
+ class Post < ActiveRecord::Base
2
+ attr_accessible :body, :status, :title
3
+
4
+ belongs_to :category
5
+
6
+ validates :title, presence: true, uniqueness: true
7
+ validates :body, presence: true
8
+
9
+ DRAFT = 'draft'
10
+ REVIEWED = 'reviewed'
11
+ PUBLISHED = 'published'
12
+ ARCHIVED = 'archived'
13
+
14
+ state_machine :status, initial: DRAFT do
15
+ event :peer_review do
16
+ transition DRAFT => REVIEWED
17
+ end
18
+
19
+ event :publish do
20
+ transition REVIEWED => PUBLISHED
21
+ end
22
+
23
+ event :archive do
24
+ transition any - ARCHIVED => ARCHIVED
25
+ end
26
+
27
+ event :reopen do
28
+ transition any - DRAFT => DRAFT
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", :media => "all" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,65 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_mailer/railtie"
7
+ require "active_resource/railtie"
8
+ require "sprockets/railtie"
9
+ # require "rails/test_unit/railtie"
10
+
11
+ Bundler.require(*Rails.groups)
12
+ require "active_admin/state_machine"
13
+
14
+ module Dummy
15
+ class Application < Rails::Application
16
+ # Settings in config/environments/* take precedence over those specified here.
17
+ # Application configuration should go into files in config/initializers
18
+ # -- all .rb files in that directory are automatically loaded.
19
+
20
+ # Custom directories with classes and modules you want to be autoloadable.
21
+ # config.autoload_paths += %W(#{config.root}/extras)
22
+
23
+ # Only load the plugins named here, in the order given (default is alphabetical).
24
+ # :all can be used as a placeholder for all plugins not explicitly named.
25
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
26
+
27
+ # Activate observers that should always be running.
28
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
29
+
30
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
31
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
32
+ # config.time_zone = 'Central Time (US & Canada)'
33
+
34
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
35
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
36
+ # config.i18n.default_locale = :de
37
+
38
+ # Configure the default encoding used in templates for Ruby 1.9.
39
+ config.encoding = "utf-8"
40
+
41
+ # Configure sensitive parameters which will be filtered from the log file.
42
+ config.filter_parameters += [:password]
43
+
44
+ # Enable escaping HTML in JSON.
45
+ config.active_support.escape_html_entities_in_json = true
46
+
47
+ # Use SQL instead of Active Record's schema dumper when creating the database.
48
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
49
+ # like if you have constraints or database-specific column types
50
+ # config.active_record.schema_format = :sql
51
+
52
+ # Enforce whitelist mode for mass assignment.
53
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
54
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
55
+ # parameters by using an attr_accessible or attr_protected declaration.
56
+ config.active_record.whitelist_attributes = true
57
+
58
+ # Enable the asset pipeline
59
+ config.assets.enabled = true
60
+
61
+ # Version of your assets, change this if you want to expire all your assets
62
+ config.assets.version = '1.0'
63
+ end
64
+ end
65
+
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
@@ -0,0 +1,4 @@
1
+ test:
2
+ adapter: postgresql
3
+ database: aa_state_machine_test
4
+ username: postgres
@@ -0,0 +1,12 @@
1
+ pg: &pg
2
+ adapter: postgresql
3
+ encoding: unicode
4
+ pool: 5
5
+
6
+ development:
7
+ <<: *pg
8
+ database: active_admin_state_machine_development
9
+
10
+ test:
11
+ <<: *pg
12
+ database: active_admin_state_machine_test
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,38 @@
1
+ require 'pry'
2
+ Dummy::Application.configure do
3
+ # Settings specified here will take precedence over those in config/application.rb
4
+
5
+ # In the development environment your application's code is reloaded on
6
+ # every request. This slows down response time but is perfect for development
7
+ # since you don't have to restart the web server when you make code changes.
8
+ config.cache_classes = false
9
+
10
+ # Log error messages when you accidentally call methods on nil.
11
+ config.whiny_nils = true
12
+
13
+ # Show full error reports and disable caching
14
+ config.consider_all_requests_local = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Don't care if the mailer can't send
18
+ config.action_mailer.raise_delivery_errors = false
19
+
20
+ # Print deprecation notices to the Rails logger
21
+ config.active_support.deprecation = :log
22
+
23
+ # Only use best-standards-support built into browsers
24
+ config.action_dispatch.best_standards_support = :builtin
25
+
26
+ # Raise exception on mass assignment protection for Active Record models
27
+ config.active_record.mass_assignment_sanitizer = :strict
28
+
29
+ # Log the query plan for queries taking more than this (works
30
+ # with SQLite, MySQL, and PostgreSQL)
31
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
32
+
33
+ # Do not compress assets
34
+ config.assets.compress = false
35
+
36
+ # Expands the lines which load the assets
37
+ config.assets.debug = true
38
+ end
@@ -0,0 +1,67 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to nil and saved in location specified by config.assets.prefix
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
+ # config.assets.precompile += %w( search.js )
50
+
51
+ # Disable delivery errors, bad email addresses will be ignored
52
+ # config.action_mailer.raise_delivery_errors = false
53
+
54
+ # Enable threaded mode
55
+ # config.threadsafe!
56
+
57
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
+ # the I18n.default_locale when a translation can not be found)
59
+ config.i18n.fallbacks = true
60
+
61
+ # Send deprecation notices to registered listeners
62
+ config.active_support.deprecation = :notify
63
+
64
+ # Log the query plan for queries taking more than this (works
65
+ # with SQLite, MySQL, and PostgreSQL)
66
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
67
+ end