wagn 1.12.13 → 1.13.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (545) hide show
  1. checksums.yaml +5 -13
  2. data/.gitignore +7 -8
  3. data/.rspec +1 -1
  4. data/.simplecov +23 -0
  5. data/.tm_properties +1 -0
  6. data/Gemfile +15 -13
  7. data/Guardfile +34 -0
  8. data/README.rdoc +4 -10
  9. data/VERSION +1 -1
  10. data/app/assets/images/smoothness/animated-overlay.gif +0 -0
  11. data/app/assets/images/smoothness/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  12. data/app/assets/images/smoothness/ui-bg_flat_75_ffffff_40x100.png +0 -0
  13. data/app/assets/images/smoothness/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  14. data/app/assets/images/smoothness/ui-bg_glass_65_ffffff_1x400.png +0 -0
  15. data/app/assets/images/smoothness/ui-bg_glass_75_dadada_1x400.png +0 -0
  16. data/app/assets/images/smoothness/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  17. data/app/assets/images/smoothness/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  18. data/app/assets/images/smoothness/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  19. data/app/assets/images/smoothness/ui-icons_222222_256x240.png +0 -0
  20. data/app/assets/images/smoothness/ui-icons_2e83ff_256x240.png +0 -0
  21. data/app/assets/images/smoothness/ui-icons_454545_256x240.png +0 -0
  22. data/app/assets/images/smoothness/ui-icons_888888_256x240.png +0 -0
  23. data/app/assets/images/smoothness/ui-icons_cd0a0a_256x240.png +0 -0
  24. data/app/assets/javascripts/application.js +9 -8
  25. data/app/assets/javascripts/jquery.ui.autocomplete.html.js +1 -1
  26. data/app/controllers/card_controller.rb +190 -23
  27. data/config/environments/development.rb +17 -12
  28. data/config/initializers/01_init_ruby_extensions.rb +1 -70
  29. data/config/routes.rb +21 -8
  30. data/config/version_cards.txt +1 -1
  31. data/db/bootstrap/card_references.yml +520 -352
  32. data/db/bootstrap/card_revisions.yml +1818 -1887
  33. data/db/bootstrap/cards.yml +2279 -1310
  34. data/db/migrate_cards/20130411191151_renaming_for_menu.rb +0 -5
  35. data/db/migrate_cards/20130411211600_delete_old_related_tab_cards.rb +0 -6
  36. data/db/migrate_cards/20130419215612_import_help_text.rb +0 -7
  37. data/db/migrate_cards/20130823192433_add_style_cards.rb +2 -6
  38. data/db/migrate_cards/20130910183318_move_styles_to_content.rb +0 -5
  39. data/db/migrate_cards/20130920214038_jsonize_tinymce.rb +0 -6
  40. data/db/migrate_cards/20130920291703_update_stylesheets.rb +0 -5
  41. data/db/migrate_cards/20130927191728_account_events.rb +1 -6
  42. data/db/migrate_cards/20131016172445_common_css_patch.rb +0 -6
  43. data/db/migrate_cards/20140110193325_reset_account_request_type.rb +1 -6
  44. data/db/migrate_cards/20140307231621_user_data_to_cards.rb +78 -0
  45. data/db/migrate_cards/20140317035504_account_requests_to_signups.rb +45 -0
  46. data/db/migrate_cards/20140512155840_add_script_cards.rb +85 -0
  47. data/db/migrate_cards/data/1.12_stylesheets/common.scss +1 -1
  48. data/features/autonaming.feature +3 -3
  49. data/features/flexmail.feature +2 -2
  50. data/features/layouts.feature +1 -1
  51. data/features/navbox.feature +17 -0
  52. data/features/notifications.feature +4 -4
  53. data/features/pointer_inputs.feature +2 -2
  54. data/features/presetting_content.feature +1 -1
  55. data/features/reset_password.feature +34 -0
  56. data/features/{pattern_settings.feature → rules.feature} +7 -7
  57. data/features/setup.feature +32 -0
  58. data/features/signup.feature +47 -0
  59. data/features/step_definitions/email_steps.rb +24 -1
  60. data/features/step_definitions/wagn_steps.rb +66 -31
  61. data/features/step_definitions/web_steps.rb +1 -0
  62. data/features/{content_settings.feature → structure.feature} +3 -6
  63. data/features/support/env.rb +3 -0
  64. data/features/support/paths.rb +2 -2
  65. data/features/support/{wag_env.rb → wagn_env.rb} +1 -1
  66. data/features/table_of_contents.feature +1 -1
  67. data/features/update_includers.feature +3 -3
  68. data/features/watch.feature +2 -2
  69. data/lib/card.rb +12 -10
  70. data/lib/{active_record/quoting_and_matching.rb → card/active_record_ext.rb} +25 -20
  71. data/lib/card/auth.rb +205 -0
  72. data/lib/card/chunk.rb +70 -69
  73. data/lib/card/content.rb +1 -1
  74. data/lib/card/core_ext.rb +74 -0
  75. data/lib/card/env.rb +66 -0
  76. data/lib/card/flexmail.rb +43 -37
  77. data/lib/card/format.rb +42 -29
  78. data/lib/{generators → card/generators}/card_migration/USAGE +0 -0
  79. data/lib/{generators → card/generators}/card_migration/card_migration_generator.rb +0 -0
  80. data/lib/{generators → card/generators}/card_migration/templates/card_migration.erb +0 -6
  81. data/lib/{generators → card/generators}/format/USAGE +0 -0
  82. data/lib/{generators → card/generators}/format/format_generator.rb +0 -0
  83. data/lib/{generators → card/generators}/format/templates/format_spec_template.erb +1 -2
  84. data/lib/{generators → card/generators}/format/templates/format_template.erb +0 -0
  85. data/lib/{generators → card/generators}/set/USAGE +0 -0
  86. data/lib/{generators → card/generators}/set/set_generator.rb +0 -0
  87. data/lib/{generators → card/generators}/set/templates/set_spec_template.erb +1 -2
  88. data/lib/card/generators/set/templates/set_template.erb +1 -0
  89. data/lib/card/loader.rb +145 -0
  90. data/lib/card/mailer.rb +117 -0
  91. data/{app/views → lib/card}/mailer/change_notice.html.erb +2 -2
  92. data/lib/card/mailer/confirmation_email.html.erb +8 -0
  93. data/{app/views → lib/card}/mailer/flexmail.html.erb +0 -0
  94. data/lib/card/mailer/password_reset.html.erb +9 -0
  95. data/{app/views → lib/card}/mailer/signup_alert.html.erb +0 -0
  96. data/lib/card/name.rb +2 -3
  97. data/lib/card/query.rb +0 -3
  98. data/lib/card/query/card_spec.rb +4 -4
  99. data/lib/card/revision.rb +34 -32
  100. data/lib/card/set.rb +204 -180
  101. data/lib/card/set_pattern.rb +126 -101
  102. data/lib/wagn/all.rb +1 -8
  103. data/lib/wagn/application.rb +14 -7
  104. data/lib/wagn/commands/application.rb +1 -1
  105. data/lib/{generators → wagn/generators}/wagn/USAGE +0 -0
  106. data/lib/{generators → wagn/generators}/wagn/templates/Gemfile +0 -0
  107. data/lib/{generators → wagn/generators}/wagn/templates/Rakefile +0 -0
  108. data/lib/{generators → wagn/generators}/wagn/templates/config.ru +0 -0
  109. data/lib/{generators → wagn/generators}/wagn/templates/config/application.rb +0 -0
  110. data/lib/{generators → wagn/generators}/wagn/templates/config/boot.rb +0 -0
  111. data/lib/{generators → wagn/generators}/wagn/templates/config/database.yml +0 -0
  112. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/frontbase.yml +0 -0
  113. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/ibm_db.yml +0 -0
  114. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbc.yml +0 -0
  115. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbcmysql.yml +0 -0
  116. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbcpostgresql.yml +0 -0
  117. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbcsqlite3.yml +0 -0
  118. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/mysql.yml +0 -0
  119. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/oracle.yml +0 -0
  120. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/postgresql.yml +0 -0
  121. data/lib/{generators → wagn/generators}/wagn/templates/config/databases/sqlite3.yml +0 -0
  122. data/lib/{generators → wagn/generators}/wagn/templates/config/environment.rb +0 -0
  123. data/lib/{generators → wagn/generators}/wagn/templates/gitignore +0 -0
  124. data/lib/wagn/generators/wagn/templates/public/files/htaccess +9 -0
  125. data/{public → lib/wagn/generators/wagn/templates/public}/robots.txt +0 -0
  126. data/lib/{generators → wagn/generators}/wagn/templates/script/wagn +0 -0
  127. data/lib/{generators → wagn/generators}/wagn/wagn_generator.rb +12 -0
  128. data/lib/wagn/location.rb +7 -11
  129. data/lib/wagn/migration_helper.rb +4 -1
  130. data/{app/mailers → lib/wagn/tasks}/.gitkeep +0 -0
  131. data/lib/{tasks → wagn/tasks}/cucumber.rake +0 -0
  132. data/lib/{tasks → wagn/tasks}/db.rake +0 -0
  133. data/lib/{tasks → wagn/tasks}/test.rake +5 -2
  134. data/lib/{tasks → wagn/tasks}/wagn.rake +29 -12
  135. data/mods/{standard → core}/chunks/include.rb +2 -0
  136. data/mods/{standard → core}/chunks/link.rb +3 -0
  137. data/mods/core/formats/html_format.rb +27 -35
  138. data/mods/core/sets/all/active_card.rb +15 -3
  139. data/mods/core/sets/all/attribute_tracking.rb +1 -1
  140. data/mods/core/sets/all/collection.rb +4 -5
  141. data/mods/core/sets/all/fetch.rb +98 -80
  142. data/mods/core/sets/all/initialize.rb +2 -0
  143. data/mods/core/sets/all/name.rb +13 -12
  144. data/mods/core/sets/all/pattern.rb +0 -9
  145. data/mods/core/sets/all/permissions.rb +56 -31
  146. data/mods/core/sets/all/phases.rb +63 -84
  147. data/mods/core/sets/all/references.rb +0 -1
  148. data/mods/core/sets/all/rules.rb +3 -4
  149. data/mods/core/sets/all/templating.rb +2 -3
  150. data/mods/core/sets/all/tracked_attributes.rb +26 -9
  151. data/mods/core/sets/all/trash.rb +1 -2
  152. data/mods/core/sets/all/type.rb +6 -1
  153. data/mods/core/sets/all/utils.rb +2 -3
  154. data/mods/standard/files/103/icon-6566.ico +0 -0
  155. data/mods/standard/files/103/large-6566.ico +0 -0
  156. data/mods/standard/files/103/medium-6566.ico +0 -0
  157. data/{public/favicon.ico → mods/standard/files/103/original-6566.ico} +0 -0
  158. data/mods/standard/files/103/small-6566.ico +0 -0
  159. data/mods/standard/files/79/icon-6556.png +0 -0
  160. data/mods/standard/files/79/large-6556.png +0 -0
  161. data/mods/standard/files/79/medium-6556.png +0 -0
  162. data/mods/standard/files/79/original-6556.png +0 -0
  163. data/mods/standard/files/79/small-6556.png +0 -0
  164. data/mods/standard/files/790/icon-6419.png +0 -0
  165. data/mods/standard/files/790/large-6419.png +0 -0
  166. data/mods/standard/files/790/medium-6419.png +0 -0
  167. data/mods/standard/files/790/original-6419.png +0 -0
  168. data/mods/standard/files/790/small-6419.png +0 -0
  169. data/mods/standard/lib/card/machine.rb +152 -0
  170. data/mods/standard/lib/card/machine_input.rb +40 -0
  171. data/{public/assets → mods/standard/lib/javascript}/html5shiv-printshiv.js +0 -0
  172. data/mods/standard/lib/javascript/jquery-ui.js +14913 -0
  173. data/mods/standard/lib/javascript/jquery.autosize.js +255 -0
  174. data/mods/standard/lib/javascript/jquery.fileupload.js +1112 -0
  175. data/mods/standard/lib/javascript/jquery.iframe-transport.js +157 -0
  176. data/mods/standard/lib/javascript/jquery.js +9473 -0
  177. data/mods/standard/lib/javascript/jquery.ui.autocomplete.html.js +41 -0
  178. data/mods/standard/lib/javascript/jquery_ujs.js +429 -0
  179. data/mods/standard/lib/javascript/jquerymobile.js +8800 -0
  180. data/mods/standard/lib/javascript/tinymce.js +13 -0
  181. data/{app/assets/javascripts → mods/standard/lib/javascript}/wagn.js.coffee +10 -0
  182. data/{app/assets/javascripts → mods/standard/lib/javascript}/wagn_menu.js +3 -12
  183. data/{app/assets/javascripts → mods/standard/lib/javascript}/wagn_mod.js.coffee +18 -11
  184. data/mods/standard/lib/stylesheets/functional.scss +13 -9
  185. data/mods/standard/lib/stylesheets/jquery-ui-smoothness.css +922 -218
  186. data/mods/standard/lib/stylesheets/standard.scss +2 -2
  187. data/mods/standard/sets/all/account.rb +18 -205
  188. data/mods/standard/sets/all/all_css.rb +2 -3
  189. data/mods/standard/sets/all/all_csv.rb +0 -1
  190. data/mods/standard/sets/all/attach.rb +0 -1
  191. data/mods/standard/sets/all/base.rb +9 -7
  192. data/mods/standard/sets/all/comment.rb +5 -5
  193. data/mods/standard/sets/all/email_html.rb +0 -2
  194. data/mods/standard/sets/all/event_viz.rb +62 -0
  195. data/mods/standard/sets/all/file.rb +0 -1
  196. data/mods/standard/sets/all/follow.rb +13 -11
  197. data/mods/standard/sets/all/history.rb +2 -7
  198. data/mods/standard/sets/all/json.rb +6 -11
  199. data/mods/standard/sets/all/rich_html.rb +68 -52
  200. data/mods/standard/sets/all/rss.rb +4 -5
  201. data/mods/standard/sets/all/text.rb +0 -1
  202. data/mods/standard/sets/right/account.rb +100 -1
  203. data/mods/standard/sets/right/create.rb +8 -2
  204. data/mods/standard/sets/right/delete.rb +2 -0
  205. data/mods/standard/sets/right/email.rb +50 -2
  206. data/mods/standard/sets/right/machine_output.rb +12 -0
  207. data/mods/standard/sets/right/password.rb +39 -0
  208. data/mods/standard/sets/right/read.rb +2 -0
  209. data/mods/standard/sets/right/salt.rb +2 -1
  210. data/mods/standard/sets/right/script.rb +10 -0
  211. data/mods/standard/sets/right/stats.rb +35 -0
  212. data/mods/standard/sets/right/status.rb +9 -0
  213. data/mods/standard/sets/right/style.rb +7 -53
  214. data/mods/standard/sets/right/{crypted_password.rb → token.rb} +2 -1
  215. data/mods/standard/sets/right/update.rb +2 -0
  216. data/mods/standard/sets/rstar/rules.rb +7 -3
  217. data/mods/standard/sets/self/account_links.rb +16 -23
  218. data/mods/standard/sets/self/alerts.rb +0 -1
  219. data/mods/standard/sets/self/all.rb +21 -0
  220. data/mods/standard/sets/self/foot.rb +0 -1
  221. data/mods/standard/sets/self/head.rb +21 -24
  222. data/mods/standard/sets/self/navbox.rb +0 -1
  223. data/mods/standard/sets/self/now.rb +0 -1
  224. data/mods/standard/sets/self/recent.rb +38 -35
  225. data/mods/standard/sets/self/script_card_menu.rb +8 -0
  226. data/mods/standard/sets/self/script_html5shiv_printshiv.rb +7 -0
  227. data/mods/standard/sets/self/script_jquery.rb +8 -0
  228. data/mods/standard/sets/self/script_jquery_helper.rb +13 -0
  229. data/mods/standard/sets/self/script_slot.rb +9 -0
  230. data/mods/standard/sets/self/script_tinymce.rb +8 -0
  231. data/mods/standard/sets/self/search.rb +0 -1
  232. data/mods/standard/sets/self/signin.rb +111 -0
  233. data/mods/standard/sets/self/stats.rb +91 -0
  234. data/mods/standard/sets/self/style_functional.rb +1 -1
  235. data/mods/standard/sets/self/style_jquery_ui_smoothness.rb +1 -1
  236. data/mods/standard/sets/self/style_standard.rb +1 -1
  237. data/mods/standard/sets/type/basic.rb +15 -14
  238. data/mods/standard/sets/type/cardtype.rb +2 -3
  239. data/mods/standard/sets/type/coffee_script.rb +46 -0
  240. data/mods/standard/sets/type/css.rb +16 -5
  241. data/mods/standard/sets/type/date.rb +0 -1
  242. data/mods/standard/sets/type/file.rb +0 -2
  243. data/mods/standard/sets/type/html.rb +0 -1
  244. data/mods/standard/sets/type/image.rb +1 -2
  245. data/mods/standard/sets/type/java_script.rb +32 -0
  246. data/mods/standard/sets/type/layout_type.rb +1 -1
  247. data/mods/standard/sets/type/number.rb +0 -1
  248. data/mods/standard/sets/type/pointer.rb +13 -8
  249. data/mods/standard/sets/type/scss.rb +17 -3
  250. data/mods/standard/sets/type/search_type.rb +36 -34
  251. data/mods/standard/sets/type/set.rb +1 -5
  252. data/mods/standard/sets/type/setting.rb +1 -2
  253. data/mods/standard/sets/type/signup.rb +92 -0
  254. data/mods/standard/sets/type/skin.rb +4 -5
  255. data/mods/standard/sets/type/toggle.rb +1 -1
  256. data/mods/standard/sets/type/user.rb +51 -4
  257. data/public/{404.html → assets/jasmine/404.html} +0 -0
  258. data/public/{500.html → assets/jasmine/500.html} +0 -0
  259. data/public/{jasmine → assets/jasmine}/card_form.html +0 -0
  260. data/public/assets/jquery-ui/animated-overlay-602eee4c79a4796b02bb6442948c9e28.gif +0 -0
  261. data/public/assets/jquery-ui/animated-overlay.gif +0 -0
  262. data/public/assets/{images → jquery-ui}/ui-bg_flat_0_aaaaaa_40x100-7d1197a52442bc56fcad60d0390f4b32.png +0 -0
  263. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  264. data/public/assets/{images → jquery-ui}/ui-bg_flat_75_ffffff_40x100-3c4b974defa5e8bdaf8a603034c4435e.png +0 -0
  265. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_flat_75_ffffff_40x100.png +0 -0
  266. data/public/assets/{images → jquery-ui}/ui-bg_glass_55_fbf9ee_1x400-38c2dea4d046fd3f56cc3996e2e6018b.png +0 -0
  267. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  268. data/public/assets/{images → jquery-ui}/ui-bg_glass_65_ffffff_1x400-ddb7ee7527bff283054406c50e597e1e.png +0 -0
  269. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_65_ffffff_1x400.png +0 -0
  270. data/public/assets/{images → jquery-ui}/ui-bg_glass_75_dadada_1x400-d618461418b1ebc6b7996979f4c3dc92.png +0 -0
  271. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_75_dadada_1x400.png +0 -0
  272. data/public/assets/{images → jquery-ui}/ui-bg_glass_75_e6e6e6_1x400-48d8d545f708e5870a965ce9df8b0e38.png +0 -0
  273. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  274. data/public/assets/{images → jquery-ui}/ui-bg_glass_95_fef1ec_1x400-f3526b8f82249928f0a6baf044204b15.png +0 -0
  275. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  276. data/public/assets/{images → jquery-ui}/ui-bg_highlight-soft_75_cccccc_1x100-cec5c56503b8480f834c3fce35dae8df.png +0 -0
  277. data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  278. data/{app/assets/images/images/ui-icons_2e83ff_256x240.png → public/assets/jquery-ui/ui-icons_222222_256x240-b1eb177a51ea7925448318a26d988842.png} +0 -0
  279. data/{app/assets/images/images → public/assets/jquery-ui}/ui-icons_222222_256x240.png +0 -0
  280. data/{app/assets/images/images/ui-icons_454545_256x240.png → public/assets/jquery-ui/ui-icons_2e83ff_256x240-49c2da9cac2dc565265586f716491298.png} +0 -0
  281. data/public/assets/{images → jquery-ui}/ui-icons_2e83ff_256x240.png +0 -0
  282. data/{app/assets/images/images/ui-icons_888888_256x240.png → public/assets/jquery-ui/ui-icons_454545_256x240-68b2fe3268f7604fb0767a0372e2db85.png} +0 -0
  283. data/public/assets/{images → jquery-ui}/ui-icons_454545_256x240.png +0 -0
  284. data/public/assets/jquery-ui/ui-icons_888888_256x240-8040cfcc88792375b7788feb59189eef.png +0 -0
  285. data/public/assets/{images → jquery-ui}/ui-icons_888888_256x240.png +0 -0
  286. data/public/assets/jquery-ui/ui-icons_cd0a0a_256x240-d4a62216bf6f0cd0071149890763a5ff.png +0 -0
  287. data/{app/assets/images/images → public/assets/jquery-ui}/ui-icons_cd0a0a_256x240.png +0 -0
  288. data/public/assets/jquery.min-388372ef65cc311f6a3df4a6ceac8d22.map +1 -0
  289. data/public/assets/jquery.min.map +1 -1
  290. data/public/assets/manifest.yml +61 -31
  291. data/public/assets/smoothness/animated-overlay-602eee4c79a4796b02bb6442948c9e28.gif +0 -0
  292. data/public/assets/smoothness/animated-overlay.gif +0 -0
  293. data/public/assets/smoothness/ui-bg_flat_0_aaaaaa_40x100-31613497e63975a54520b7065b125dea.png +0 -0
  294. data/public/assets/smoothness/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  295. data/public/assets/smoothness/ui-bg_flat_75_ffffff_40x100-f4b0e20e6f4c83b9f52cf062ed0f5284.png +0 -0
  296. data/public/assets/smoothness/ui-bg_flat_75_ffffff_40x100.png +0 -0
  297. data/public/assets/smoothness/ui-bg_glass_55_fbf9ee_1x400-e3606d6e7ad67486ffdc83edca64d4c5.png +0 -0
  298. data/public/assets/smoothness/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  299. data/public/assets/smoothness/ui-bg_glass_65_ffffff_1x400-dcec96932b90ff4cd4fea91284a6e9a3.png +0 -0
  300. data/public/assets/smoothness/ui-bg_glass_65_ffffff_1x400.png +0 -0
  301. data/public/assets/smoothness/ui-bg_glass_75_dadada_1x400-a2310f533684ede4f1216d7299b5cd58.png +0 -0
  302. data/public/assets/smoothness/ui-bg_glass_75_dadada_1x400.png +0 -0
  303. data/public/assets/smoothness/ui-bg_glass_75_e6e6e6_1x400-d872f3a0a02dea609e4b0321520236d9.png +0 -0
  304. data/public/assets/smoothness/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  305. data/public/assets/smoothness/ui-bg_glass_95_fef1ec_1x400-9ccaed8a65a3c285c16a73bdf03a69b3.png +0 -0
  306. data/public/assets/smoothness/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  307. data/public/assets/smoothness/ui-bg_highlight-soft_75_cccccc_1x100-2ef1d227b5c0f33ce3c5e45afa953991.png +0 -0
  308. data/public/assets/smoothness/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  309. data/public/assets/smoothness/ui-icons_222222_256x240-0675a996f0bdc78890f7b312c543b06a.png +0 -0
  310. data/public/assets/smoothness/ui-icons_222222_256x240.png +0 -0
  311. data/public/assets/smoothness/ui-icons_2e83ff_256x240-6aea736f81a417977efd77f183519a54.png +0 -0
  312. data/public/assets/smoothness/ui-icons_2e83ff_256x240.png +0 -0
  313. data/public/assets/smoothness/ui-icons_454545_256x240-6f4361f45745fb0cd7b0cc2851dc1cc3.png +0 -0
  314. data/public/assets/smoothness/ui-icons_454545_256x240.png +0 -0
  315. data/public/assets/smoothness/ui-icons_888888_256x240-8f6818bd8631ba3489de718e26c7e6cf.png +0 -0
  316. data/public/assets/smoothness/ui-icons_888888_256x240.png +0 -0
  317. data/public/assets/smoothness/ui-icons_cd0a0a_256x240-2969ddba6d0a9c62603a4aa85a363cda.png +0 -0
  318. data/public/assets/smoothness/ui-icons_cd0a0a_256x240.png +0 -0
  319. data/spec/controllers/card_controller_spec.rb +77 -61
  320. data/spec/controllers/location_spec.rb +3 -2
  321. data/spec/lib/card/auth_spec.rb +17 -0
  322. data/spec/lib/card/chunk_spec.rb +0 -1
  323. data/spec/lib/card/codename_spec.rb +12 -18
  324. data/spec/lib/card/content_spec.rb +0 -1
  325. data/spec/lib/card/diff_spec.rb +0 -1
  326. data/spec/lib/card/flexmail_spec.rb +19 -20
  327. data/spec/lib/card/format_spec.rb +0 -169
  328. data/spec/lib/{wagn → card}/loader_spec.rb +1 -2
  329. data/spec/lib/card/name_spec.rb +3 -5
  330. data/spec/lib/card/query_spec.rb +5 -8
  331. data/spec/{models → lib}/card/reference_spec.rb +6 -7
  332. data/spec/lib/card/revision_spec.rb +30 -0
  333. data/spec/lib/card/set_pattern_spec.rb +0 -1
  334. data/spec/lib/card/set_spec.rb +9 -9
  335. data/spec/lib/wagn/cache_spec.rb +0 -1
  336. data/spec/mailers/mailer_spec.rb +4 -9
  337. data/spec/models/card/cardtype_spec.rb +12 -14
  338. data/spec/models/card/create_spec.rb +3 -4
  339. data/spec/models/card/trash_spec.rb +24 -23
  340. data/spec/models/card/type_transition_spec.rb +3 -4
  341. data/spec/models/card/validation_spec.rb +0 -1
  342. data/spec/models/card_spec.rb +10 -11
  343. data/spec/mods/core/chunks/literal_spec.rb +0 -1
  344. data/spec/mods/core/chunks/uri_spec.rb +0 -1
  345. data/spec/mods/core/formats/data_format_spec.rb +0 -1
  346. data/spec/mods/core/formats/html_format_spec.rb +17 -18
  347. data/spec/mods/core/formats/text_format_spec.rb +0 -1
  348. data/spec/mods/core/sets/all/active_card_spec.rb +1 -2
  349. data/spec/mods/core/sets/all/attribute_tracking_spec.rb +1 -2
  350. data/spec/mods/core/sets/all/collection_spec.rb +1 -5
  351. data/spec/mods/core/sets/all/content_spec.rb +0 -1
  352. data/spec/mods/core/sets/all/fetch_spec.rb +7 -10
  353. data/spec/mods/core/sets/all/initialize_spec.rb +0 -1
  354. data/spec/mods/core/sets/all/name_spec.rb +34 -3
  355. data/spec/mods/core/sets/all/pattern_spec.rb +6 -9
  356. data/spec/mods/core/sets/all/permissions_spec.rb +61 -62
  357. data/spec/mods/core/sets/all/phases_spec.rb +1 -2
  358. data/spec/mods/core/sets/all/references_spec.rb +0 -1
  359. data/spec/mods/core/sets/all/rules2_spec.rb +31 -31
  360. data/spec/mods/core/sets/all/rules_spec.rb +3 -4
  361. data/spec/mods/core/sets/all/states_spec.rb +1 -2
  362. data/spec/mods/core/sets/all/templating_spec.rb +11 -12
  363. data/spec/mods/core/sets/all/tracked_attributes_spec.rb +18 -8
  364. data/spec/mods/core/sets/all/trash_spec.rb +1 -2
  365. data/spec/mods/core/sets/all/type_spec.rb +6 -5
  366. data/spec/mods/core/sets/all/utils_spec.rb +1 -2
  367. data/spec/mods/standard/chunks/include_spec.rb +14 -15
  368. data/spec/mods/standard/chunks/link_spec.rb +0 -1
  369. data/spec/mods/standard/formats/css_format_spec.rb +1 -2
  370. data/spec/mods/standard/formats/csv_format_spec.rb +0 -1
  371. data/spec/mods/standard/formats/email_html_format_spec.rb +1 -2
  372. data/spec/mods/standard/formats/file_format_spec.rb +0 -1
  373. data/spec/mods/standard/formats/js_format_spec.rb +3 -0
  374. data/spec/mods/standard/formats/json_format_spec.rb +0 -1
  375. data/spec/mods/standard/formats/rss_format_spec.rb +1 -2
  376. data/spec/mods/standard/formats/xml_format_spec.rb +0 -1
  377. data/spec/mods/standard/lib/machine_input_spec.rb +48 -0
  378. data/spec/mods/standard/lib/machine_spec.rb +110 -0
  379. data/spec/mods/standard/sets/all/account_spec.rb +50 -30
  380. data/spec/mods/standard/sets/all/all_css_spec.rb +0 -1
  381. data/spec/mods/standard/sets/all/all_csv_spec.rb +0 -1
  382. data/spec/mods/standard/sets/all/attach_spec.rb +0 -1
  383. data/spec/mods/standard/sets/all/base_spec.rb +5 -6
  384. data/spec/mods/standard/sets/all/comment_spec.rb +5 -0
  385. data/spec/mods/standard/sets/all/email_html_spec.rb +2 -3
  386. data/spec/mods/standard/sets/all/event_viz_spec.rb +7 -0
  387. data/spec/mods/standard/sets/all/file_spec.rb +0 -1
  388. data/spec/mods/standard/sets/all/flexmail_spec.rb +0 -1
  389. data/spec/mods/standard/sets/all/follow_spec.rb +10 -11
  390. data/spec/mods/standard/sets/all/history_spec.rb +10 -0
  391. data/spec/mods/standard/sets/all/json_spec.rb +5 -6
  392. data/spec/mods/standard/sets/all/rich_html_spec.rb +16 -13
  393. data/spec/mods/standard/sets/all/rss_spec.rb +4 -2
  394. data/spec/mods/standard/sets/all/text_spec.rb +1 -2
  395. data/spec/mods/standard/sets/right/account_spec.rb +86 -2
  396. data/spec/mods/standard/sets/right/add_help_spec.rb +0 -1
  397. data/spec/mods/standard/sets/right/comment_spec.rb +37 -2
  398. data/spec/mods/standard/sets/right/create_spec.rb +6 -2
  399. data/spec/mods/standard/sets/right/default_spec.rb +0 -1
  400. data/spec/mods/standard/sets/right/delete_spec.rb +0 -1
  401. data/spec/mods/standard/sets/right/email_spec.rb +43 -15
  402. data/spec/mods/standard/sets/right/help_spec.rb +0 -1
  403. data/spec/mods/standard/sets/right/machine_output_spec.rb +20 -0
  404. data/spec/mods/standard/sets/right/password_spec.rb +45 -0
  405. data/spec/mods/standard/sets/right/read_spec.rb +0 -1
  406. data/spec/mods/standard/sets/right/salt_spec.rb +0 -1
  407. data/spec/mods/standard/sets/right/script_spec.rb +20 -0
  408. data/spec/mods/standard/sets/right/stats_spec.rb +13 -0
  409. data/spec/mods/standard/sets/right/status_spec.rb +5 -0
  410. data/spec/mods/standard/sets/right/structure_spec.rb +2 -3
  411. data/spec/mods/standard/sets/right/style_spec.rb +19 -2
  412. data/spec/mods/standard/sets/right/token_spec.rb +5 -0
  413. data/spec/mods/standard/sets/right/update_spec.rb +0 -1
  414. data/spec/mods/standard/sets/right/when_created_spec.rb +0 -1
  415. data/spec/mods/standard/sets/right/when_last_edited_spec.rb +0 -1
  416. data/spec/mods/standard/sets/rstar/rules_spec.rb +3 -4
  417. data/spec/mods/standard/sets/self/account_links_spec.rb +0 -1
  418. data/spec/mods/standard/sets/self/alerts_spec.rb +0 -1
  419. data/spec/mods/standard/sets/self/all_spec.rb +47 -0
  420. data/spec/mods/standard/sets/self/foot_spec.rb +0 -1
  421. data/spec/mods/standard/sets/self/head_spec.rb +0 -1
  422. data/spec/mods/standard/sets/self/navbox_spec.rb +0 -1
  423. data/spec/mods/standard/sets/self/now_spec.rb +0 -1
  424. data/spec/mods/standard/sets/self/recent_spec.rb +1 -2
  425. data/spec/mods/standard/sets/self/search_spec.rb +1 -2
  426. data/spec/mods/standard/sets/self/signin_spec.rb +73 -0
  427. data/spec/mods/standard/sets/self/stats_spec.rb +12 -0
  428. data/spec/mods/standard/sets/self/style_functional_spec.rb +1 -2
  429. data/spec/mods/standard/sets/self/style_jquery_ui_smoothness_spec.rb +1 -2
  430. data/spec/mods/standard/sets/self/style_standard_spec.rb +1 -2
  431. data/spec/mods/standard/sets/self/version_spec.rb +0 -1
  432. data/spec/mods/standard/sets/type/basic_spec.rb +1 -2
  433. data/spec/mods/standard/sets/type/cardtype_spec.rb +1 -2
  434. data/spec/mods/standard/sets/type/coffeescript_spec.rb +28 -0
  435. data/spec/mods/standard/sets/type/css_spec.rb +31 -4
  436. data/spec/mods/standard/sets/type/date_spec.rb +0 -1
  437. data/spec/mods/standard/sets/type/file_spec.rb +1 -2
  438. data/spec/mods/standard/sets/type/html_spec.rb +3 -4
  439. data/spec/mods/standard/sets/type/image_spec.rb +1 -2
  440. data/spec/mods/standard/sets/type/javascript_spec.rb +28 -0
  441. data/spec/mods/standard/sets/type/layout_type_spec.rb +0 -1
  442. data/spec/mods/standard/sets/type/number_spec.rb +0 -1
  443. data/spec/mods/standard/sets/type/phrase_spec.rb +0 -1
  444. data/spec/mods/standard/sets/type/plain_text_spec.rb +0 -1
  445. data/spec/mods/standard/sets/type/pointer_spec.rb +1 -2
  446. data/spec/mods/standard/sets/type/scss_spec.rb +47 -2
  447. data/spec/mods/standard/sets/type/search_type_spec.rb +14 -3
  448. data/spec/mods/standard/sets/type/set_spec.rb +0 -1
  449. data/spec/mods/standard/sets/type/setting_spec.rb +6 -2
  450. data/spec/mods/standard/sets/type/signup_spec.rb +93 -0
  451. data/spec/mods/standard/sets/type/skin_spec.rb +23 -2
  452. data/spec/mods/standard/sets/type/toggle_spec.rb +0 -1
  453. data/spec/mods/standard/sets/type/user_spec.rb +1 -2
  454. data/{lib/wagn → spec}/spec_helper.rb +59 -14
  455. data/test/1.10.0-data-dump.sql +327 -0
  456. data/test/fixtures/card_references.yml +777 -581
  457. data/test/fixtures/card_revisions.yml +2737 -2488
  458. data/test/fixtures/cards.yml +4037 -2184
  459. data/test/performance/card_create_test.rb +1 -1
  460. data/test/performance/render_test.rb +1 -1
  461. data/test/seed.rb +36 -63
  462. data/test/test_helper.rb +1 -1
  463. data/wagn.gemspec +9 -9
  464. metadata +257 -237
  465. data/app/assets/javascripts/html5shiv-printshiv.js +0 -499
  466. data/app/controllers/account_controller.rb +0 -61
  467. data/app/controllers/admin_controller.rb +0 -124
  468. data/app/controllers/stub_card_controller.rb +0 -9
  469. data/app/controllers/wagn_controller.rb +0 -165
  470. data/app/mailers/mailer.rb +0 -109
  471. data/app/models/.gitkeep +0 -0
  472. data/app/models/account.rb +0 -198
  473. data/app/models/user.rb +0 -123
  474. data/app/views/mailer/account_info.text.erb +0 -17
  475. data/config/initializers/backtrace_silencers.rb +0 -8
  476. data/config/initializers/schema_views.rb +0 -59
  477. data/config/initializers/wrap_parameters.rb +0 -15
  478. data/config/samples/database.yml.erb +0 -34
  479. data/db/bootstrap/users.yml +0 -29
  480. data/features/account_requests.feature +0 -22
  481. data/features/google_maps.feature +0 -31
  482. data/features/hello_wagn.feature +0 -31
  483. data/features/step_definitions/notification_steps.rb +0 -23
  484. data/features/templates.feature +0 -30
  485. data/features/virtual_cards.feature +0 -11
  486. data/lib/active_record/foreign_keys.rb +0 -80
  487. data/lib/card/constant.rb +0 -20
  488. data/lib/generators/set/templates/set_template.erb +0 -1
  489. data/lib/tasks/.gitkeep +0 -0
  490. data/lib/wagn/authenticated_system.rb +0 -38
  491. data/lib/wagn/env.rb +0 -42
  492. data/lib/wagn/loader.rb +0 -135
  493. data/mods/standard/formats/kml_format.rb +0 -6
  494. data/mods/standard/lib/google_maps_addon.rb +0 -30
  495. data/mods/standard/sets/all/admin.rb +0 -53
  496. data/mods/standard/sets/all/geocode.rb +0 -16
  497. data/mods/standard/sets/all/kml.rb +0 -49
  498. data/mods/standard/sets/type/account_request.rb +0 -74
  499. data/mods/standard/sets/type/ruby_and_script.rb +0 -31
  500. data/public/assets/application-058913c45d4f3262667bad443a03eb45.js +0 -144
  501. data/public/assets/application-058913c45d4f3262667bad443a03eb45.js.gz +0 -0
  502. data/public/assets/application.js +0 -144
  503. data/public/assets/application.js.gz +0 -0
  504. data/public/assets/html5shiv-printshiv-ad36fc7219f4aeaa275f9a7fe2383413.js +0 -1
  505. data/public/assets/html5shiv-printshiv-ad36fc7219f4aeaa275f9a7fe2383413.js.gz +0 -0
  506. data/public/assets/html5shiv-printshiv.js.gz +0 -0
  507. data/public/assets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  508. data/public/assets/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  509. data/public/assets/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  510. data/public/assets/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  511. data/public/assets/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  512. data/public/assets/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  513. data/public/assets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  514. data/public/assets/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  515. data/public/assets/images/ui-icons_222222_256x240-66e635a2f90b9f90675d402617630b24.png +0 -0
  516. data/public/assets/images/ui-icons_222222_256x240.png +0 -0
  517. data/public/assets/images/ui-icons_2e83ff_256x240-2ea4c160a75c1992daa2eeac86255b99.png +0 -0
  518. data/public/assets/images/ui-icons_454545_256x240-5c7f12676bcead9cb2d4cb8f23f16e95.png +0 -0
  519. data/public/assets/images/ui-icons_888888_256x240-95fd3047e1f7325d995a21c729b04125.png +0 -0
  520. data/public/assets/images/ui-icons_cd0a0a_256x240-c0c1ec6a8bcf48fec40303e975a4dfa6.png +0 -0
  521. data/public/assets/images/ui-icons_cd0a0a_256x240.png +0 -0
  522. data/public/assets/jquery.min-8b58c0fbf303b938d8e749262f7e50dd.map +0 -1
  523. data/public/assets/tinymce-22b5a139d9ff7df7643afae9ce205508.js +0 -13
  524. data/public/assets/tinymce-22b5a139d9ff7df7643afae9ce205508.js.gz +0 -0
  525. data/public/assets/tinymce.js +0 -13
  526. data/public/assets/tinymce.js.gz +0 -0
  527. data/spec/controllers/account_controller_spec.rb +0 -42
  528. data/spec/controllers/admin_controller_spec.rb +0 -23
  529. data/spec/controllers/captcha_spec.rb +0 -103
  530. data/spec/controllers/sets_spec.rb +0 -97
  531. data/spec/controllers/wagn_controller_spec.rb +0 -5
  532. data/spec/mailers/account_spec.rb +0 -66
  533. data/spec/models/account_spec.rb +0 -19
  534. data/spec/models/card/comment_spec.rb +0 -38
  535. data/spec/models/card/revision_spec.rb +0 -58
  536. data/spec/models/user_spec.rb +0 -95
  537. data/spec/mods/standard/formats/kml_format_spec.rb +0 -6
  538. data/spec/mods/standard/sets/all/admin_spec.rb +0 -6
  539. data/spec/mods/standard/sets/all/geocode_spec.rb +0 -37
  540. data/spec/mods/standard/sets/all/kml_spec.rb +0 -6
  541. data/spec/mods/standard/sets/right/crypted_password_spec.rb +0 -6
  542. data/spec/mods/standard/sets/type/account_request_spec.rb +0 -160
  543. data/spec/mods/standard/sets/type/ruby_and_script_spec.rb +0 -6
  544. data/spec/spec.opts +0 -6
  545. data/test/fixtures/users.yml +0 -169
@@ -1,16 +1,15 @@
1
1
  # -*- encoding : utf-8 -*-
2
- require 'wagn/spec_helper'
3
2
 
4
3
  class ::Card
5
4
  def writeable_by(user)
6
- Account.as(user.id) do
7
- #warn "writeable #{Account.as_id}, #{user.inspect}"
5
+ Card::Auth.as(user.id) do
6
+ #warn "writeable #{Card::Auth.as_id}, #{user.inspect}"
8
7
  ok? :update
9
8
  end
10
9
  end
11
10
 
12
11
  def readable_by(user)
13
- Account.as(user.id) do
12
+ Card::Auth.as(user.id) do
14
13
  ok? :read
15
14
  end
16
15
  end
@@ -20,19 +19,19 @@ end
20
19
  module PermissionSpecHelper
21
20
 
22
21
  def assert_hidden_from( user, card, msg='')
23
- Account.as(user.id) { assert_hidden( card, msg ) }
22
+ Card::Auth.as(user.id) { assert_hidden( card, msg ) }
24
23
  end
25
24
 
26
25
  def assert_not_hidden_from( user, card, msg='')
27
- Account.as(user.id) { assert_not_hidden( card, msg ) }
26
+ Card::Auth.as(user.id) { assert_not_hidden( card, msg ) }
28
27
  end
29
28
 
30
29
  def assert_locked_from( user, card, msg='')
31
- Account.as(user.id) { assert_locked( card, msg ) }
30
+ Card::Auth.as(user.id) { assert_locked( card, msg ) }
32
31
  end
33
32
 
34
33
  def assert_not_locked_from( user, card, msg='')
35
- Account.as(user.id) { assert_not_locked( card, msg ) }
34
+ Card::Auth.as(user.id) { assert_not_locked( card, msg ) }
36
35
  end
37
36
 
38
37
  def assert_hidden( card, msg='' )
@@ -69,37 +68,37 @@ describe Card::Set::All::Permissions do
69
68
  card = Card.fetch('Home')
70
69
  card.read_rule_id.should == Card.fetch('*all+*read').id
71
70
  card.who_can(:read).should == [Card::AnyoneID]
72
- Account.as(:anonymous){ card.ok?(:read).should be_true }
71
+ Card::Auth.as(:anonymous){ card.ok?(:read).should be_true }
73
72
  end
74
73
 
75
74
  it "should update to role ('Anyone Signed In')" do
76
75
 
77
76
  name = @perm_card.name
78
- Account.as_bot { @perm_card.save! }
77
+ Card::Auth.as_bot { @perm_card.save! }
79
78
  pc = Card[name]
80
79
  card = Card['Home']
81
80
  #warn "card #{name}, #{card.inspect}, #{pc.inspect}"
82
81
  pc.should be
83
82
  card.read_rule_id.should == pc.id
84
- card.who_can(:read).should == [Card::AuthID]
85
- Account.as(:anonymous){ card.ok?(:read).should be_false }
83
+ card.who_can(:read).should == [Card::AnyoneSignedInID]
84
+ Card::Auth.as(:anonymous){ card.ok?(:read).should be_false }
86
85
  end
87
86
 
88
87
  it "should update to user ('Joe Admin')" do
89
88
  @perm_card.content = '[[Joe Admin]]'
90
- Account.as_bot { @perm_card.save! }
89
+ Card::Auth.as_bot { @perm_card.save! }
91
90
 
92
91
  card = Card.fetch('Home')
93
92
  card.read_rule_id.should == @perm_card.id
94
93
  card.who_can(:read).should == [Card['joe_admin'].id]
95
- Account.as(:anonymous) { card.ok?(:read).should be_false }
96
- Account.as(:joe_user) { card.ok?(:read).should be_false }
97
- Account.as(:joe_admin) { card.ok?(:read).should be_true }
98
- Account.as_bot { card.ok?(:read).should be_true }
94
+ Card::Auth.as(:anonymous) { card.ok?(:read).should be_false }
95
+ Card::Auth.as(:joe_user) { card.ok?(:read).should be_false }
96
+ Card::Auth.as(:joe_admin) { card.ok?(:read).should be_true }
97
+ Card::Auth.as_bot { card.ok?(:read).should be_true }
99
98
  end
100
99
 
101
100
  it "should revert to more general rule when more specific (self) rule is deleted" do
102
- Account.as_bot do
101
+ Card::Auth.as_bot do
103
102
  @perm_card.save!
104
103
  @perm_card.delete!
105
104
  end
@@ -109,21 +108,21 @@ describe Card::Set::All::Permissions do
109
108
 
110
109
  it "should revert to more general rule when more specific (right) rule is deleted" do
111
110
  pc = nil
112
- Account.as_bot do
111
+ Card::Auth.as_bot do
113
112
  pc=Card.create(:name=>'B+*right+*read', :type=>'Pointer', :content=>'[[Anyone Signed In]]')
114
113
  end
115
114
  pc.should be
116
115
  card = Card.fetch('A+B')
117
116
  card.read_rule_id.should == pc.id
118
117
  pc = Card.fetch(pc.name) #important to re-fetch to catch issues with detecting change in trash status.
119
- Account.as_bot { pc.delete }
118
+ Card::Auth.as_bot { pc.delete }
120
119
  card = Card.fetch('A+B')
121
120
  card.read_rule_id.should == Card.fetch('*all+*read').id
122
121
  end
123
122
 
124
123
  it "should revert to more general rule when more specific rule is renamed" do
125
124
 
126
- Account.as_bot do
125
+ Card::Auth.as_bot do
127
126
  @perm_card.save!
128
127
  @perm_card = Card[@perm_card.name]
129
128
  @perm_card.name = 'Something else+*self+*read'
@@ -135,7 +134,7 @@ describe Card::Set::All::Permissions do
135
134
  end
136
135
 
137
136
  it "should not be overruled by a more general rule added later" do
138
- Account.as_bot do
137
+ Card::Auth.as_bot do
139
138
  @perm_card.save!
140
139
  c= Card.fetch('Home')
141
140
  c.type_id = Card::PhraseID
@@ -149,7 +148,7 @@ describe Card::Set::All::Permissions do
149
148
 
150
149
  it "should get updated when trunk type change makes type-plus-right apply / unapply" do
151
150
  @perm_card.name = "Phrase+B+*type plus right+*read"
152
- Account.as_bot { @perm_card.save! }
151
+ Card::Auth.as_bot { @perm_card.save! }
153
152
  Card.fetch('A+B').read_rule_id.should == Card.fetch('*all+*read').id
154
153
  c = Card.fetch('A')
155
154
  c.type_id = Card::PhraseID
@@ -158,20 +157,20 @@ describe Card::Set::All::Permissions do
158
157
  end
159
158
 
160
159
  it "should work with relative settings" do
161
- Account.as_bot do
160
+ Card::Auth.as_bot do
162
161
  @perm_card.save!
163
162
  all_plus = Card.fetch '*all plus+*read', :new=>{:content=>'_left'}
164
163
  all_plus.save
165
164
  end
166
165
  c = Card.new(:name=>'Home+Heart')
167
- c.who_can(:read).should == [Card::AuthID]
166
+ c.who_can(:read).should == [Card::AnyoneSignedInID]
168
167
  c.permission_rule_card(:read).first.id.should == @perm_card.id
169
168
  c.save
170
169
  c.read_rule_id.should == @perm_card.id
171
170
  end
172
171
 
173
172
  it "should get updated when relative settings change" do
174
- Account.as_bot do
173
+ Card::Auth.as_bot do
175
174
  all_plus = Card.fetch '*all plus+*read', :new=>{:content=>'_left'}
176
175
  all_plus.save
177
176
  end
@@ -180,21 +179,21 @@ describe Card::Set::All::Permissions do
180
179
  c.permission_rule_card(:read).first.id.should == Card.fetch('*all+*read').id
181
180
  c.save
182
181
  c.read_rule_id.should == Card.fetch('*all+*read').id
183
- Account.as_bot { @perm_card.save! }
182
+ Card::Auth.as_bot { @perm_card.save! }
184
183
  c2 = Card.fetch('Home+Heart')
185
- c2.who_can(:read).should == [Card::AuthID]
184
+ c2.who_can(:read).should == [Card::AnyoneSignedInID]
186
185
  c2.read_rule_id.should == @perm_card.id
187
186
  Card.fetch('Home+Heart').read_rule_id.should == @perm_card.id
188
- Account.as_bot{ @perm_card.delete }
187
+ Card::Auth.as_bot{ @perm_card.delete }
189
188
  Card.fetch('Home').read_rule_id.should == Card.fetch('*all+*read').id
190
189
  Card.fetch('Home+Heart').read_rule_id.should == Card.fetch('*all+*read').id
191
190
  end
192
191
 
193
192
  it "should insure that class overrides work with relative settings" do
194
- Account.as_bot do
193
+ Card::Auth.as_bot do
195
194
  all_plus = Card.fetch '*all plus+*read', :new => { :content=>'_left' }
196
195
  all_plus.save
197
- Account.as_bot { @perm_card.save! }
196
+ Card::Auth.as_bot { @perm_card.save! }
198
197
  c = Card.create(:name=>'Home+Heart')
199
198
  c.read_rule_id.should == @perm_card.id
200
199
  r = Card.create(:name=>'Heart+*right+*read', :type=>'Pointer', :content=>'[[Administrator]]')
@@ -213,8 +212,8 @@ describe Card::Set::All::Permissions do
213
212
 
214
213
  context '??' do
215
214
  before do
216
- Account.as_bot do
217
- # Account.cache.reset
215
+ Card::Auth.as_bot do
216
+ # Card::Auth.cache.reset
218
217
  @u1, @u2, @u3, @r1, @r2, @r3, @c1, @c2, @c3 =
219
218
  %w( u1 u2 u3 r1 r2 r3 c1 c2 c3 ).map do |x| Card[x] end
220
219
  end
@@ -222,19 +221,19 @@ describe Card::Set::All::Permissions do
222
221
 
223
222
 
224
223
  it "checking ok read should not add to errors" do
225
- Account.as_bot do
226
- Account.always_ok?.should == true
224
+ Card::Auth.as_bot do
225
+ Card::Auth.always_ok?.should == true
227
226
  end
228
- Account.as(:joe_user) do
229
- Account.always_ok?.should == false
227
+ Card::Auth.as(:joe_user) do
228
+ Card::Auth.always_ok?.should == false
230
229
  end
231
- Account.as(:joe_admin) do
232
- Account.always_ok?.should == true
230
+ Card::Auth.as(:joe_admin) do
231
+ Card::Auth.always_ok?.should == true
233
232
  Card.create! :name=>"Hidden"
234
233
  Card.create(:name=>'Hidden+*self+*read', :type=>'Pointer', :content=>'[[Anyone Signed In]]')
235
234
  end
236
235
 
237
- Account.as(:anonymous) do
236
+ Card::Auth.as(:anonymous) do
238
237
  h = Card.fetch('Hidden')
239
238
  h.ok?(:read).should == false
240
239
  h.errors.empty?.should_not == nil
@@ -242,7 +241,7 @@ describe Card::Set::All::Permissions do
242
241
  end
243
242
 
244
243
  it "should be granted to admin if to anybody" do
245
- Account.as_bot do
244
+ Card::Auth.as_bot do
246
245
  c1 = Card['c1']
247
246
  Card.create! :name=>'c1+*self+*comment', :type=>'Pointer', :content=>'[[r1]]'
248
247
  c1.who_can( :comment ).should == [Card['r1'].id]
@@ -261,7 +260,7 @@ describe Card::Set::All::Permissions do
261
260
 
262
261
 
263
262
  it "write user permissions" do
264
- Account.as_bot do
263
+ Card::Auth.as_bot do
265
264
  @u1.fetch(:trait=>:roles, :new=>{}).items = [@r1, @r2]
266
265
  @u2.fetch(:trait=>:roles, :new=>{}).items = [@r1, @r3]
267
266
  @u3.fetch(:trait=>:roles, :new=>{}).items = [@r1, @r2, @r3]
@@ -283,7 +282,7 @@ describe Card::Set::All::Permissions do
283
282
  end
284
283
 
285
284
  it "read group permissions" do
286
- Account.as_bot do
285
+ Card::Auth.as_bot do
287
286
  @u1.fetch(:trait=>:roles).items = [@r1, @r2]
288
287
  @u2.fetch(:trait=>:roles).items = [@r1, @r3]
289
288
 
@@ -302,7 +301,7 @@ describe Card::Set::All::Permissions do
302
301
  end
303
302
 
304
303
  it "write group permissions" do
305
- Account.as_bot do
304
+ Card::Auth.as_bot do
306
305
  [1,2,3].each do |num|
307
306
  Card.create(:name=>"c#{num}+*self+*update", :type=>'Pointer', :content=>"[[r#{num}]]")
308
307
  end
@@ -328,7 +327,7 @@ describe Card::Set::All::Permissions do
328
327
  end
329
328
 
330
329
  it "read user permissions" do
331
- Account.as_bot {
330
+ Card::Auth.as_bot {
332
331
  @u1.fetch(:trait=>:roles, :new=>{}).items = [@r1, @r2]
333
332
  @u2.fetch(:trait=>:roles, :new=>{}).items = [@r1, @r3]
334
333
  @u3.fetch(:trait=>:roles, :new=>{}).items = [@r1, @r2, @r3]
@@ -351,14 +350,14 @@ describe Card::Set::All::Permissions do
351
350
 
352
351
  context "create permissions" do
353
352
  before do
354
- Account.as_bot do
353
+ Card::Auth.as_bot do
355
354
  Card.create! :name=>'*structure+*right+*create', :type=>'Pointer', :content=>'[[Anyone Signed In]]'
356
355
  Card.create! :name=>'*self+*right+*create', :type=>'Pointer', :content=>'[[Anyone Signed In]]'
357
356
  end
358
357
  end
359
358
 
360
359
  it "should inherit" do
361
- Account.as(:auth) do
360
+ Card::Auth.as(:anyone_signed_in) do
362
361
  Card.fetch( 'A+*self' ).ok?(:create).should be_true #explicitly granted above
363
362
  Card.fetch( 'A+*right').ok?(:create).should be_false #by default restricted
364
363
 
@@ -372,17 +371,17 @@ describe Card::Set::All::Permissions do
372
371
 
373
372
  it "private wql" do
374
373
  # set up cards of type TestType, 2 with nil reader, 1 with role1 reader
375
- Account.as_bot do
374
+ Card::Auth.as_bot do
376
375
  [@c1,@c2,@c3].each do |c|
377
376
  c.update_attributes :content => 'WeirdWord'
378
377
  end
379
378
  Card.create(:name=>"c1+*self+*read", :type=>'Pointer', :content=>"[[u1]]")
380
379
  end
381
380
 
382
- Account.as(@u1) do
381
+ Card::Auth.as(@u1) do
383
382
  Card.search(:content=>'WeirdWord').map(&:name).sort.should == %w( c1 c2 c3 )
384
383
  end
385
- Account.as(@u2) do
384
+ Card::Auth.as(@u2) do
386
385
  Card.search(:content=>'WeirdWord').map(&:name).sort.should == %w( c2 c3 )
387
386
  end
388
387
  end
@@ -391,18 +390,18 @@ describe Card::Set::All::Permissions do
391
390
  #warn "u1 roles #{Card[ @u1.id ].fetch(:trait=>:roles).item_names.inspect}"
392
391
 
393
392
  # set up cards of type TestType, 2 with nil reader, 1 with role1 reader
394
- Account.as_bot do
393
+ Card::Auth.as_bot do
395
394
  [@c1,@c2,@c3].each do |c|
396
395
  c.update_attributes :content => 'WeirdWord'
397
396
  end
398
397
  Card.create(:name=>"c1+*self+*read", :type=>'Pointer', :content=>"[[r3]]")
399
398
  end
400
399
 
401
- Account.as(@u1) do
400
+ Card::Auth.as(@u1) do
402
401
  Card.search(:content=>'WeirdWord').map(&:name).sort.should == %w( c1 c2 c3 )
403
402
  end
404
- Account.current_id =nil # for Account.as to be effective, you can't have a logged in user
405
- Account.as(@u2) do
403
+ Card::Auth.current_id =nil # for Card::Auth.as to be effective, you can't have a logged in user
404
+ Card::Auth.as(@u2) do
406
405
  Card.search(:content=>'WeirdWord').map(&:name).sort.should == %w( c2 c3 )
407
406
  end
408
407
  end
@@ -443,13 +442,13 @@ describe Card::Set::All::Permissions do
443
442
  end
444
443
 
445
444
  it "should let anonymous users view basic cards" do
446
- Account.as :anonymous do
445
+ Card::Auth.as :anonymous do
447
446
  @c.ok?(:read).should be_true
448
447
  end
449
448
  end
450
449
 
451
450
  it "should let joe user basic cards" do
452
- Account.as :joe_user do
451
+ Card::Auth.as :joe_user do
453
452
  @c.ok?(:read).should be_true
454
453
  end
455
454
  end
@@ -460,7 +459,7 @@ describe Card::Set::All::Permissions do
460
459
  end
461
460
 
462
461
  it "should not allow someone not signed in to create Basic Cards" do
463
- Account.as :anonymous do
462
+ Card::Auth.as :anonymous do
464
463
  Card.new.ok?(:create).should_not be_true
465
464
  end
466
465
  end
@@ -469,7 +468,7 @@ describe Card::Set::All::Permissions do
469
468
 
470
469
  context "settings based permissions" do
471
470
  before do
472
- Account.as_bot do
471
+ Card::Auth.as_bot do
473
472
  @delete_rule_card = Card.fetch '*all+*delete', :new=>{}
474
473
  @delete_rule_card.type_id = Card::PointerID
475
474
  @delete_rule_card.content = '[[Joe_User]]'
@@ -480,16 +479,16 @@ describe Card::Set::All::Permissions do
480
479
  it "should handle delete as a setting" do
481
480
  c = Card.new :name=>'whatever'
482
481
  c.who_can(:delete).should == [Card['joe_user'].id]
483
- Account.as(:joe_user) do
482
+ Card::Auth.as(:joe_user) do
484
483
  c.ok?(:delete).should == true
485
484
  end
486
- Account.as(:u1) do
485
+ Card::Auth.as(:u1) do
487
486
  c.ok?(:delete).should == false
488
487
  end
489
- Account.as(:anonymous) do
488
+ Card::Auth.as(:anonymous) do
490
489
  c.ok?(:delete).should == false
491
490
  end
492
- Account.as_bot do
491
+ Card::Auth.as_bot do
493
492
  c.ok?(:delete).should == true #because administrator
494
493
  end
495
494
  end
@@ -1,6 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
- require 'wagn/spec_helper'
3
2
 
4
3
  describe Card::Set::All::Phases do
5
- # SPECSTUB (low priority)
4
+ # SPECSTUB
6
5
  end
@@ -1,5 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
- require 'wagn/spec_helper'
3
2
 
4
3
  describe Card::Set::All::References do
5
4
  it "should replace references should work on inclusions inside links" do
@@ -1,14 +1,16 @@
1
1
  # -*- encoding : utf-8 -*-
2
- require 'wagn/spec_helper'
3
2
 
4
3
 
5
4
  #FIXME - this seems like a LOT of testing but it doesn't cover a ton of ground
6
5
  # I think we should move the rendering tests into basic and trim this to about a quarter of its current length
7
6
 
8
7
  describe Card do
9
- context 'when there is a general toc setting of 2' do
8
+ context 'when there is a general toc rule of 2' do
10
9
 
11
10
  before do
11
+ Card::Auth.as_bot do
12
+ Card.create! :name=>'Basic+*type+*table of contents', :content=>'2'
13
+ end
12
14
  (@c1 = Card['Onne Heading']).should be
13
15
  (@c2 = Card['Twwo Heading']).should be
14
16
  (@c3 = Card['Three Heading']).should be
@@ -25,13 +27,13 @@ describe Card do
25
27
 
26
28
  describe "renders with/without toc" do
27
29
  it "should not render for 'Onne Heading'" do
28
- Card::Format.new(@c1).render_open_content.should_not match /Table of Contents/
30
+ @c1.format.render_open_content.should_not match /Table of Contents/
29
31
  end
30
32
  it "should render for 'Twwo Heading'" do
31
- Card::Format.new(@c2).render_open_content.should match /Table of Contents/
33
+ @c2.format.render_open_content.should match /Table of Contents/
32
34
  end
33
35
  it "should render for 'Three Heading'" do
34
- Card::Format.new(@c3).render_open_content.should match /Table of Contents/
36
+ @c3.format.render_open_content.should match /Table of Contents/
35
37
  end
36
38
  end
37
39
 
@@ -51,12 +53,12 @@ describe Card do
51
53
  sets.should == ['Cardtype A+*type', 'Cardtype A+*self', 'Cardtype A+*right']
52
54
  end
53
55
  # it "should show type plus right sets when they exist" do
54
- # Account.as_bot { Card.create :name=>'Basic+A+*type plus right', :content=>'' }
56
+ # Card::Auth.as_bot { Card.create :name=>'Basic+A+*type plus right', :content=>'' }
55
57
  # sets = Card['A'].related_sets
56
58
  # sets.should == ['A+*self', 'A+*right', 'Basic+A+*type plus right']
57
59
  # end
58
60
  # it "should show type plus right sets when they exist, and type" do
59
- # Account.as_bot { Card.create :name=>'Basic+Cardtype A+*type plus right', :content=>'' }
61
+ # Card::Auth.as_bot { Card.create :name=>'Basic+Cardtype A+*type plus right', :content=>'' }
60
62
  # sets = Card['Cardtype A'].related_sets
61
63
  # sets.should == ['Cardtype A+*self', 'Cardtype A+*type', 'Cardtype A+*right', 'Basic+Cardtype A+*type plus right']
62
64
  # end
@@ -65,14 +67,14 @@ describe Card do
65
67
  sets.should == ['A+B+*self']
66
68
  end
67
69
  end
68
-
70
+ =begin
69
71
  # class methods
70
72
  describe ".default_rule" do
71
73
  it 'should have default rule' do
72
74
  Card.default_rule(:table_of_contents).should == '0'
73
75
  end
74
76
  end
75
-
77
+ =end
76
78
  end
77
79
 
78
80
  context "when I change the general toc setting to 1" do
@@ -94,15 +96,15 @@ describe Card do
94
96
 
95
97
  describe "renders with/without toc" do
96
98
  it "should not render toc for 'Onne Heading'" do
97
- Card::Format.new(@c1).render_open_content.should match /Table of Contents/
99
+ @c1.format.render_open_content.should match /Table of Contents/
98
100
  end
99
101
  it "should render toc for 'Twwo Heading'" do
100
- Card::Format.new(@c2).render_open_content.should match /Table of Contents/
102
+ @c2.format.render_open_content.should match /Table of Contents/
101
103
  end
102
104
  it "should not render for 'Twwo Heading' when changed to 3" do
103
105
  @rule_card.content = "3"
104
106
  @c2.rule(:table_of_contents).should == "3"
105
- Card::Format.new(@c2).render_open_content.should_not match /Table of Contents/
107
+ @c2.format.render_open_content.should_not match /Table of Contents/
106
108
  end
107
109
  end
108
110
 
@@ -111,7 +113,7 @@ describe Card do
111
113
  context 'when I use CardtypeE cards' do
112
114
 
113
115
  before do
114
- Account.as_bot do
116
+ Card::Auth.as_bot do
115
117
  @c1 = Card.create :name=>'toc1', :type=>"CardtypeE",
116
118
  :content=>Card['Onne Heading'].content
117
119
  @c2 = Card.create :name=>'toc2', :type=>"CardtypeE",
@@ -137,13 +139,13 @@ describe Card do
137
139
 
138
140
  describe "renders without toc" do
139
141
  it "should not render for 'Onne Heading'" do
140
- Card::Format.new(@c1).render_open_content.should_not match /Table of Contents/
142
+ @c1.format.render_open_content.should_not match /Table of Contents/
141
143
  end
142
144
  it "should render for 'Twwo Heading'" do
143
- Card::Format.new(@c2).render_open_content.should_not match /Table of Contents/
145
+ @c2.format.render_open_content.should_not match /Table of Contents/
144
146
  end
145
147
  it "should render for 'Three Heading'" do
146
- Card::Format.new(@c3).render_open_content.should_not match /Table of Contents/
148
+ @c3.format.render_open_content.should_not match /Table of Contents/
147
149
  end
148
150
  end
149
151
 
@@ -158,25 +160,23 @@ describe Card do
158
160
  end
159
161
  end
160
162
 
163
+ =begin
161
164
  # class methods
162
165
  describe ".default_rule" do
163
166
  it 'should have default rule' do
164
167
  Card.default_rule(:table_of_contents).should == '0'
165
168
  end
166
169
  end
167
-
170
+ =end
168
171
  end
169
172
 
170
173
  context "when I create a new rule" do
171
174
  before do
172
- Account.as_bot do
173
- @c1 = Card.create :name=>'toc1', :type=>"CardtypeE",
174
- :content=>Card['Onne Heading'].content
175
- # FIXME: CardtypeE should inherit from *default => Basic
176
- @c2 = Card.create :name=>'toc2', #:type=>"CardtypeE",
177
- :content=>Card['Twwo Heading'].content
178
- @c3 = Card.create :name=>'toc3', #:type=>"CardtypeE",
179
- :content=>Card['Three Heading'].content
175
+ Card::Auth.as_bot do
176
+ Card.create! :name=>'Basic+*type+*table of contents', :content=>'2'
177
+ @c1 = Card.create! :name=>'toc1', :type=>"CardtypeE", :content=>Card['Onne Heading'].content
178
+ @c2 = Card.create! :name=>'toc2', :content=>Card['Twwo Heading'].content
179
+ @c3 = Card.create! :name=>'toc3', :content=>Card['Three Heading'].content
180
180
  @c1.type_name.should == 'Cardtype E'
181
181
  @rule_card = @c1.rule_card(:table_of_contents)
182
182
 
@@ -200,14 +200,14 @@ describe Card do
200
200
 
201
201
  describe "renders with/without toc" do
202
202
  it "should not render for 'Onne Heading'" do
203
- Card::Format.new(@c1).render_open_content.should_not match /Table of Contents/
203
+ @c1.format.render_open_content.should_not match /Table of Contents/
204
204
  end
205
205
  it "should render for 'Twwo Heading'" do
206
206
  @c2.rule(:table_of_contents).should == "2"
207
- Card::Format.new(@c2).render_open_content.should match /Table of Contents/
207
+ @c2.format.render_open_content.should match /Table of Contents/
208
208
  end
209
209
  it "should render for 'Three Heading'" do
210
- Card::Format.new(@c3).render_open_content.should match /Table of Contents/
210
+ @c3.format.render_open_content.should match /Table of Contents/
211
211
  end
212
212
  end
213
213
  end
@@ -234,14 +234,14 @@ describe Card do
234
234
 
235
235
  describe "renders with/without toc" do
236
236
  it "should not render toc for 'Onne Heading'" do
237
- Card::Format.new(@c1).render_open_content.should match /Table of Contents/
237
+ @c1.format.render_open_content.should match /Table of Contents/
238
238
  end
239
239
  it "should render toc for 'Twwo Heading'" do
240
- Card::Format.new(@c2).render_open_content.should match /Table of Contents/
240
+ @c2.format.render_open_content.should match /Table of Contents/
241
241
  end
242
242
  it "should not render for 'Twwo Heading' when changed to 3" do
243
243
  @rule_card.content = "3"
244
- Card::Format.new(@c2).render_open_content.should_not match /Table of Contents/
244
+ @c2.format.render_open_content.should_not match /Table of Contents/
245
245
  end
246
246
  end
247
247