browsercms 3.4.2 → 3.5.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (367) hide show
  1. data/README.markdown +1 -0
  2. data/app/assets/images/cms/file-uploading.gif +0 -0
  3. data/app/assets/javascripts/cms/application.js +1 -0
  4. data/app/assets/javascripts/cms/attachment_manager.js.erb +87 -0
  5. data/app/assets/javascripts/cms/core_library.js.erb +38 -25
  6. data/app/assets/stylesheets/cms/application.css.erb +1 -0
  7. data/app/assets/stylesheets/cms/attachment_manager.css.scss +28 -0
  8. data/app/controllers/cms/application_controller.rb +1 -1
  9. data/app/controllers/cms/attachments_controller.rb +45 -10
  10. data/app/controllers/cms/cache_controller.rb +1 -1
  11. data/app/controllers/cms/content_block_controller.rb +134 -122
  12. data/app/controllers/cms/content_controller.rb +143 -155
  13. data/app/controllers/cms/dashboard_controller.rb +11 -9
  14. data/app/controllers/cms/error_handling.rb +19 -7
  15. data/app/controllers/cms/file_blocks_controller.rb +2 -2
  16. data/app/controllers/cms/home_controller.rb +3 -0
  17. data/app/controllers/cms/section_nodes_controller.rb +52 -44
  18. data/app/controllers/cms/sections_controller.rb +4 -2
  19. data/app/controllers/cms/toolbar_controller.rb +14 -10
  20. data/app/helpers/cms/application_helper.rb +23 -19
  21. data/app/helpers/cms/form_builder.rb +65 -18
  22. data/app/helpers/cms/mobile_helper.rb +19 -0
  23. data/app/helpers/cms/path_helper.rb +30 -4
  24. data/app/helpers/cms/rendering_helper.rb +9 -1
  25. data/app/models/cms/abstract_file_block.rb +6 -6
  26. data/app/models/cms/attachment.rb +196 -107
  27. data/app/models/cms/category.rb +3 -0
  28. data/app/models/cms/category_type.rb +2 -0
  29. data/app/models/cms/connector.rb +3 -0
  30. data/app/models/cms/content_type.rb +3 -0
  31. data/app/models/cms/content_type_group.rb +2 -0
  32. data/app/models/cms/dynamic_view.rb +4 -0
  33. data/app/models/cms/email_message.rb +2 -0
  34. data/app/models/cms/file_block.rb +9 -2
  35. data/app/models/cms/group.rb +5 -2
  36. data/app/models/cms/group_permission.rb +2 -0
  37. data/app/models/cms/group_section.rb +3 -0
  38. data/app/models/cms/group_type.rb +2 -0
  39. data/app/models/cms/group_type_permission.rb +2 -0
  40. data/app/models/cms/html_block.rb +3 -2
  41. data/app/models/cms/image_block.rb +13 -2
  42. data/app/models/cms/page.rb +14 -3
  43. data/app/models/cms/page_route.rb +4 -0
  44. data/app/models/cms/page_route_condition.rb +1 -0
  45. data/app/models/cms/page_route_option.rb +2 -0
  46. data/app/models/cms/page_route_requirement.rb +1 -0
  47. data/app/models/cms/permission.rb +3 -0
  48. data/app/models/cms/portlet.rb +2 -2
  49. data/app/models/cms/redirect.rb +2 -0
  50. data/app/models/cms/section.rb +15 -1
  51. data/app/models/cms/section_node.rb +1 -0
  52. data/app/models/cms/site.rb +3 -0
  53. data/app/models/cms/tag.rb +2 -0
  54. data/app/models/cms/tagging.rb +3 -0
  55. data/app/models/cms/task.rb +5 -1
  56. data/app/models/cms/user.rb +1 -1
  57. data/app/models/cms/user_group_membership.rb +3 -0
  58. data/app/views/cms/attachments/_attachment.html.erb +14 -0
  59. data/app/views/cms/attachments/_attachment_table.html.erb +17 -0
  60. data/app/views/cms/attachments/_attachment_wrapper.html.erb +4 -0
  61. data/app/views/cms/blocks/index.html.erb +2 -3
  62. data/app/views/cms/blocks/show.html.erb +1 -1
  63. data/app/views/cms/dynamic_views/index.html.erb +1 -1
  64. data/app/views/cms/email_messages/index.html.erb +1 -1
  65. data/app/views/cms/file_blocks/_form.html.erb +1 -27
  66. data/app/views/cms/file_blocks/_section_selector.html.erb +13 -0
  67. data/app/views/cms/file_blocks/render.html.erb +3 -3
  68. data/app/views/cms/form_builder/_cms_attachment_manager.html.erb +26 -0
  69. data/app/views/cms/form_builder/_cms_file_field.html.erb +27 -35
  70. data/app/views/cms/groups/index.html.erb +1 -1
  71. data/app/views/cms/image_blocks/_form.html.erb +1 -27
  72. data/app/views/cms/image_blocks/render.html.erb +4 -1
  73. data/app/views/cms/page_routes/index.html.erb +3 -0
  74. data/app/views/cms/shared/error.xml.erb +8 -0
  75. data/app/views/cms/tags/render.html.erb +1 -1
  76. data/app/views/cms/toolbar/_mobile_toggle.html.erb +33 -0
  77. data/app/views/cms/users/index.html.erb +1 -1
  78. data/app/views/layouts/_page_toolbar.html.erb +2 -1
  79. data/bin/bcms +21 -26
  80. data/config/routes.rb +3 -2
  81. data/db/browsercms.seeds.rb +2 -1
  82. data/db/migrate/20111130221145_browsercms340.rb +5 -4
  83. data/db/migrate/20120329144406_browsercms350.rb +32 -0
  84. data/{test/dummy/db → db}/schema.rb +97 -128
  85. data/{performance_tuning_notes.md → doc/performance_tuning_notes.md} +0 -0
  86. data/doc/release_notes.md +74 -0
  87. data/lib/browsercms.rb +3 -0
  88. data/lib/cms/acts/content_block.rb +10 -2
  89. data/lib/cms/addressable.rb +8 -0
  90. data/lib/cms/attachments/attachment_serving.rb +59 -0
  91. data/lib/cms/attachments/configuration.rb +88 -0
  92. data/lib/cms/behaviors/attaching.rb +305 -136
  93. data/lib/cms/behaviors/connecting.rb +3 -4
  94. data/lib/cms/behaviors/dynamic_attributes.rb +121 -118
  95. data/lib/cms/behaviors/flush_cache_on_change.rb +1 -3
  96. data/lib/cms/behaviors/naming.rb +16 -0
  97. data/lib/cms/behaviors/pagination.rb +4 -1
  98. data/lib/cms/behaviors/publishing.rb +9 -3
  99. data/lib/cms/behaviors/searching.rb +3 -8
  100. data/lib/cms/behaviors/soft_deleting.rb +1 -0
  101. data/lib/cms/behaviors/taggable.rb +2 -0
  102. data/lib/cms/behaviors/versioning.rb +73 -120
  103. data/lib/cms/caching.rb +53 -11
  104. data/lib/cms/commands/actions.rb +19 -2
  105. data/lib/cms/configuration.rb +44 -0
  106. data/lib/cms/content_rendering_support.rb +9 -6
  107. data/lib/cms/default_accessible.rb +13 -0
  108. data/lib/cms/domain_support.rb +22 -0
  109. data/lib/cms/engine.rb +40 -19
  110. data/lib/cms/engine_helper.rb +54 -0
  111. data/lib/cms/extensions/active_record/connection_adapters/abstract/schema_statements.rb +14 -2
  112. data/lib/cms/mobile_aware.rb +67 -0
  113. data/lib/cms/route_extensions.rb +3 -0
  114. data/lib/cms/upgrades/v3_5_0.rb +155 -0
  115. data/lib/cms/version.rb +6 -1
  116. data/lib/generators/cms/content_block/content_block_generator.rb +14 -9
  117. data/lib/generators/cms/content_block/templates/_form.html.erb +17 -6
  118. data/lib/generators/cms/content_block/templates/render.html.erb +12 -5
  119. data/lib/generators/cms/template/template_generator.rb +11 -2
  120. data/lib/tasks/cms.rake +23 -0
  121. data/lib/templates/active_record/model/model.rb +6 -0
  122. metadata +127 -517
  123. data/.gitignore +0 -24
  124. data/.rvmrc +0 -2
  125. data/Gemfile +0 -29
  126. data/Gemfile.lock +0 -196
  127. data/Rakefile +0 -97
  128. data/app/assets/images/browsercms/.gitkeep +0 -0
  129. data/app/controllers/browsercms/application_controller.rb +0 -4
  130. data/browsercms.gemspec +0 -35
  131. data/config/cucumber.yml +0 -8
  132. data/config/database.jdbcmysql.yml +0 -30
  133. data/config/database.mysql.yml +0 -27
  134. data/config/database.postgres.yml +0 -25
  135. data/config/database.sqlite3.yml +0 -11
  136. data/config/environment.rb +0 -6
  137. data/config/initializers/query_reviewer_patch.rb +0 -12
  138. data/config/initializers/rack_1_2_1_patch.rb +0 -12
  139. data/config/locales/en.yml +0 -5
  140. data/features/acts_as_content_page.feature +0 -62
  141. data/features/add_content_to_pages.feature +0 -45
  142. data/features/caching.feature +0 -13
  143. data/features/ckeditor.feature +0 -11
  144. data/features/commands/confirm_aruba_works.feature +0 -24
  145. data/features/commands/generate_module.feature +0 -54
  146. data/features/commands/install_browsercms.feature +0 -21
  147. data/features/commands/new_demo_project.feature +0 -30
  148. data/features/commands/new_projects.feature +0 -50
  149. data/features/commands/upgrade_modules_to_3_4_0_from_3_1_x.feature +0 -19
  150. data/features/commands/upgrade_project_to_3_4_0_from_3_3_x.feature +0 -52
  151. data/features/commands/upgrading_modules.feature +0 -67
  152. data/features/content_blocks/manage_custom_blocks.feature +0 -67
  153. data/features/content_blocks/manage_html_blocks.feature +0 -48
  154. data/features/content_blocks/manage_image_blocks.feature +0 -41
  155. data/features/content_files.feature +0 -37
  156. data/features/content_pages.feature +0 -21
  157. data/features/generators/content_blocks_for_modules.feature +0 -58
  158. data/features/generators/content_blocks_for_projects.feature +0 -109
  159. data/features/install_content.feature +0 -25
  160. data/features/jquery-testplan.txt +0 -12
  161. data/features/manage_groups.feature +0 -33
  162. data/features/manage_page_routes.feature +0 -72
  163. data/features/manage_redirects.feature +0 -20
  164. data/features/manage_sections.feature +0 -12
  165. data/features/manage_tasks.feature +0 -25
  166. data/features/manage_users.feature +0 -38
  167. data/features/page_templates.feature +0 -49
  168. data/features/portlets/email_friend_portlet.feature +0 -29
  169. data/features/portlets/portlets.feature +0 -100
  170. data/features/portlets/tag_cloud_portlet.feature +0 -28
  171. data/features/sitemap/create_pages.feature +0 -15
  172. data/features/sitemap/manage_links.feature +0 -29
  173. data/features/sitemap/sitemap.feature +0 -18
  174. data/features/step_definitions/acts_as_content_page_steps.rb.rb +0 -3
  175. data/features/step_definitions/ckeditor_steps.rb +0 -13
  176. data/features/step_definitions/command_line_steps.rb +0 -212
  177. data/features/step_definitions/content_pages_steps.rb +0 -170
  178. data/features/step_definitions/data_steps.rb +0 -48
  179. data/features/step_definitions/edit_page_templates_steps.rb +0 -21
  180. data/features/step_definitions/html_blocks_steps.rb +0 -9
  181. data/features/step_definitions/install_content_steps.rb +0 -4
  182. data/features/step_definitions/manage_content_blocks_steps.rb +0 -26
  183. data/features/step_definitions/manage_image_blocks_steps.rb +0 -31
  184. data/features/step_definitions/manage_sections_steps.rb +0 -18
  185. data/features/step_definitions/manage_user_steps.rb +0 -22
  186. data/features/step_definitions/more_custom_block_steps.rb +0 -34
  187. data/features/step_definitions/page_route_steps.rb +0 -65
  188. data/features/step_definitions/page_template_steps.rb +0 -5
  189. data/features/step_definitions/permissions_steps.rb +0 -13
  190. data/features/step_definitions/portlets_steps.rb +0 -64
  191. data/features/step_definitions/redirect_steps.rb +0 -12
  192. data/features/step_definitions/sitemap_steps.rb +0 -18
  193. data/features/step_definitions/tag_cloud_steps.rb +0 -11
  194. data/features/step_definitions/task_steps.rb +0 -4
  195. data/features/step_definitions/taxonomy_steps.rb +0 -16
  196. data/features/step_definitions/upgrade_module_steps.rb +0 -76
  197. data/features/step_definitions/web_steps.rb +0 -211
  198. data/features/support/async_support.rb +0 -17
  199. data/features/support/command_line_helpers.rb +0 -63
  200. data/features/support/debug_formatter.rb +0 -7
  201. data/features/support/debugging.rb +0 -28
  202. data/features/support/env.rb +0 -73
  203. data/features/support/git_api.rb +0 -9
  204. data/features/support/open_on_first_failure.rb +0 -25
  205. data/features/support/paths.rb +0 -32
  206. data/features/support/rails_api.rb +0 -8
  207. data/features/support/selectors.rb +0 -39
  208. data/features/support/transforms.rb +0 -7
  209. data/features/taxonomy/add_content_with_category.feature +0 -30
  210. data/features/taxonomy/manage_categories.feature +0 -20
  211. data/features/taxonomy/manage_category_types.feature +0 -16
  212. data/lib/cms/init.rb +0 -105
  213. data/lib/tasks/data.rake +0 -43
  214. data/lib/tasks/db.rake +0 -82
  215. data/public/styled_file_field/index.html +0 -72
  216. data/script/cucumber +0 -10
  217. data/script/rails +0 -6
  218. data/test/console_helper.rb +0 -5
  219. data/test/custom_assertions.rb +0 -84
  220. data/test/dummy/Rakefile +0 -7
  221. data/test/dummy/app/assets/javascripts/application.js +0 -9
  222. data/test/dummy/app/assets/javascripts/content_page.js +0 -2
  223. data/test/dummy/app/assets/stylesheets/application.css +0 -7
  224. data/test/dummy/app/assets/stylesheets/content_page.css +0 -4
  225. data/test/dummy/app/controllers/application_controller.rb +0 -3
  226. data/test/dummy/app/controllers/cms/products_controller.rb +0 -2
  227. data/test/dummy/app/controllers/cms/sample_blocks_controller.rb +0 -3
  228. data/test/dummy/app/controllers/content_page_controller.rb +0 -13
  229. data/test/dummy/app/helpers/application_helper.rb +0 -2
  230. data/test/dummy/app/helpers/content_page_helper.rb +0 -2
  231. data/test/dummy/app/mailers/.gitkeep +0 -0
  232. data/test/dummy/app/models/.gitkeep +0 -0
  233. data/test/dummy/app/models/cms/sample_block.rb +0 -22
  234. data/test/dummy/app/models/product.rb +0 -5
  235. data/test/dummy/app/views/cms/products/_form.html.erb +0 -7
  236. data/test/dummy/app/views/cms/products/render.html.erb +0 -3
  237. data/test/dummy/app/views/content_page/custom_page.html.erb +0 -3
  238. data/test/dummy/app/views/content_page/index.html.erb +0 -2
  239. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  240. data/test/dummy/app/views/layouts/templates/default.html.erb +0 -17
  241. data/test/dummy/app/views/layouts/templates/subpage.html.erb +0 -16
  242. data/test/dummy/app/views/test_route/index.html.erb +0 -14
  243. data/test/dummy/config.ru +0 -4
  244. data/test/dummy/config/application.rb +0 -45
  245. data/test/dummy/config/boot.rb +0 -10
  246. data/test/dummy/config/database.yml +0 -27
  247. data/test/dummy/config/environment.rb +0 -5
  248. data/test/dummy/config/environments/development.rb +0 -32
  249. data/test/dummy/config/environments/production.rb +0 -60
  250. data/test/dummy/config/environments/test.rb +0 -46
  251. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  252. data/test/dummy/config/initializers/browsercms.rb +0 -7
  253. data/test/dummy/config/initializers/inflections.rb +0 -10
  254. data/test/dummy/config/initializers/mime_types.rb +0 -5
  255. data/test/dummy/config/initializers/quiet_sprocket_assets.rb +0 -13
  256. data/test/dummy/config/initializers/secret_token.rb +0 -7
  257. data/test/dummy/config/initializers/session_store.rb +0 -8
  258. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  259. data/test/dummy/config/locales/en.yml +0 -5
  260. data/test/dummy/config/routes.rb +0 -23
  261. data/test/dummy/db/migrate/20111228141250_create_products.rb +0 -16
  262. data/test/dummy/db/seeds.rb +0 -1
  263. data/test/dummy/lib/assets/.gitkeep +0 -0
  264. data/test/dummy/public/404.html +0 -26
  265. data/test/dummy/public/422.html +0 -26
  266. data/test/dummy/public/500.html +0 -26
  267. data/test/dummy/public/favicon.ico +0 -0
  268. data/test/dummy/script/rails +0 -6
  269. data/test/dummy/test/functional/content_page_controller_test.rb +0 -9
  270. data/test/dummy/test/unit/helpers/content_page_helper_test.rb +0 -4
  271. data/test/factories.rb +0 -235
  272. data/test/fixtures/multipart/foo.jpg +0 -0
  273. data/test/fixtures/multipart/sample_upload.txt +0 -1
  274. data/test/fixtures/multipart/second_upload.txt +0 -1
  275. data/test/fixtures/multipart/test.jpg +0 -0
  276. data/test/fixtures/multipart/version1.txt +0 -1
  277. data/test/fixtures/multipart/version2.txt +0 -1
  278. data/test/functional/cms/cache_controller_test.rb +0 -16
  279. data/test/functional/cms/categories_controller_test.rb +0 -28
  280. data/test/functional/cms/connectors_controller_test.rb +0 -64
  281. data/test/functional/cms/content_block_controller_test.rb +0 -127
  282. data/test/functional/cms/content_controller_test.rb +0 -351
  283. data/test/functional/cms/dashboard_controller_test.rb +0 -20
  284. data/test/functional/cms/file_blocks_controller_test.rb +0 -55
  285. data/test/functional/cms/home_controller_test.rb +0 -160
  286. data/test/functional/cms/html_blocks_controller_test.rb +0 -159
  287. data/test/functional/cms/image_blocks_controller_test.rb +0 -78
  288. data/test/functional/cms/links_controller_test.rb +0 -92
  289. data/test/functional/cms/log/test.log +0 -0
  290. data/test/functional/cms/pages_controller_test.rb +0 -233
  291. data/test/functional/cms/portlets_controller_test.rb +0 -57
  292. data/test/functional/cms/sections_controller_test.rb +0 -234
  293. data/test/functional/cms/sessions_controller_test.rb +0 -80
  294. data/test/functional/cms/tasks_controller_test.rb +0 -64
  295. data/test/functional/cms/toolbar_controller_test.rb +0 -76
  296. data/test/functional/cms/users_controller_test.rb +0 -218
  297. data/test/integration/cms/password_management_test.rb +0 -66
  298. data/test/integration/sitemap_performance_test.rb +0 -26
  299. data/test/mock_file.rb +0 -33
  300. data/test/performance/browsing_test.rb +0 -9
  301. data/test/support/engine_controller_hacks.rb +0 -34
  302. data/test/support/factory_helpers.rb +0 -57
  303. data/test/support/rails_3_1_routes_hack.rb +0 -70
  304. data/test/test_helper.rb +0 -199
  305. data/test/test_logging.rb +0 -67
  306. data/test/unit/active_record_callbacks.rb +0 -50
  307. data/test/unit/behaviors/attaching_test.rb +0 -370
  308. data/test/unit/behaviors/cms_user_test.rb +0 -67
  309. data/test/unit/behaviors/connectable_test.rb +0 -32
  310. data/test/unit/behaviors/connecting_test.rb +0 -56
  311. data/test/unit/behaviors/dynamic_attributes_test.rb +0 -74
  312. data/test/unit/behaviors/namespacing_test.rb +0 -76
  313. data/test/unit/behaviors/publishable_test.rb +0 -83
  314. data/test/unit/behaviors/rendering_test.rb +0 -68
  315. data/test/unit/behaviors/searching_test.rb +0 -102
  316. data/test/unit/behaviors/taggable_test.rb +0 -110
  317. data/test/unit/behaviors/userstamping_test.rb +0 -27
  318. data/test/unit/behaviors/versioning_test.rb +0 -102
  319. data/test/unit/extensions/active_record/base_test.rb +0 -25
  320. data/test/unit/extensions/hash_test.rb +0 -26
  321. data/test/unit/extensions/integer_test.rb +0 -10
  322. data/test/unit/extensions/string_test.rb +0 -14
  323. data/test/unit/factories_test.rb +0 -50
  324. data/test/unit/generators/install_generator_test.rb +0 -15
  325. data/test/unit/helpers/application_helper_test.rb +0 -104
  326. data/test/unit/helpers/date_picker_test.rb +0 -17
  327. data/test/unit/helpers/menu_helper_test.rb +0 -240
  328. data/test/unit/helpers/page_helper_test.rb +0 -69
  329. data/test/unit/helpers/path_helper_test.rb +0 -38
  330. data/test/unit/helpers/rendering_helper_test.rb +0 -8
  331. data/test/unit/lib/acts_as_content_page_test.rb +0 -72
  332. data/test/unit/lib/cms/authentication/controller_test.rb +0 -20
  333. data/test/unit/lib/cms/engine_helper_test.rb +0 -119
  334. data/test/unit/lib/cms/sitemap_test.rb +0 -210
  335. data/test/unit/lib/cms_domain_support_test.rb +0 -44
  336. data/test/unit/lib/command_line_test.rb +0 -70
  337. data/test/unit/lib/content_block_test.rb +0 -304
  338. data/test/unit/lib/content_rendering_support_test.rb +0 -40
  339. data/test/unit/lib/generators_test.rb +0 -40
  340. data/test/unit/lib/routes_test.rb +0 -98
  341. data/test/unit/mock_file_test.rb +0 -19
  342. data/test/unit/models/attachment_test.rb +0 -160
  343. data/test/unit/models/category_test.rb +0 -40
  344. data/test/unit/models/category_type_test.rb +0 -8
  345. data/test/unit/models/connector_test.rb +0 -152
  346. data/test/unit/models/content_type_group_test.rb +0 -26
  347. data/test/unit/models/content_type_test.rb +0 -177
  348. data/test/unit/models/dynamic_views_test.rb +0 -36
  349. data/test/unit/models/email_page_portlet_test.rb +0 -20
  350. data/test/unit/models/file_block_test.rb +0 -246
  351. data/test/unit/models/group_test.rb +0 -29
  352. data/test/unit/models/html_block_test.rb +0 -121
  353. data/test/unit/models/image_block_test.rb +0 -35
  354. data/test/unit/models/link_test.rb +0 -52
  355. data/test/unit/models/namespaces_test.rb +0 -57
  356. data/test/unit/models/page_partial_test.rb +0 -37
  357. data/test/unit/models/page_route_test.rb +0 -113
  358. data/test/unit/models/page_template_test.rb +0 -50
  359. data/test/unit/models/page_test.rb +0 -879
  360. data/test/unit/models/permission_test.rb +0 -10
  361. data/test/unit/models/portlet_test.rb +0 -99
  362. data/test/unit/models/sections_test.rb +0 -278
  363. data/test/unit/models/site_test.rb +0 -50
  364. data/test/unit/models/task_test.rb +0 -150
  365. data/test/unit/models/user_test.rb +0 -358
  366. data/test/unit/schema_statements_test.rb +0 -137
  367. data/todo_list.markdown +0 -50
@@ -1,9 +0,0 @@
1
- module GitAPI
2
-
3
- def create_git_project
4
- run_simple "git init"
5
- run_simple "git add ."
6
- run_simple "git commit -m 'First commit'"
7
- end
8
- end
9
- World(GitAPI)
@@ -1,25 +0,0 @@
1
- # The first scenario that fails, we want to save and launch the page in the Browser.
2
- # We don't want to to open subsequent failures, as that can be HIGHLY annoying when running from the command line.
3
- #
4
- # Also, this https://gist.github.com/398643
5
- # has good info on how to save Assets/CSS so we can see the full version of the page.
6
- #
7
- module LaunchOnFirstFailure
8
- class << self
9
- attr_accessor :failed_tests
10
- def failure_occurred
11
- self.failed_tests = 0 unless failed_tests
12
- self.failed_tests += 1
13
- end
14
- def failed_tests?
15
- failed_tests && failed_tests >= 0
16
- end
17
- end
18
- end
19
-
20
- After('~@cli')do |scenario|
21
- if scenario.failed? && !LaunchOnFirstFailure.failed_tests?
22
- LaunchOnFirstFailure.failure_occurred
23
- save_and_open_page
24
- end
25
- end
@@ -1,32 +0,0 @@
1
- module NavigationHelpers
2
- # Maps a name to a path. Used by the
3
- #
4
- # When /^I go to (.+)$/ do |page_name|
5
- #
6
- # step definition in web_steps.rb
7
- #
8
- def path_to(page_name)
9
- case page_name
10
- when /^the home\s?page$/
11
- '/'
12
- # Add more mappings here.
13
- # Here is an example that pulls values out of the Regexp:
14
- #
15
- # when /^(.*)'s profile page$/i
16
- # user_profile_path(User.find_by_login($1))
17
-
18
- else
19
- begin
20
- page_name =~ /^the (.*) page$/
21
- path_components = $1.split(/\s+/)
22
- self.send(path_components.push('path').join('_').to_sym)
23
- rescue NoMethodError, ArgumentError
24
- raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
25
- "Now, go and add a mapping in #{__FILE__}"
26
- end
27
-
28
- end
29
- end
30
- end
31
-
32
- World(NavigationHelpers)
@@ -1,8 +0,0 @@
1
- module Cms
2
- module RailsApi
3
- def create_rails_project(name)
4
- run_simple "rails new #{name} --skip-bundle"
5
- end
6
- end
7
- end
8
- World(Cms::RailsApi)
@@ -1,39 +0,0 @@
1
- module HtmlSelectorsHelpers
2
- # Maps a name to a selector. Used primarily by the
3
- #
4
- # When /^(.+) within (.+)$/ do |step, scope|
5
- #
6
- # step definitions in web_steps.rb
7
- #
8
- def selector_for(locator)
9
- case locator
10
-
11
- when "the page"
12
- "html > body"
13
-
14
- # Add more mappings here.
15
- # Here is an example that pulls values out of the Regexp:
16
- #
17
- # when /^the (notice|error|info) flash$/
18
- # ".flash.#{$1}"
19
-
20
- # You can also return an array to use a different selector
21
- # type, like:
22
- #
23
- # when /the header/
24
- # [:xpath, "//header"]
25
-
26
- # This allows you to provide a quoted selector as the scope
27
- # for "within" steps as was previously the default for the
28
- # web steps:
29
- when /^"(.+)"$/
30
- $1
31
-
32
- else
33
- raise "Can't find mapping from \"#{locator}\" to a selector.\n" +
34
- "Now, go and add a mapping in #{__FILE__}"
35
- end
36
- end
37
- end
38
-
39
- World(HtmlSelectorsHelpers)
@@ -1,7 +0,0 @@
1
- # Match a relative path (this can be improved greatly)
2
- # i.e.
3
- # /some-path
4
- # /some/path
5
- PATH = Transform /^\/\S*$/ do |path|
6
- path
7
- end
@@ -1,30 +0,0 @@
1
- Feature: Add Content with categories
2
-
3
- Background:
4
- Given the cms database is populated
5
- Given a Content Type named "Product" is registered
6
- And I am logged in as a Content Editor
7
-
8
- Scenario: With no Category Type defined yet
9
- When I visit /cms/products/new
10
- Then I should see "You must first create a 'Category Type' named 'Product'"
11
-
12
- Scenario: With No Categories
13
- Given the following Category Types exist:
14
- | name |
15
- | Product |
16
- When I request /cms/products/new
17
- Then I should see "You must first create a Category with a Category Type of 'Product'."
18
-
19
- Scenario: With Categories
20
- Given the following Category Types exist:
21
- | name |
22
- | Product |
23
- And the following Categories exist for "Product":
24
- | name |
25
- | T-shirts |
26
- | Hoodies |
27
- When I visit /cms/products/new
28
- Then I should see the following content:
29
- | T-shirts |
30
- | Hoodies |
@@ -1,20 +0,0 @@
1
- Feature: Manage Categories
2
- Content editors should be able to add/edit/delete categories from the user interface.
3
-
4
- Background:
5
- Given the cms database is populated
6
- And I am logged in as a Content Editor
7
- And the following Category Types exist:
8
- | name |
9
- | Product |
10
-
11
- Scenario: Add New Category
12
- Given I visit /cms/categories/new
13
- And I fill in "Name" with "T-Shirts"
14
- And I select "Product" from "Type"
15
- And I click on "Save"
16
- Then I should see a page titled "List Categories"
17
- And I should see "T-Shirts"
18
-
19
-
20
-
@@ -1,16 +0,0 @@
1
- Feature: Manage Category Types
2
- Content editors should be able to add/edit/delete category types from the user interface.
3
-
4
- Background:
5
- Given the cms database is populated
6
- And I am logged in as a Content Editor
7
-
8
- Scenario: Add New Category Type
9
- Given I visit /cms/category_types/new
10
- And I fill in "Name" with "Product"
11
- And I click on "Save"
12
- Then I should see a page titled "List Category Types"
13
- And I should see "Product"
14
-
15
-
16
-
data/lib/cms/init.rb DELETED
@@ -1,105 +0,0 @@
1
- require 'cms/version'
2
-
3
- module Cms
4
- class << self
5
- __root__ = File.expand_path(File.join(File.dirname(__FILE__), "..", ".."))
6
-
7
- define_method(:root) { __root__ }
8
-
9
-
10
- attr_accessor :attachment_file_permission
11
-
12
- def version
13
- @version = Cms::VERSION
14
- end
15
-
16
- def load_rake_tasks
17
- load "#{Cms.root}/lib/tasks/cms.rake"
18
- end
19
-
20
- # This is no longer really needed since Engines handle initialization.
21
- def init
22
- puts "BrowserCMS init has been called!!!!!!!"
23
- end
24
-
25
- # This is used by CMS modules to register with the CMS generator
26
- # which files should be copied over to the app when the CMS generator is run.
27
- # src_root is the absolute path to the root of the files,
28
- # then each argument after that is a Dir.glob pattern string.
29
- #
30
- # @param [String] src_root The root directory of the gem
31
- # @param [Array of String] files A list of all file names to be copied
32
- def add_generator_paths(src_root, *files)
33
- generator_paths << [src_root, files]
34
- end
35
-
36
- alias_method :add_paths_to_copied_into_project, :add_generator_paths
37
-
38
- def generator_paths
39
- @generator_paths ||= []
40
- end
41
-
42
- def add_to_rails_paths(path)
43
- ActiveSupport::Dependencies.autoload_paths << File.join(path, "app", "portlets")
44
- end
45
-
46
- def add_to_routes(route)
47
- routes << route
48
- end
49
- def routes
50
- @routes ||=[]
51
- end
52
-
53
- # Determines which WYSIWYG editor is the 'default' for a BrowserCMS project
54
- #
55
- # bcms modules can changes this by overriding it in their configuration.
56
- def content_editor
57
- @wysiwig_editor ||= "ckeditor"
58
- end
59
-
60
- def content_editor=(editor)
61
- @wysiwig_editor = editor
62
- end
63
-
64
- def markdown?
65
- Object.const_defined?("Markdown")
66
- end
67
-
68
- def reserved_paths
69
- @reserved_paths ||= ["/cms", "/cache"]
70
- end
71
-
72
- # This next 'hack' is to allow script/generate browser_cms to work on Windows machines. I'm not sure why this is necessary.
73
- #
74
- # This Generator is adding an absolute file path to the manifest, which is file (like a .js or migration) in
75
- # the gem directory on the developers's machine, rather
76
- # than just a relative path with the rails_generator directory. On windows, this will mean you are basically doing this.
77
- #
78
- # m.file "C:/Ruby/lib/ruby/gems/1.8/gems/browsercms-3.0.0/public/javascripts/jquery-ui.js", "testing/jquery-ui.js"
79
- #
80
- # When the generator hits this command during playback, it will throw an error like this:
81
- # Pattern 'c' matches more than one generator: content_block, controller
82
- # The generator then fails and stops copying. Stripping the C: off the front seems to fix this problem.
83
- # I.e. This command correctly copies the file on Windows XP.
84
- # m.file "/Ruby/lib/ruby/gems/1.8/gems/browsercms-3.0.0/public/javascripts/jquery-ui.js", "testing/jquery-ui.js"
85
- #
86
- def scrub_path(path)
87
- windows_drive_pattern = /\b[A-Za-z]:\// # Works on drives labeled A-Z:
88
- scrubbed_source_file_name = path.gsub(windows_drive_pattern, "/")
89
- end
90
- end
91
- module Errors
92
- class AccessDenied < StandardError
93
- def initialize
94
- super("Access Denied")
95
- end
96
- end
97
- end
98
- end
99
-
100
- Time::DATE_FORMATS.merge!(
101
- :year_month_day => '%Y/%m/%d',
102
- :date => '%m/%d/%Y'
103
- )
104
-
105
-
data/lib/tasks/data.rake DELETED
@@ -1,43 +0,0 @@
1
- def create_pages(root)
2
- (1..20).each do |i|
3
- Page.create!(:name=>"Page #{i}", :path=>"#{root.path}/page-#{i}", :section=>root, :template_file_name=>"default.html.erb", :publish_on_save=>true)
4
- end
5
- end
6
-
7
- def reset_root_user_password
8
- u = User.find(1)
9
- u.password= "cmsadmin"
10
- u.password_confirmation = "cmsadmin"
11
- u.save!
12
-
13
- puts "Reset #{u.login}'s password to '#{u.password}'."
14
- end
15
-
16
- namespace :cms do
17
-
18
- task "load" do
19
- sh "mysql -u root browsercms_development --password= < db/backups/backup.sql"
20
- end
21
-
22
- task "correct" => :environment do
23
- ActiveRecord::Base.connection.execute("UPDATE portlets SET type = 'DynamicPortlet' where type != 'DynamicPortlet'")
24
- ct = ["'CategoryType'", "'Category'", "'HtmlBlock'", "'Portlet'", "'FileBlock'", "'ImageBlock'", "'Tag'"].join(",")
25
- ActiveRecord::Base.connection.execute("DELETE FROM content_types where name not in (#{ct})")
26
- reset_root_user_password
27
- end
28
-
29
- desc "Load a CMS site backup (a .sql file must be called db/backups/backup.sql) for testing."
30
- task "load:backup" => ['db:drop','db:create', 'cms:load', 'cms:correct', 'db:migrate']
31
-
32
- desc "Load some sample pages for performance tuning"
33
- task "load:pages" => :environment do
34
- root = Section.root.first
35
- create_pages(root)
36
- (21..40).each do |i|
37
- sec = Section.create! :name=>"Section #{i}", :path=>"/section-#{i}/", :parent=>root
38
- create_pages(sec)
39
- end
40
-
41
- end
42
-
43
- end
data/lib/tasks/db.rake DELETED
@@ -1,82 +0,0 @@
1
- require 'find'
2
-
3
- namespace :db do
4
-
5
- desc "Creates and populates the initial BrowserCMS database for a new project."
6
- task :install => ["db:create", "db:migrate", "db:seed"]
7
-
8
- desc "Drop, create and migrate the database"
9
- task :redo => ["db:drop", "db:create", "db:migrate"]
10
-
11
- namespace :seed do
12
-
13
- desc "Load the seed data from db/browsercms.seeds.rb"
14
- task :browsercms => :environment do
15
- load File.join("db", "browsercms.seeds.rb")
16
- end
17
- end
18
-
19
- namespace :fixtures do
20
- desc 'Dumps all models into fixtures.'
21
- task :dump => :environment do
22
- models = []
23
- Find.find(Rails.root + '/app/models') do |path|
24
- unless File.directory?(path) then models << path.match(/(\w+).rb/)[1] end
25
- end
26
-
27
- models -= %w[content_observer guest_user file_block image_block email_message_mailer]
28
-
29
- puts "Models: " + models.join(', ')
30
-
31
- models.each do |m|
32
- model = m.tableize.classify.constantize
33
- create_fixture(model)
34
- create_fixture(model.version_class) if model.versioned?
35
- end
36
- end
37
-
38
- def create_fixture(model)
39
- puts "Creating fixture for #{model.table_name}"
40
- entries = model.find(:all, :order => 'id ASC')
41
-
42
- formatted, increment, tab = '', 1, ' '
43
- entries.each do |a|
44
- formatted += model.table_name.singularize + '_' + increment.to_s + ':' + "\n"
45
- increment += 1
46
-
47
- a.attributes.each do |column, value|
48
- formatted += tab
49
-
50
- match = value.to_s.match(/\n/)
51
- if match
52
- formatted += column + ': |' + "\n"
53
-
54
- value.to_a.each do |v|
55
- formatted += tab + tab + v
56
- end
57
- else
58
- formatted += column + ': ' + value.to_s
59
- end
60
-
61
- formatted += "\n"
62
- end
63
-
64
- formatted += "\n"
65
- end
66
-
67
- model_file = Rails.root + '/test/fixtures/' + model.table_name + '.yml'
68
-
69
- # Final munging of file
70
- formatted = "# auto-generated by rake db:fixtures:dump, DO NOT EDIT BY HAND!\n#{formatted}"
71
-
72
- # Scrub ERB
73
- formatted.gsub!('<% ', ',<%% ')
74
- formatted.gsub!('<%= ', ',<%%= ')
75
- formatted.gsub!(' %>', ' %%>')
76
-
77
- File.exists?(model_file) ? File.delete(model_file) : nil
78
- File.open(model_file, 'w') {|f| f << formatted}
79
- end
80
-
81
- end
82
- end
@@ -1,72 +0,0 @@
1
- <html>
2
- <head>
3
- <title>Styled File Field</title>
4
- <script type="text/javascript" src="/javascripts/jquery.js"></script>
5
- <script type='text/javascript'
6
- src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
7
- <script type="text/javascript">
8
- jQuery(function($){
9
- $('.file_field input[type=file]').each(function(){
10
- var fileInput = $(this)
11
- var fileInputId = fileInput.attr('id')
12
- var fileInputName = fileInput.attr('name')
13
-
14
- var img = $(document.createElement('img')).attr({'id': this.id, 'src': '/images/cms/browse.gif'})
15
- var fileName = $(document.createElement('span')).html('no file selected')
16
- var remove = $(document.createElement('button')).attr('type', 'button').html('Remove').click(function(){
17
- var newFile = $(document.createElement('input')).attr({
18
- 'type': 'file',
19
- 'class': 'file',
20
- 'name': fileInputName,
21
- 'id': fileInputId,
22
- 'size': 1
23
- }).change(function(){
24
- fileName.html($(this).val())
25
- })
26
- $('#'+fileInputId).replaceWith(newFile)
27
- fileName.html('no file selected')
28
- return false;
29
- })
30
- var div = $(document.createElement('div')).addClass('fake_file_field').append(img).append(fileName).append(remove)
31
- div.insertAfter(fileInput)
32
- fileInput.change(function(){
33
- fileName.html($(this).val())
34
- })
35
- })
36
- })
37
- </script>
38
- <style type="text/css">
39
- div.file_field {
40
- position: relative;
41
- }
42
-
43
- div.file_field input {
44
- position: relative;
45
- text-align: right;
46
- -moz-opacity:0 ;
47
- filter:alpha(opacity: 0);
48
- opacity: 0;
49
- z-index: 2;
50
- }
51
-
52
- div.fake_file_field {
53
- position: absolute;
54
- top: 0px;
55
- left: 0px;
56
- z-index: 1;
57
- }
58
-
59
- div.file_field button {
60
- z-index: 3;
61
- }
62
-
63
- </style>
64
- </head>
65
- <body>
66
- <form action="/">
67
- <div class="file_field">
68
- <input id="attachment_file" name="attachment_file" type="file" size="1"/>
69
- </div>
70
- </form>
71
- </body>
72
- </html>