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.
- data/README.markdown +1 -0
- data/app/assets/images/cms/file-uploading.gif +0 -0
- data/app/assets/javascripts/cms/application.js +1 -0
- data/app/assets/javascripts/cms/attachment_manager.js.erb +87 -0
- data/app/assets/javascripts/cms/core_library.js.erb +38 -25
- data/app/assets/stylesheets/cms/application.css.erb +1 -0
- data/app/assets/stylesheets/cms/attachment_manager.css.scss +28 -0
- data/app/controllers/cms/application_controller.rb +1 -1
- data/app/controllers/cms/attachments_controller.rb +45 -10
- data/app/controllers/cms/cache_controller.rb +1 -1
- data/app/controllers/cms/content_block_controller.rb +134 -122
- data/app/controllers/cms/content_controller.rb +143 -155
- data/app/controllers/cms/dashboard_controller.rb +11 -9
- data/app/controllers/cms/error_handling.rb +19 -7
- data/app/controllers/cms/file_blocks_controller.rb +2 -2
- data/app/controllers/cms/home_controller.rb +3 -0
- data/app/controllers/cms/section_nodes_controller.rb +52 -44
- data/app/controllers/cms/sections_controller.rb +4 -2
- data/app/controllers/cms/toolbar_controller.rb +14 -10
- data/app/helpers/cms/application_helper.rb +23 -19
- data/app/helpers/cms/form_builder.rb +65 -18
- data/app/helpers/cms/mobile_helper.rb +19 -0
- data/app/helpers/cms/path_helper.rb +30 -4
- data/app/helpers/cms/rendering_helper.rb +9 -1
- data/app/models/cms/abstract_file_block.rb +6 -6
- data/app/models/cms/attachment.rb +196 -107
- data/app/models/cms/category.rb +3 -0
- data/app/models/cms/category_type.rb +2 -0
- data/app/models/cms/connector.rb +3 -0
- data/app/models/cms/content_type.rb +3 -0
- data/app/models/cms/content_type_group.rb +2 -0
- data/app/models/cms/dynamic_view.rb +4 -0
- data/app/models/cms/email_message.rb +2 -0
- data/app/models/cms/file_block.rb +9 -2
- data/app/models/cms/group.rb +5 -2
- data/app/models/cms/group_permission.rb +2 -0
- data/app/models/cms/group_section.rb +3 -0
- data/app/models/cms/group_type.rb +2 -0
- data/app/models/cms/group_type_permission.rb +2 -0
- data/app/models/cms/html_block.rb +3 -2
- data/app/models/cms/image_block.rb +13 -2
- data/app/models/cms/page.rb +14 -3
- data/app/models/cms/page_route.rb +4 -0
- data/app/models/cms/page_route_condition.rb +1 -0
- data/app/models/cms/page_route_option.rb +2 -0
- data/app/models/cms/page_route_requirement.rb +1 -0
- data/app/models/cms/permission.rb +3 -0
- data/app/models/cms/portlet.rb +2 -2
- data/app/models/cms/redirect.rb +2 -0
- data/app/models/cms/section.rb +15 -1
- data/app/models/cms/section_node.rb +1 -0
- data/app/models/cms/site.rb +3 -0
- data/app/models/cms/tag.rb +2 -0
- data/app/models/cms/tagging.rb +3 -0
- data/app/models/cms/task.rb +5 -1
- data/app/models/cms/user.rb +1 -1
- data/app/models/cms/user_group_membership.rb +3 -0
- data/app/views/cms/attachments/_attachment.html.erb +14 -0
- data/app/views/cms/attachments/_attachment_table.html.erb +17 -0
- data/app/views/cms/attachments/_attachment_wrapper.html.erb +4 -0
- data/app/views/cms/blocks/index.html.erb +2 -3
- data/app/views/cms/blocks/show.html.erb +1 -1
- data/app/views/cms/dynamic_views/index.html.erb +1 -1
- data/app/views/cms/email_messages/index.html.erb +1 -1
- data/app/views/cms/file_blocks/_form.html.erb +1 -27
- data/app/views/cms/file_blocks/_section_selector.html.erb +13 -0
- data/app/views/cms/file_blocks/render.html.erb +3 -3
- data/app/views/cms/form_builder/_cms_attachment_manager.html.erb +26 -0
- data/app/views/cms/form_builder/_cms_file_field.html.erb +27 -35
- data/app/views/cms/groups/index.html.erb +1 -1
- data/app/views/cms/image_blocks/_form.html.erb +1 -27
- data/app/views/cms/image_blocks/render.html.erb +4 -1
- data/app/views/cms/page_routes/index.html.erb +3 -0
- data/app/views/cms/shared/error.xml.erb +8 -0
- data/app/views/cms/tags/render.html.erb +1 -1
- data/app/views/cms/toolbar/_mobile_toggle.html.erb +33 -0
- data/app/views/cms/users/index.html.erb +1 -1
- data/app/views/layouts/_page_toolbar.html.erb +2 -1
- data/bin/bcms +21 -26
- data/config/routes.rb +3 -2
- data/db/browsercms.seeds.rb +2 -1
- data/db/migrate/20111130221145_browsercms340.rb +5 -4
- data/db/migrate/20120329144406_browsercms350.rb +32 -0
- data/{test/dummy/db → db}/schema.rb +97 -128
- data/{performance_tuning_notes.md → doc/performance_tuning_notes.md} +0 -0
- data/doc/release_notes.md +74 -0
- data/lib/browsercms.rb +3 -0
- data/lib/cms/acts/content_block.rb +10 -2
- data/lib/cms/addressable.rb +8 -0
- data/lib/cms/attachments/attachment_serving.rb +59 -0
- data/lib/cms/attachments/configuration.rb +88 -0
- data/lib/cms/behaviors/attaching.rb +305 -136
- data/lib/cms/behaviors/connecting.rb +3 -4
- data/lib/cms/behaviors/dynamic_attributes.rb +121 -118
- data/lib/cms/behaviors/flush_cache_on_change.rb +1 -3
- data/lib/cms/behaviors/naming.rb +16 -0
- data/lib/cms/behaviors/pagination.rb +4 -1
- data/lib/cms/behaviors/publishing.rb +9 -3
- data/lib/cms/behaviors/searching.rb +3 -8
- data/lib/cms/behaviors/soft_deleting.rb +1 -0
- data/lib/cms/behaviors/taggable.rb +2 -0
- data/lib/cms/behaviors/versioning.rb +73 -120
- data/lib/cms/caching.rb +53 -11
- data/lib/cms/commands/actions.rb +19 -2
- data/lib/cms/configuration.rb +44 -0
- data/lib/cms/content_rendering_support.rb +9 -6
- data/lib/cms/default_accessible.rb +13 -0
- data/lib/cms/domain_support.rb +22 -0
- data/lib/cms/engine.rb +40 -19
- data/lib/cms/engine_helper.rb +54 -0
- data/lib/cms/extensions/active_record/connection_adapters/abstract/schema_statements.rb +14 -2
- data/lib/cms/mobile_aware.rb +67 -0
- data/lib/cms/route_extensions.rb +3 -0
- data/lib/cms/upgrades/v3_5_0.rb +155 -0
- data/lib/cms/version.rb +6 -1
- data/lib/generators/cms/content_block/content_block_generator.rb +14 -9
- data/lib/generators/cms/content_block/templates/_form.html.erb +17 -6
- data/lib/generators/cms/content_block/templates/render.html.erb +12 -5
- data/lib/generators/cms/template/template_generator.rb +11 -2
- data/lib/tasks/cms.rake +23 -0
- data/lib/templates/active_record/model/model.rb +6 -0
- metadata +127 -517
- data/.gitignore +0 -24
- data/.rvmrc +0 -2
- data/Gemfile +0 -29
- data/Gemfile.lock +0 -196
- data/Rakefile +0 -97
- data/app/assets/images/browsercms/.gitkeep +0 -0
- data/app/controllers/browsercms/application_controller.rb +0 -4
- data/browsercms.gemspec +0 -35
- data/config/cucumber.yml +0 -8
- data/config/database.jdbcmysql.yml +0 -30
- data/config/database.mysql.yml +0 -27
- data/config/database.postgres.yml +0 -25
- data/config/database.sqlite3.yml +0 -11
- data/config/environment.rb +0 -6
- data/config/initializers/query_reviewer_patch.rb +0 -12
- data/config/initializers/rack_1_2_1_patch.rb +0 -12
- data/config/locales/en.yml +0 -5
- data/features/acts_as_content_page.feature +0 -62
- data/features/add_content_to_pages.feature +0 -45
- data/features/caching.feature +0 -13
- data/features/ckeditor.feature +0 -11
- data/features/commands/confirm_aruba_works.feature +0 -24
- data/features/commands/generate_module.feature +0 -54
- data/features/commands/install_browsercms.feature +0 -21
- data/features/commands/new_demo_project.feature +0 -30
- data/features/commands/new_projects.feature +0 -50
- data/features/commands/upgrade_modules_to_3_4_0_from_3_1_x.feature +0 -19
- data/features/commands/upgrade_project_to_3_4_0_from_3_3_x.feature +0 -52
- data/features/commands/upgrading_modules.feature +0 -67
- data/features/content_blocks/manage_custom_blocks.feature +0 -67
- data/features/content_blocks/manage_html_blocks.feature +0 -48
- data/features/content_blocks/manage_image_blocks.feature +0 -41
- data/features/content_files.feature +0 -37
- data/features/content_pages.feature +0 -21
- data/features/generators/content_blocks_for_modules.feature +0 -58
- data/features/generators/content_blocks_for_projects.feature +0 -109
- data/features/install_content.feature +0 -25
- data/features/jquery-testplan.txt +0 -12
- data/features/manage_groups.feature +0 -33
- data/features/manage_page_routes.feature +0 -72
- data/features/manage_redirects.feature +0 -20
- data/features/manage_sections.feature +0 -12
- data/features/manage_tasks.feature +0 -25
- data/features/manage_users.feature +0 -38
- data/features/page_templates.feature +0 -49
- data/features/portlets/email_friend_portlet.feature +0 -29
- data/features/portlets/portlets.feature +0 -100
- data/features/portlets/tag_cloud_portlet.feature +0 -28
- data/features/sitemap/create_pages.feature +0 -15
- data/features/sitemap/manage_links.feature +0 -29
- data/features/sitemap/sitemap.feature +0 -18
- data/features/step_definitions/acts_as_content_page_steps.rb.rb +0 -3
- data/features/step_definitions/ckeditor_steps.rb +0 -13
- data/features/step_definitions/command_line_steps.rb +0 -212
- data/features/step_definitions/content_pages_steps.rb +0 -170
- data/features/step_definitions/data_steps.rb +0 -48
- data/features/step_definitions/edit_page_templates_steps.rb +0 -21
- data/features/step_definitions/html_blocks_steps.rb +0 -9
- data/features/step_definitions/install_content_steps.rb +0 -4
- data/features/step_definitions/manage_content_blocks_steps.rb +0 -26
- data/features/step_definitions/manage_image_blocks_steps.rb +0 -31
- data/features/step_definitions/manage_sections_steps.rb +0 -18
- data/features/step_definitions/manage_user_steps.rb +0 -22
- data/features/step_definitions/more_custom_block_steps.rb +0 -34
- data/features/step_definitions/page_route_steps.rb +0 -65
- data/features/step_definitions/page_template_steps.rb +0 -5
- data/features/step_definitions/permissions_steps.rb +0 -13
- data/features/step_definitions/portlets_steps.rb +0 -64
- data/features/step_definitions/redirect_steps.rb +0 -12
- data/features/step_definitions/sitemap_steps.rb +0 -18
- data/features/step_definitions/tag_cloud_steps.rb +0 -11
- data/features/step_definitions/task_steps.rb +0 -4
- data/features/step_definitions/taxonomy_steps.rb +0 -16
- data/features/step_definitions/upgrade_module_steps.rb +0 -76
- data/features/step_definitions/web_steps.rb +0 -211
- data/features/support/async_support.rb +0 -17
- data/features/support/command_line_helpers.rb +0 -63
- data/features/support/debug_formatter.rb +0 -7
- data/features/support/debugging.rb +0 -28
- data/features/support/env.rb +0 -73
- data/features/support/git_api.rb +0 -9
- data/features/support/open_on_first_failure.rb +0 -25
- data/features/support/paths.rb +0 -32
- data/features/support/rails_api.rb +0 -8
- data/features/support/selectors.rb +0 -39
- data/features/support/transforms.rb +0 -7
- data/features/taxonomy/add_content_with_category.feature +0 -30
- data/features/taxonomy/manage_categories.feature +0 -20
- data/features/taxonomy/manage_category_types.feature +0 -16
- data/lib/cms/init.rb +0 -105
- data/lib/tasks/data.rake +0 -43
- data/lib/tasks/db.rake +0 -82
- data/public/styled_file_field/index.html +0 -72
- data/script/cucumber +0 -10
- data/script/rails +0 -6
- data/test/console_helper.rb +0 -5
- data/test/custom_assertions.rb +0 -84
- data/test/dummy/Rakefile +0 -7
- data/test/dummy/app/assets/javascripts/application.js +0 -9
- data/test/dummy/app/assets/javascripts/content_page.js +0 -2
- data/test/dummy/app/assets/stylesheets/application.css +0 -7
- data/test/dummy/app/assets/stylesheets/content_page.css +0 -4
- data/test/dummy/app/controllers/application_controller.rb +0 -3
- data/test/dummy/app/controllers/cms/products_controller.rb +0 -2
- data/test/dummy/app/controllers/cms/sample_blocks_controller.rb +0 -3
- data/test/dummy/app/controllers/content_page_controller.rb +0 -13
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/helpers/content_page_helper.rb +0 -2
- data/test/dummy/app/mailers/.gitkeep +0 -0
- data/test/dummy/app/models/.gitkeep +0 -0
- data/test/dummy/app/models/cms/sample_block.rb +0 -22
- data/test/dummy/app/models/product.rb +0 -5
- data/test/dummy/app/views/cms/products/_form.html.erb +0 -7
- data/test/dummy/app/views/cms/products/render.html.erb +0 -3
- data/test/dummy/app/views/content_page/custom_page.html.erb +0 -3
- data/test/dummy/app/views/content_page/index.html.erb +0 -2
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/app/views/layouts/templates/default.html.erb +0 -17
- data/test/dummy/app/views/layouts/templates/subpage.html.erb +0 -16
- data/test/dummy/app/views/test_route/index.html.erb +0 -14
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -45
- data/test/dummy/config/boot.rb +0 -10
- data/test/dummy/config/database.yml +0 -27
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -32
- data/test/dummy/config/environments/production.rb +0 -60
- data/test/dummy/config/environments/test.rb +0 -46
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/browsercms.rb +0 -7
- data/test/dummy/config/initializers/inflections.rb +0 -10
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/quiet_sprocket_assets.rb +0 -13
- data/test/dummy/config/initializers/secret_token.rb +0 -7
- data/test/dummy/config/initializers/session_store.rb +0 -8
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -5
- data/test/dummy/config/routes.rb +0 -23
- data/test/dummy/db/migrate/20111228141250_create_products.rb +0 -16
- data/test/dummy/db/seeds.rb +0 -1
- data/test/dummy/lib/assets/.gitkeep +0 -0
- data/test/dummy/public/404.html +0 -26
- data/test/dummy/public/422.html +0 -26
- data/test/dummy/public/500.html +0 -26
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +0 -6
- data/test/dummy/test/functional/content_page_controller_test.rb +0 -9
- data/test/dummy/test/unit/helpers/content_page_helper_test.rb +0 -4
- data/test/factories.rb +0 -235
- data/test/fixtures/multipart/foo.jpg +0 -0
- data/test/fixtures/multipart/sample_upload.txt +0 -1
- data/test/fixtures/multipart/second_upload.txt +0 -1
- data/test/fixtures/multipart/test.jpg +0 -0
- data/test/fixtures/multipart/version1.txt +0 -1
- data/test/fixtures/multipart/version2.txt +0 -1
- data/test/functional/cms/cache_controller_test.rb +0 -16
- data/test/functional/cms/categories_controller_test.rb +0 -28
- data/test/functional/cms/connectors_controller_test.rb +0 -64
- data/test/functional/cms/content_block_controller_test.rb +0 -127
- data/test/functional/cms/content_controller_test.rb +0 -351
- data/test/functional/cms/dashboard_controller_test.rb +0 -20
- data/test/functional/cms/file_blocks_controller_test.rb +0 -55
- data/test/functional/cms/home_controller_test.rb +0 -160
- data/test/functional/cms/html_blocks_controller_test.rb +0 -159
- data/test/functional/cms/image_blocks_controller_test.rb +0 -78
- data/test/functional/cms/links_controller_test.rb +0 -92
- data/test/functional/cms/log/test.log +0 -0
- data/test/functional/cms/pages_controller_test.rb +0 -233
- data/test/functional/cms/portlets_controller_test.rb +0 -57
- data/test/functional/cms/sections_controller_test.rb +0 -234
- data/test/functional/cms/sessions_controller_test.rb +0 -80
- data/test/functional/cms/tasks_controller_test.rb +0 -64
- data/test/functional/cms/toolbar_controller_test.rb +0 -76
- data/test/functional/cms/users_controller_test.rb +0 -218
- data/test/integration/cms/password_management_test.rb +0 -66
- data/test/integration/sitemap_performance_test.rb +0 -26
- data/test/mock_file.rb +0 -33
- data/test/performance/browsing_test.rb +0 -9
- data/test/support/engine_controller_hacks.rb +0 -34
- data/test/support/factory_helpers.rb +0 -57
- data/test/support/rails_3_1_routes_hack.rb +0 -70
- data/test/test_helper.rb +0 -199
- data/test/test_logging.rb +0 -67
- data/test/unit/active_record_callbacks.rb +0 -50
- data/test/unit/behaviors/attaching_test.rb +0 -370
- data/test/unit/behaviors/cms_user_test.rb +0 -67
- data/test/unit/behaviors/connectable_test.rb +0 -32
- data/test/unit/behaviors/connecting_test.rb +0 -56
- data/test/unit/behaviors/dynamic_attributes_test.rb +0 -74
- data/test/unit/behaviors/namespacing_test.rb +0 -76
- data/test/unit/behaviors/publishable_test.rb +0 -83
- data/test/unit/behaviors/rendering_test.rb +0 -68
- data/test/unit/behaviors/searching_test.rb +0 -102
- data/test/unit/behaviors/taggable_test.rb +0 -110
- data/test/unit/behaviors/userstamping_test.rb +0 -27
- data/test/unit/behaviors/versioning_test.rb +0 -102
- data/test/unit/extensions/active_record/base_test.rb +0 -25
- data/test/unit/extensions/hash_test.rb +0 -26
- data/test/unit/extensions/integer_test.rb +0 -10
- data/test/unit/extensions/string_test.rb +0 -14
- data/test/unit/factories_test.rb +0 -50
- data/test/unit/generators/install_generator_test.rb +0 -15
- data/test/unit/helpers/application_helper_test.rb +0 -104
- data/test/unit/helpers/date_picker_test.rb +0 -17
- data/test/unit/helpers/menu_helper_test.rb +0 -240
- data/test/unit/helpers/page_helper_test.rb +0 -69
- data/test/unit/helpers/path_helper_test.rb +0 -38
- data/test/unit/helpers/rendering_helper_test.rb +0 -8
- data/test/unit/lib/acts_as_content_page_test.rb +0 -72
- data/test/unit/lib/cms/authentication/controller_test.rb +0 -20
- data/test/unit/lib/cms/engine_helper_test.rb +0 -119
- data/test/unit/lib/cms/sitemap_test.rb +0 -210
- data/test/unit/lib/cms_domain_support_test.rb +0 -44
- data/test/unit/lib/command_line_test.rb +0 -70
- data/test/unit/lib/content_block_test.rb +0 -304
- data/test/unit/lib/content_rendering_support_test.rb +0 -40
- data/test/unit/lib/generators_test.rb +0 -40
- data/test/unit/lib/routes_test.rb +0 -98
- data/test/unit/mock_file_test.rb +0 -19
- data/test/unit/models/attachment_test.rb +0 -160
- data/test/unit/models/category_test.rb +0 -40
- data/test/unit/models/category_type_test.rb +0 -8
- data/test/unit/models/connector_test.rb +0 -152
- data/test/unit/models/content_type_group_test.rb +0 -26
- data/test/unit/models/content_type_test.rb +0 -177
- data/test/unit/models/dynamic_views_test.rb +0 -36
- data/test/unit/models/email_page_portlet_test.rb +0 -20
- data/test/unit/models/file_block_test.rb +0 -246
- data/test/unit/models/group_test.rb +0 -29
- data/test/unit/models/html_block_test.rb +0 -121
- data/test/unit/models/image_block_test.rb +0 -35
- data/test/unit/models/link_test.rb +0 -52
- data/test/unit/models/namespaces_test.rb +0 -57
- data/test/unit/models/page_partial_test.rb +0 -37
- data/test/unit/models/page_route_test.rb +0 -113
- data/test/unit/models/page_template_test.rb +0 -50
- data/test/unit/models/page_test.rb +0 -879
- data/test/unit/models/permission_test.rb +0 -10
- data/test/unit/models/portlet_test.rb +0 -99
- data/test/unit/models/sections_test.rb +0 -278
- data/test/unit/models/site_test.rb +0 -50
- data/test/unit/models/task_test.rb +0 -150
- data/test/unit/models/user_test.rb +0 -358
- data/test/unit/schema_statements_test.rb +0 -137
- data/todo_list.markdown +0 -50
@@ -1,76 +0,0 @@
|
|
1
|
-
# We can't just call `rails _2.3.14_ new` because Aruba locks to a specific version of the gem (I think).
|
2
|
-
# So we always get a Rails 3.1 project.
|
3
|
-
# Instead, we are 'faking' it.
|
4
|
-
Given /^I am working on a BrowserCMS v3.1.x module named "([^"]*)"$/ do |project_name|
|
5
|
-
write_file "#{project_name}/script/console", "# Rails 2 File"
|
6
|
-
cd project_name
|
7
|
-
write_file "lib/#{project_name}.rb", "# Marks this as a Module."
|
8
|
-
create_git_project
|
9
|
-
end
|
10
|
-
|
11
|
-
Given /^I am working on a BrowserCMS v3.3.x module named "([^"]*)"/ do |project_name|
|
12
|
-
run_simple "rails _3.0.9_ new #{project_name} --skip-bundle"
|
13
|
-
cd project_name
|
14
|
-
append_to_file "config/database.yml", "# @original-yml"
|
15
|
-
append_to_file "config/routes.rb", "# @original-routes"
|
16
|
-
append_to_file "#{project_name}.gemspec", "# @original-gemspec"
|
17
|
-
|
18
|
-
# Mimics a 3.3.x style public/bms/module_name where public files lived
|
19
|
-
write_file "public/bcms/#{project_name.gsub("bcms_", "")}/test.html", "@original-html"
|
20
|
-
write_file "public/bcms/#{project_name.gsub("bcms_", "")}/js/test.js", "@original-js"
|
21
|
-
|
22
|
-
# 3.3.x engines will probably have some code in them
|
23
|
-
write_file "lib/#{project_name}.rb", "# Marks this as a Module"
|
24
|
-
write_file "lib/#{project_name}/engine.rb", "# @original-engine"
|
25
|
-
write_file "lib/#{project_name}/version.rb", "# @original-version"
|
26
|
-
|
27
|
-
# The DB folder might have some sqlite databases, BrowserCMS migrations and seeds data
|
28
|
-
write_file "db/seeds.rb", "# Should get deleted"
|
29
|
-
write_file "db/migrate/20080815014337_browsercms_3_0_0.rb", "# Should get deleted"
|
30
|
-
write_file "db/migrate/20091109175123_browsercms_3_0_5.rb", "# Should get deleted"
|
31
|
-
write_file "db/migrate/my_module_migration.rb", "# This should be kept'"
|
32
|
-
write_file "db/development.sqlite3", "# Should get deleted"
|
33
|
-
write_file "db/schema.rb", "# Should get deleted"
|
34
|
-
create_git_project
|
35
|
-
end
|
36
|
-
|
37
|
-
When /^the installation script should be created$/ do
|
38
|
-
steps %Q{
|
39
|
-
And the following directories should exist:
|
40
|
-
| lib/generators/bcms_widgets/install/templates |
|
41
|
-
And the following files should exist:
|
42
|
-
| lib/generators/bcms_widgets/install/USAGE |
|
43
|
-
}
|
44
|
-
generator = 'lib/generators/bcms_widgets/install/install_generator.rb'
|
45
|
-
check_file_presence([generator], true)
|
46
|
-
check_file_content(generator, "BcmsWidgets::InstallGenerator", true)
|
47
|
-
check_file_content(generator, "rake 'bcms_widgets:install:migrations'", true)
|
48
|
-
check_file_content(generator, "mount_engine(BcmsWidgets)", true)
|
49
|
-
|
50
|
-
end
|
51
|
-
When /^the engine should be created$/ do
|
52
|
-
check_file_presence(['lib/bcms_widgets.rb'], true)
|
53
|
-
check_file_content('lib/bcms_widgets/engine.rb', "include Cms::Module", true)
|
54
|
-
|
55
|
-
end
|
56
|
-
Given /^I am working on a BrowserCMS v3.3.x project named "([^"]*)"$/ do |project_name|
|
57
|
-
run_simple "rails _3.0.9_ new #{project_name} --skip-bundle"
|
58
|
-
cd project_name
|
59
|
-
append_to_file "Gemfile", "gem \"browsercms\", \"3.3.3\""
|
60
|
-
self.project_name = project_name
|
61
|
-
end
|
62
|
-
|
63
|
-
Then /^a Gemfile should be created$/ do
|
64
|
-
steps %Q{
|
65
|
-
Then a file named "Gemfile" should exist
|
66
|
-
}
|
67
|
-
end
|
68
|
-
|
69
|
-
When /^it should no longer generate a README in the public directory$/ do
|
70
|
-
check_file_presence ['public/bcms/bcms_widgets/README'], false
|
71
|
-
end
|
72
|
-
|
73
|
-
When /^the project should be LGPL licensed$/ do
|
74
|
-
check_file_presence [ 'GPL.txt', 'LICENSE.txt'], true
|
75
|
-
check_file_presence [ 'MIT-LICENSE'], false
|
76
|
-
end
|
@@ -1,211 +0,0 @@
|
|
1
|
-
# TL;DR: YOU SHOULD DELETE THIS FILE
|
2
|
-
#
|
3
|
-
# This file was generated by Cucumber-Rails and is only here to get you a head start
|
4
|
-
# These step definitions are thin wrappers around the Capybara/Webrat API that lets you
|
5
|
-
# visit pages, interact with widgets and make assertions about page content.
|
6
|
-
#
|
7
|
-
# If you use these step definitions as basis for your features you will quickly end up
|
8
|
-
# with features that are:
|
9
|
-
#
|
10
|
-
# * Hard to maintain
|
11
|
-
# * Verbose to read
|
12
|
-
#
|
13
|
-
# A much better approach is to write your own higher level step definitions, following
|
14
|
-
# the advice in the following blog posts:
|
15
|
-
#
|
16
|
-
# * http://benmabey.com/2008/05/19/imperative-vs-declarative-scenarios-in-user-stories.html
|
17
|
-
# * http://dannorth.net/2011/01/31/whose-domain-is-it-anyway/
|
18
|
-
# * http://elabs.se/blog/15-you-re-cuking-it-wrong
|
19
|
-
#
|
20
|
-
|
21
|
-
|
22
|
-
require 'uri'
|
23
|
-
require 'cgi'
|
24
|
-
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
25
|
-
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "selectors"))
|
26
|
-
|
27
|
-
module WithinHelpers
|
28
|
-
def with_scope(locator)
|
29
|
-
locator ? within(*selector_for(locator)) { yield } : yield
|
30
|
-
end
|
31
|
-
end
|
32
|
-
World(WithinHelpers)
|
33
|
-
|
34
|
-
# Single-line step scoper
|
35
|
-
When /^(.*) within (.*[^:])$/ do |step, parent|
|
36
|
-
with_scope(parent) { When step }
|
37
|
-
end
|
38
|
-
|
39
|
-
# Multi-line step scoper
|
40
|
-
When /^(.*) within (.*[^:]):$/ do |step, parent, table_or_string|
|
41
|
-
with_scope(parent) { When "#{step}:", table_or_string }
|
42
|
-
end
|
43
|
-
|
44
|
-
Given /^(?:|I )am on (.+)$/ do |page_name|
|
45
|
-
visit path_to(page_name)
|
46
|
-
end
|
47
|
-
|
48
|
-
When /^(?:|I )go to (.+)$/ do |page_name|
|
49
|
-
visit path_to(page_name)
|
50
|
-
end
|
51
|
-
|
52
|
-
When /^(?:|I )press "([^"]*)"$/ do |button|
|
53
|
-
click_button(button)
|
54
|
-
end
|
55
|
-
|
56
|
-
When /^(?:|I )follow "([^"]*)"$/ do |link|
|
57
|
-
click_link(link)
|
58
|
-
end
|
59
|
-
|
60
|
-
When /^(?:|I )fill in "([^"]*)" with "([^"]*)"$/ do |field, value|
|
61
|
-
fill_in(field, :with => value)
|
62
|
-
end
|
63
|
-
|
64
|
-
When /^(?:|I )fill in "([^"]*)" for "([^"]*)"$/ do |value, field|
|
65
|
-
fill_in(field, :with => value)
|
66
|
-
end
|
67
|
-
|
68
|
-
# Use this to fill in an entire form with data from a table. Example:
|
69
|
-
#
|
70
|
-
# When I fill in the following:
|
71
|
-
# | Account Number | 5002 |
|
72
|
-
# | Expiry date | 2009-11-01 |
|
73
|
-
# | Note | Nice guy |
|
74
|
-
# | Wants Email? | |
|
75
|
-
#
|
76
|
-
# TODO: Add support for checkbox, select og option
|
77
|
-
# based on naming conventions.
|
78
|
-
#
|
79
|
-
When /^(?:|I )fill in the following:$/ do |fields|
|
80
|
-
fields.rows_hash.each do |name, value|
|
81
|
-
When %{I fill in "#{name}" with "#{value}"}
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
When /^(?:|I )select "([^"]*)" from "([^"]*)"$/ do |value, field|
|
86
|
-
select(value, :from => field)
|
87
|
-
end
|
88
|
-
|
89
|
-
When /^(?:|I )check "([^"]*)"$/ do |field|
|
90
|
-
check(field)
|
91
|
-
end
|
92
|
-
|
93
|
-
When /^(?:|I )uncheck "([^"]*)"$/ do |field|
|
94
|
-
uncheck(field)
|
95
|
-
end
|
96
|
-
|
97
|
-
When /^(?:|I )choose "([^"]*)"$/ do |field|
|
98
|
-
choose(field)
|
99
|
-
end
|
100
|
-
|
101
|
-
When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"$/ do |path, field|
|
102
|
-
attach_file(field, File.expand_path(path))
|
103
|
-
end
|
104
|
-
|
105
|
-
Then /^(?:|I )should see "([^"]*)"$/ do |text|
|
106
|
-
if page.respond_to? :should
|
107
|
-
page.should have_content(text)
|
108
|
-
else
|
109
|
-
assert page.has_content?(text)
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
Then /^(?:|I )should see \/([^\/]*)\/$/ do |regexp|
|
114
|
-
regexp = Regexp.new(regexp)
|
115
|
-
|
116
|
-
if page.respond_to? :should
|
117
|
-
page.should have_xpath('//*', :text => regexp)
|
118
|
-
else
|
119
|
-
assert page.has_xpath?('//*', :text => regexp)
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
Then /^(?:|I )should not see "([^"]*)"$/ do |text|
|
124
|
-
if page.respond_to? :should
|
125
|
-
page.should have_no_content(text)
|
126
|
-
else
|
127
|
-
assert page.has_no_content?(text)
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
|
-
Then /^(?:|I )should not see \/([^\/]*)\/$/ do |regexp|
|
132
|
-
regexp = Regexp.new(regexp)
|
133
|
-
|
134
|
-
if page.respond_to? :should
|
135
|
-
page.should have_no_xpath('//*', :text => regexp)
|
136
|
-
else
|
137
|
-
assert page.has_no_xpath?('//*', :text => regexp)
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
Then /^the "([^"]*)" field(?: within (.*))? should contain "([^"]*)"$/ do |field, parent, value|
|
142
|
-
with_scope(parent) do
|
143
|
-
field = find_field(field)
|
144
|
-
field_value = (field.tag_name == 'textarea') ? field.text : field.value
|
145
|
-
if field_value.respond_to? :should
|
146
|
-
field_value.should =~ /#{value}/
|
147
|
-
else
|
148
|
-
assert_match(/#{value}/, field_value)
|
149
|
-
end
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
|
-
Then /^the "([^"]*)" field(?: within (.*))? should not contain "([^"]*)"$/ do |field, parent, value|
|
154
|
-
with_scope(parent) do
|
155
|
-
field = find_field(field)
|
156
|
-
field_value = (field.tag_name == 'textarea') ? field.text : field.value
|
157
|
-
if field_value.respond_to? :should_not
|
158
|
-
field_value.should_not =~ /#{value}/
|
159
|
-
else
|
160
|
-
assert_no_match(/#{value}/, field_value)
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
|
-
Then /^the "([^"]*)" checkbox(?: within (.*))? should be checked$/ do |label, parent|
|
166
|
-
with_scope(parent) do
|
167
|
-
field_checked = find_field(label)['checked']
|
168
|
-
if field_checked.respond_to? :should
|
169
|
-
field_checked.should be_true
|
170
|
-
else
|
171
|
-
assert field_checked
|
172
|
-
end
|
173
|
-
end
|
174
|
-
end
|
175
|
-
|
176
|
-
Then /^the "([^"]*)" checkbox(?: within (.*))? should not be checked$/ do |label, parent|
|
177
|
-
with_scope(parent) do
|
178
|
-
field_checked = find_field(label)['checked']
|
179
|
-
if field_checked.respond_to? :should
|
180
|
-
field_checked.should be_false
|
181
|
-
else
|
182
|
-
assert !field_checked
|
183
|
-
end
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
|
-
Then /^(?:|I )should be on (.+)$/ do |page_name|
|
188
|
-
current_path = URI.parse(current_url).path
|
189
|
-
if current_path.respond_to? :should
|
190
|
-
current_path.should == path_to(page_name)
|
191
|
-
else
|
192
|
-
assert_equal path_to(page_name), current_path
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
|
-
Then /^(?:|I )should have the following query string:$/ do |expected_pairs|
|
197
|
-
query = URI.parse(current_url).query
|
198
|
-
actual_params = query ? CGI.parse(query) : {}
|
199
|
-
expected_params = {}
|
200
|
-
expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')}
|
201
|
-
|
202
|
-
if actual_params.respond_to? :should
|
203
|
-
actual_params.should == expected_params
|
204
|
-
else
|
205
|
-
assert_equal expected_params, actual_params
|
206
|
-
end
|
207
|
-
end
|
208
|
-
|
209
|
-
Then /^show me the page$/ do
|
210
|
-
save_and_open_page
|
211
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module AsyncSupport
|
2
|
-
def eventually
|
3
|
-
timeout = 5
|
4
|
-
polling_interval = 0.1
|
5
|
-
time_limit = Time.now + timeout
|
6
|
-
loop do
|
7
|
-
begin
|
8
|
-
yield
|
9
|
-
rescue StandardError => error
|
10
|
-
end
|
11
|
-
return if error.nil?
|
12
|
-
raise error if Time.now >= time_limit
|
13
|
-
sleep polling_interval
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
World(AsyncSupport)
|
@@ -1,63 +0,0 @@
|
|
1
|
-
module CommandLineHelpers
|
2
|
-
attr_writer :project_name
|
3
|
-
|
4
|
-
def project_name
|
5
|
-
unless @project_name
|
6
|
-
raise "This Cucumber step relies on self.project_name= to be set prior to being called."
|
7
|
-
end
|
8
|
-
@project_name
|
9
|
-
end
|
10
|
-
|
11
|
-
def expect_project_directories(directories)
|
12
|
-
check_directory_presence prefix_project_name_to(directories), true
|
13
|
-
end
|
14
|
-
|
15
|
-
def expect_project_files(files)
|
16
|
-
check_file_presence prefix_project_name_to(files), true
|
17
|
-
end
|
18
|
-
|
19
|
-
# @param [String|Array] files File(s)) or Directory(ies) that should have the project name prefixed.
|
20
|
-
def prefix_project_name_to(files)
|
21
|
-
if files.instance_of?(Array)
|
22
|
-
files.map { |file| "#{project_name}/#{file}" }
|
23
|
-
else
|
24
|
-
"#{project_name}/#{files}"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def create_bcms_project(name)
|
29
|
-
self.project_name = name
|
30
|
-
cmd = "bcms new #{project_name} --skip-bundle"
|
31
|
-
run_simple(unescape(cmd), false)
|
32
|
-
end
|
33
|
-
|
34
|
-
# Given the name of the migration (i.e. create_something.rb) find the EXACT migration file (which will include a timestamp)
|
35
|
-
# Example:
|
36
|
-
# find_migration_with_name("create_something.rb")
|
37
|
-
#
|
38
|
-
# @param [String] partial_file_name - Must include the .rb at the end
|
39
|
-
# @parem [String] The absolute path to the migration file
|
40
|
-
def find_migration_with_name(partial_file_name)
|
41
|
-
files, file_pattern = migrations_named(partial_file_name)
|
42
|
-
fail "Couldn't find a migration file matching this pattern (#{file_pattern})'" if files.empty?
|
43
|
-
File.absolute_path(files.first)
|
44
|
-
end
|
45
|
-
|
46
|
-
def migration_exists?(partial_file_name)
|
47
|
-
files, fp = migrations_named(partial_file_name)
|
48
|
-
files.size > 0
|
49
|
-
end
|
50
|
-
|
51
|
-
def migrations_named(name)
|
52
|
-
file_pattern = "#{@aruba_dir}/#{project_name}/db/migrate/*#{name}"
|
53
|
-
files = Dir.glob(file_pattern)
|
54
|
-
return files, file_pattern
|
55
|
-
end
|
56
|
-
|
57
|
-
|
58
|
-
def verify_seed_data_requires_browsercms_seeds
|
59
|
-
check_file_content('db/seeds.rb', "\nrequire File.expand_path('../browsercms.seeds.rb', __FILE__)\n", true)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
World(CommandLineHelpers)
|
63
|
-
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'cms/data_loader'
|
2
|
-
|
3
|
-
require File.expand_path(File.join(__FILE__, "..", "..", "..", "test", "mock_file"))
|
4
|
-
module FileOperations
|
5
|
-
|
6
|
-
# Creates an 'uploaded' file block at a given relative path
|
7
|
-
# @param [String] relative_file_path A relative file path (i.e. /test.txt) for the uploaded block.
|
8
|
-
def create_file(relative_file_path, text="Test Content")
|
9
|
-
# We are creating a temp file with no path, so strip leading slash
|
10
|
-
file_name = relative_file_path.gsub(/^\//, "")
|
11
|
-
tempfile = Tempfile.new file_name do |f|
|
12
|
-
f << text
|
13
|
-
end
|
14
|
-
tempfile << text
|
15
|
-
tempfile.flush
|
16
|
-
tempfile.close
|
17
|
-
|
18
|
-
upload_file = Rack::Test::UploadedFile.new(tempfile.path, "text/plain", false)
|
19
|
-
Factory(:file_block, :attachment_file => upload_file, :attachment_file_path => file_name)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
World(FileOperations)
|
24
|
-
|
25
|
-
# Make sure the database is completely empty before we start, then go back to cleaning up between transactions.
|
26
|
-
DatabaseCleaner.clean_with :truncation
|
27
|
-
DatabaseCleaner.strategy = :transaction
|
28
|
-
|
data/features/support/env.rb
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
# Added for BrowserCMS (to test using test/dummy app)
|
2
|
-
ENV["RAILS_ENV"] ||= "test"
|
3
|
-
require File.expand_path("../../../test/dummy/config/environment.rb", __FILE__)
|
4
|
-
ENV["RAILS_ROOT"] ||= File.dirname(__FILE__) + "../../../test/dummy"
|
5
|
-
|
6
|
-
require 'factory_girl'
|
7
|
-
require File.join(File.dirname(__FILE__), '../../test/factories')
|
8
|
-
require 'aruba/cucumber'
|
9
|
-
|
10
|
-
Before do
|
11
|
-
# Configure where Aruba generates files.
|
12
|
-
# You can't generate rails projects within rails projects', so it needs to be parallel to the browsercms project
|
13
|
-
@aruba_dir = "../browsercms-tmp/aruba"
|
14
|
-
@scratch_dir = "../browsercms-tmp/cached-bcms-project"
|
15
|
-
@dirs = [@aruba_dir]
|
16
|
-
|
17
|
-
# Generating projects takes a while, so give Aruba more time before it cuts things off.
|
18
|
-
@aruba_timeout_seconds = 30
|
19
|
-
|
20
|
-
# Must explicitly clean up the working directory before each project (might be solved in later version of Aruba)
|
21
|
-
FileUtils.rm_rf(@aruba_dir)
|
22
|
-
end
|
23
|
-
|
24
|
-
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
25
|
-
# It is recommended to regenerate this file in the future when you upgrade to a
|
26
|
-
# newer version of cucumber-rails. Consider adding your own code to a new file
|
27
|
-
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
28
|
-
# files.
|
29
|
-
|
30
|
-
require 'cucumber/rails'
|
31
|
-
|
32
|
-
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
|
33
|
-
# order to ease the transition to Capybara we set the default here. If you'd
|
34
|
-
# prefer to use XPath just remove this line and adjust any selectors in your
|
35
|
-
# steps to use the XPath syntax.
|
36
|
-
Capybara.default_selector = :css
|
37
|
-
|
38
|
-
# By default, any exception happening in your Rails application will bubble up
|
39
|
-
# to Cucumber so that your scenario will fail. This is a different from how
|
40
|
-
# your application behaves in the production environment, where an error page will
|
41
|
-
# be rendered instead.
|
42
|
-
#
|
43
|
-
# Sometimes we want to override this default behaviour and allow Rails to rescue
|
44
|
-
# exceptions and display an error page (just like when the app is running in production).
|
45
|
-
# Typical scenarios where you want to do this is when you test your error pages.
|
46
|
-
# There are two ways to allow Rails to rescue exceptions:
|
47
|
-
#
|
48
|
-
# 1) Tag your scenario (or feature) with @allow-rescue
|
49
|
-
#
|
50
|
-
# 2) Set the value below to true. Beware that doing this globally is not
|
51
|
-
# recommended as it will mask a lot of errors for you!
|
52
|
-
#
|
53
|
-
ActionController::Base.allow_rescue = false
|
54
|
-
|
55
|
-
# Remove/comment out the lines below if your app doesn't have a database.
|
56
|
-
# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
|
57
|
-
begin
|
58
|
-
DatabaseCleaner.strategy = :transaction
|
59
|
-
rescue NameError
|
60
|
-
raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
|
61
|
-
end
|
62
|
-
|
63
|
-
# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
|
64
|
-
# See the DatabaseCleaner documentation for details. Example:
|
65
|
-
#
|
66
|
-
# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
|
67
|
-
# DatabaseCleaner.strategy = :truncation, {:except => %w[widgets]}
|
68
|
-
# end
|
69
|
-
#
|
70
|
-
# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
|
71
|
-
# DatabaseCleaner.strategy = :transaction
|
72
|
-
# end
|
73
|
-
#
|