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,15 +0,0 @@
|
|
1
|
-
Feature: Create Pages
|
2
|
-
Content Editors should be able to create pages from the sitemap in order to show content to their users.
|
3
|
-
|
4
|
-
Background:
|
5
|
-
Given the cms database is populated
|
6
|
-
And I am logged in as a Content Editor
|
7
|
-
|
8
|
-
Scenario: Create Page
|
9
|
-
Given I am adding a page to the root section
|
10
|
-
And I fill in "Name" with "A New Page"
|
11
|
-
And I fill in "Path" with "/my-new-page"
|
12
|
-
And I select "Default" from "Template"
|
13
|
-
And I click on "Save"
|
14
|
-
Then I should see a page titled "A New Page"
|
15
|
-
|
@@ -1,29 +0,0 @@
|
|
1
|
-
Feature: Manage Links
|
2
|
-
Content Editors should be able to create links on the sitemap in order to have menu items that go to URLs that are
|
3
|
-
served by CMS pages.
|
4
|
-
|
5
|
-
Background:
|
6
|
-
Given the cms database is populated
|
7
|
-
And I am logged in as a Content Editor
|
8
|
-
|
9
|
-
Scenario: Add Link
|
10
|
-
When I am adding a link on the sitemap
|
11
|
-
And I fill in "Name" with "A New Link"
|
12
|
-
And I fill in "Url" with "http://www.browsercms.com"
|
13
|
-
And I click on "Save"
|
14
|
-
Then I should see a page titled "Sitemap"
|
15
|
-
Then I should see the following content:
|
16
|
-
| A New Link |
|
17
|
-
|
18
|
-
|
19
|
-
Scenario: Update And Publish Link
|
20
|
-
Given the following link exists:
|
21
|
-
| name | url | section |
|
22
|
-
| CMS | www.browsercms.com | / |
|
23
|
-
When I edit that link
|
24
|
-
And I change the link name to "A more well tested CMS"
|
25
|
-
Then I should see a page titled "Sitemap"
|
26
|
-
Then I should see the following content:
|
27
|
-
| A more well tested CMS |
|
28
|
-
|
29
|
-
|
@@ -1,18 +0,0 @@
|
|
1
|
-
Feature: Sitemap
|
2
|
-
In order to see the structure of a site, and add new pages/sections, content editors should be able to see a sitemap
|
3
|
-
showing content pages and sections.
|
4
|
-
|
5
|
-
Background:
|
6
|
-
Given the cms database is populated
|
7
|
-
And I am logged in as a Content Editor
|
8
|
-
|
9
|
-
Scenario: View as Admin
|
10
|
-
Given there are some additional pages and sections
|
11
|
-
When I request /cms/sitemap
|
12
|
-
Then I should see a page titled "Sitemap"
|
13
|
-
And I should see the stock CMS pages
|
14
|
-
And I should see the new pages and sections
|
15
|
-
|
16
|
-
Scenario: Verify Editable Sections
|
17
|
-
# Given there are some restricted sections and pages
|
18
|
-
# Verify that I can edit some, but not others.
|
@@ -1,13 +0,0 @@
|
|
1
|
-
Then /^I should see the CKEditor$/ do
|
2
|
-
assert page.has_css?('script', :src=>"/bcms/ckeditor/ckeditor.js"), "Should include the ckeditor file"
|
3
|
-
assert page.has_css?('script', :src=>"/bcms/ckeditor/editor.js"), "Should include the ckeditor file"
|
4
|
-
end
|
5
|
-
|
6
|
-
Then /^I should see a widget to select which editor to use$/ do
|
7
|
-
# This just verifies that the text editor selection widget is present.
|
8
|
-
assert page.has_selector?('#dhtml_selector')
|
9
|
-
within('#dhtml_selector') do
|
10
|
-
assert page.has_content?("Rich Text")
|
11
|
-
assert page.has_content?("Simple Text")
|
12
|
-
end
|
13
|
-
end
|
@@ -1,212 +0,0 @@
|
|
1
|
-
# Just a spot check that a rails project was generated successfully.
|
2
|
-
# The exact files being check could be tuned better.
|
3
|
-
Then /^a rails application named "([^"]*)" should exist$/ do |app_name|
|
4
|
-
self.project_name = app_name
|
5
|
-
check_directory_presence [project_name], true
|
6
|
-
expect_project_directories %w{ app config db }
|
7
|
-
expect_project_files %w{script/rails Gemfile }
|
8
|
-
end
|
9
|
-
|
10
|
-
Given /^a rails application named "([^"]*)" exists$/ do |name|
|
11
|
-
create_rails_project(name)
|
12
|
-
append_to_file "#{name}/db/seeds.rb", "# Some sample seed data here"
|
13
|
-
end
|
14
|
-
|
15
|
-
When /^I create a new BrowserCMS project named "([^"]*)"$/ do |name|
|
16
|
-
self.project_name = name
|
17
|
-
cmd = "bcms new #{project_name} --skip-bundle"
|
18
|
-
run_simple(unescape(cmd), false)
|
19
|
-
end
|
20
|
-
When /^I create a module named "([^"]*)"$/ do |name|
|
21
|
-
self.project_name = name
|
22
|
-
cmd = "bcms module #{project_name} --skip-bundle"
|
23
|
-
run_simple(unescape(cmd), false)
|
24
|
-
end
|
25
|
-
Then /^a rails engine named "([^"]*)" should exist$/ do |engine_name|
|
26
|
-
check_directory_presence [engine_name], true
|
27
|
-
expect_project_directories %w{ app config lib }
|
28
|
-
expect_project_files ["script/rails", "Gemfile", "#{engine_name}.gemspec"]
|
29
|
-
end
|
30
|
-
|
31
|
-
When /^BrowserCMS should be added the \.gemspec file$/ do
|
32
|
-
check_file_content("#{project_name}/#{project_name}.gemspec", "s.add_dependency \"browsercms\", \"~> #{Cms::VERSION}\"", true)
|
33
|
-
end
|
34
|
-
|
35
|
-
Then /^BrowserCMS should be installed in the project$/ do
|
36
|
-
# This is a not a really complete check but it at least verifies the generator completes.
|
37
|
-
check_file_content('config/initializers/browsercms.rb', 'Cms.table_prefix = "cms_"', true)
|
38
|
-
check_file_content('config/routes.rb', 'mount_browsercms', true)
|
39
|
-
verify_seed_data_requires_browsercms_seeds
|
40
|
-
end
|
41
|
-
|
42
|
-
Then /^a demo project named "([^"]*)" should be created$/ do |project|
|
43
|
-
check_directory_presence [project], true
|
44
|
-
cd project
|
45
|
-
expected_files = %W{
|
46
|
-
public/themes/blue_steel/images/logo.jpg
|
47
|
-
public/themes/blue_steel/images/splash.jpg
|
48
|
-
public/themes/blue_steel/stylesheets/style.css
|
49
|
-
lib/tasks/demo_site.rake
|
50
|
-
db/demo_site_seeds.rb
|
51
|
-
}
|
52
|
-
check_file_presence expected_files, true
|
53
|
-
end
|
54
|
-
|
55
|
-
Given /^a BrowserCMS project named "([^"]*)" exists$/ do |project_name|
|
56
|
-
|
57
|
-
unless File.exists?("#{@scratch_dir}/#{project_name}")
|
58
|
-
old_dirs = @dirs
|
59
|
-
@dirs = [@scratch_dir]
|
60
|
-
create_bcms_project("petstore")
|
61
|
-
@dirs = old_dirs
|
62
|
-
end
|
63
|
-
from = File.absolute_path("#{@scratch_dir}/#{project_name}")
|
64
|
-
to = File.absolute_path("#{@aruba_dir}/#{project_name}")
|
65
|
-
FileUtils.mkdir_p(@aruba_dir)
|
66
|
-
FileUtils.cp_r(from, to)
|
67
|
-
|
68
|
-
self.project_name = project_name
|
69
|
-
end
|
70
|
-
|
71
|
-
When /^I run `([^`]*)` in the project$/ do |cmd|
|
72
|
-
cd(project_name)
|
73
|
-
run_simple(unescape(cmd), false)
|
74
|
-
cd("..")
|
75
|
-
end
|
76
|
-
|
77
|
-
Then /^a project file named "([^"]*)" should contain "([^"]*)"$/ do |file, partial_content|
|
78
|
-
check_file_content(prefix_project_name_to(file), partial_content, true)
|
79
|
-
end
|
80
|
-
|
81
|
-
Then /^a project file named "([^"]*)" should not contain "([^"]*)"$/ do |file, partial_content|
|
82
|
-
check_file_content(prefix_project_name_to(file), partial_content, false)
|
83
|
-
end
|
84
|
-
|
85
|
-
When /^I cd into the project "([^"]*)"$/ do |project|
|
86
|
-
cd project
|
87
|
-
self.project_name = project
|
88
|
-
end
|
89
|
-
|
90
|
-
When /^a migration named "([^"]*)" should contain:$/ do |file, partial_content|
|
91
|
-
migration = find_migration_with_name(file)
|
92
|
-
check_file_content(migration, partial_content, true)
|
93
|
-
end
|
94
|
-
|
95
|
-
# A table of string values to check
|
96
|
-
When /^a migration named "([^"]*)" should contain the following:$/ do |file, table|
|
97
|
-
migration = find_migration_with_name(file)
|
98
|
-
table.rows.each do |row|
|
99
|
-
check_file_content(migration, row.first, true)
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
Then /^it should seed the BrowserCMS database$/ do
|
104
|
-
assert_partial_output "YOUR CMS username/password is: cmsadmin/cmsadmin", all_output
|
105
|
-
end
|
106
|
-
|
107
|
-
When /^it should seed the demo data$/ do
|
108
|
-
assert_partial_output "Cms::PagePartial(:_header)", all_output
|
109
|
-
# This output is ugly, but it verifies that seed data completely runs
|
110
|
-
end
|
111
|
-
|
112
|
-
When /^the file "([^"]*)" should contain:$/ do |file, partial_content|
|
113
|
-
check_file_content(file, partial_content, true)
|
114
|
-
end
|
115
|
-
|
116
|
-
When /^the correct version of Rails should be added to the Gemfile$/ do
|
117
|
-
check_file_content("#{project_name}/Gemfile", "gem 'rails', '#{Rails::VERSION::STRING}'", true)
|
118
|
-
end
|
119
|
-
|
120
|
-
When /^BrowserCMS should be added the Gemfile$/ do
|
121
|
-
check_file_content("#{project_name}/Gemfile", 'gem "browsercms"', true)
|
122
|
-
end
|
123
|
-
|
124
|
-
Then /^Gemfile should have the correct version of BrowserCMS$/ do
|
125
|
-
check_file_content("Gemfile", %!gem "browsercms", "#{Cms::VERSION}"!, true)
|
126
|
-
end
|
127
|
-
|
128
|
-
When /^the production environment should be configured with reasonable defaults$/ do
|
129
|
-
check_file_content "#{project_name}/config/environments/production.rb", "config.assets.compile = true", true
|
130
|
-
end
|
131
|
-
|
132
|
-
When /^it should comment out Rails in the Gemfile$/ do
|
133
|
-
check_file_content("Gemfile", "# gem 'rails', '3.1.3'", true)
|
134
|
-
end
|
135
|
-
|
136
|
-
When /^it should run bundle install$/ do
|
137
|
-
assert_partial_output "Your bundle is complete!", all_output
|
138
|
-
end
|
139
|
-
|
140
|
-
When /^it should copy all the migrations into the project$/ do
|
141
|
-
expected_outputs = %w{
|
142
|
-
rake cms:install:migrations
|
143
|
-
Copied migration
|
144
|
-
browsercms300.rb from cms
|
145
|
-
browsercms305.rb from cms
|
146
|
-
browsercms330.rb from cms
|
147
|
-
browsercms340.rb from cms
|
148
|
-
}
|
149
|
-
expected_outputs.each do |expect|
|
150
|
-
assert_partial_output expect, all_output
|
151
|
-
end
|
152
|
-
end
|
153
|
-
|
154
|
-
When /^it should add the seed data to the project$/ do
|
155
|
-
check_file_presence ["db/browsercms.seeds.rb"], true
|
156
|
-
verify_seed_data_requires_browsercms_seeds
|
157
|
-
end
|
158
|
-
|
159
|
-
When /^it should display instructions to the user$/ do
|
160
|
-
expected = %w{
|
161
|
-
Next Steps:
|
162
|
-
Review https://github.com/browsermedia/browsercms/wiki/Upgrading-to-3.4.x-from-3.3.x
|
163
|
-
}
|
164
|
-
expected.each do |expect|
|
165
|
-
assert_partial_output expect, all_output
|
166
|
-
end
|
167
|
-
end
|
168
|
-
|
169
|
-
Given /^the project has a "([^"]*)" block(| which hasn't ever been migrated)$/ do |block_name, been_migrated|
|
170
|
-
# Generate a 3.3.x block and migration (Done here so as to EXACTLY preserve how block datastructure existed in this version)
|
171
|
-
block_content = <<RUBY
|
172
|
-
class #{block_name.capitalize} < ActiveRecord::Base
|
173
|
-
acts_as_content_block
|
174
|
-
end
|
175
|
-
RUBY
|
176
|
-
write_file "app/models/#{block_name}.rb", block_content
|
177
|
-
|
178
|
-
|
179
|
-
been_migrated_line = (been_migrated == "" ? "rename_column :#{block_name}_versions, :original_record_id, :#{block_name}_id" : "")
|
180
|
-
content = <<RUBY
|
181
|
-
class Create#{block_name.capitalize}s < ActiveRecord::Migration
|
182
|
-
def change
|
183
|
-
create_content_table :#{block_name}s, :prefix=>false do |t|
|
184
|
-
t.timestamps
|
185
|
-
end
|
186
|
-
#{been_migrated_line}
|
187
|
-
end
|
188
|
-
end
|
189
|
-
RUBY
|
190
|
-
write_file "db/migrate/001_create_#{block_name}s.rb", content
|
191
|
-
end
|
192
|
-
|
193
|
-
Then /^I should have a migration for updating the "([^"]*)" versions table$/ do |block_name|
|
194
|
-
migration = find_migration_with_name "update_version_id_columns.rb"
|
195
|
-
check_file_content migration, "models = %w{#{block_name}}", true
|
196
|
-
check_file_content migration, "require 'cms/upgrades/v3_4_0'", true
|
197
|
-
end
|
198
|
-
|
199
|
-
When /^the project has a "([^"]*)" model$/ do |model_name|
|
200
|
-
run "rails g model #{model_name}"
|
201
|
-
end
|
202
|
-
|
203
|
-
Then /^the migration (should|should not) update the version table for "([^"]*)" block$/ do |should, block|
|
204
|
-
did_migration = %!rename_column("#{block}_versions", "#{block}_id", :original_record_id)!
|
205
|
-
|
206
|
-
assert_partial_output "UpdateVersionIdColumns: migrated", all_output
|
207
|
-
if should == "should"
|
208
|
-
assert_partial_output did_migration, all_output
|
209
|
-
else
|
210
|
-
assert_no_partial_output did_migration, all_output
|
211
|
-
end
|
212
|
-
end
|
@@ -1,170 +0,0 @@
|
|
1
|
-
module PageDiagnosticSteps
|
2
|
-
def should_see_a_page_titled(page_title)
|
3
|
-
assert page.has_css?("title", :text => page_title), "Expected a page with a title '#{page_title}'."
|
4
|
-
assert page.has_content?(page_title)
|
5
|
-
end
|
6
|
-
end
|
7
|
-
World(PageDiagnosticSteps)
|
8
|
-
|
9
|
-
# ex: Then I should see a page titled "Home"
|
10
|
-
Then /^I should see a page titled "([^"]*)"$/ do |page_title|
|
11
|
-
should_see_a_page_titled(page_title)
|
12
|
-
end
|
13
|
-
|
14
|
-
When /^the page header should be "([^"]*)"$/ do |h1|
|
15
|
-
assert page.has_css?("h1", :text => h1), "Expected to see <h1>#{h1}</h1> on the page."
|
16
|
-
end
|
17
|
-
|
18
|
-
When /^I am not logged in$/ do
|
19
|
-
visit '/cms/logout'
|
20
|
-
end
|
21
|
-
|
22
|
-
Given /^I am logged in as a Content Editor$/ do
|
23
|
-
visit '/cms'
|
24
|
-
fill_in 'login', :with => 'cmsadmin'
|
25
|
-
fill_in 'password', :with => 'cmsadmin'
|
26
|
-
click_button 'LOGIN'
|
27
|
-
end
|
28
|
-
|
29
|
-
Given /^there is a LoginPortlet on the homepage$/ do
|
30
|
-
cms_page = Cms::Page.with_path("/").first
|
31
|
-
portlet = LoginPortlet.create!(:name => "Login Portlet")
|
32
|
-
cms_page.add_content(portlet, :main)
|
33
|
-
cms_page.publish!
|
34
|
-
end
|
35
|
-
|
36
|
-
|
37
|
-
Then /^the homepage should exist$/ do
|
38
|
-
cms_page = Cms::Page.with_path("/").first
|
39
|
-
assert_not_nil cms_page
|
40
|
-
end
|
41
|
-
|
42
|
-
Then /^I should see Welcome, cmsadmin$/ do
|
43
|
-
assert page.has_content? 'Welcome, cmsadmin'
|
44
|
-
end
|
45
|
-
|
46
|
-
# Duplicates 'I request /path'
|
47
|
-
Given /^I am at (.+)/ do |path|
|
48
|
-
visit path
|
49
|
-
end
|
50
|
-
|
51
|
-
Then /^the response should be (.*)$/ do |response_code|
|
52
|
-
assert_equal response_code.to_i, page.status_code
|
53
|
-
end
|
54
|
-
|
55
|
-
When /^login as an authorized user$/ do
|
56
|
-
visit "/cms/login"
|
57
|
-
fill_in 'login', :with => "privileged"
|
58
|
-
fill_in 'password', :with => "password"
|
59
|
-
click_button 'LOGIN'
|
60
|
-
end
|
61
|
-
When /^I click the Select Existing Content button$/ do
|
62
|
-
container = "main"
|
63
|
-
click_link "insert_existing_content_#{container}"
|
64
|
-
end
|
65
|
-
|
66
|
-
When /^I turn on edit mode for (.*)$/ do |path|
|
67
|
-
goto = path + "?mode=edit"
|
68
|
-
visit(goto)
|
69
|
-
end
|
70
|
-
|
71
|
-
When /^I add new content to the page$/ do
|
72
|
-
container = "main"
|
73
|
-
click_link "Add new content to this container (#{container})"
|
74
|
-
end
|
75
|
-
Then /^I should see a list of selectable content types$/ do
|
76
|
-
pending
|
77
|
-
end
|
78
|
-
|
79
|
-
When /^I click on "([^"]*)"$/ do |name|
|
80
|
-
click_on name
|
81
|
-
end
|
82
|
-
|
83
|
-
When /^I am a guest$/ do
|
84
|
-
visit '/cms/logout'
|
85
|
-
end
|
86
|
-
|
87
|
-
|
88
|
-
module PageNotFoundSteps
|
89
|
-
def should_see_cms_404_page
|
90
|
-
should_see_a_page_titled "Page Not Found"
|
91
|
-
assert_equal 404, page.status_code
|
92
|
-
assert page.has_content?("Page Not Found")
|
93
|
-
end
|
94
|
-
end
|
95
|
-
World(PageNotFoundSteps)
|
96
|
-
|
97
|
-
Given /^there is a homepage$/ do
|
98
|
-
page = Page.with_path("/").first
|
99
|
-
if page
|
100
|
-
@homepage = page
|
101
|
-
else
|
102
|
-
@homepage = Factory(:public_page, :path => "/", :name => "Home Page")
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
Then /^I should see the CMS 404 page$/ do
|
107
|
-
should_see_cms_404_page
|
108
|
-
end
|
109
|
-
|
110
|
-
Given /^an archived page at "([^"]*)" exists$/ do |path|
|
111
|
-
page = Factory(:page, :archived => true, :path => path)
|
112
|
-
assert page.archived?
|
113
|
-
end
|
114
|
-
|
115
|
-
module ProtectedContentSteps
|
116
|
-
def create_protected_user_section_group
|
117
|
-
@protected_section = Factory(:section, :parent => root_section)
|
118
|
-
@secret_group = Factory(:group, :name => "Secret")
|
119
|
-
@secret_group.sections << @protected_section
|
120
|
-
@privileged_user = Factory(:user, :login => "privileged")
|
121
|
-
@privileged_user.groups << @secret_group
|
122
|
-
end
|
123
|
-
|
124
|
-
def create_protected_page(path="/secret")
|
125
|
-
create_protected_user_section_group
|
126
|
-
@page = Factory(:page,
|
127
|
-
:section => @protected_section,
|
128
|
-
:path => path,
|
129
|
-
:name => "Shhh... It's a Secret",
|
130
|
-
:template_file_name => "default.html.erb",
|
131
|
-
:publish_on_save => true)
|
132
|
-
end
|
133
|
-
|
134
|
-
end
|
135
|
-
World(ProtectedContentSteps)
|
136
|
-
|
137
|
-
Given /^a protected page at "([^"]*)" exists$/ do |path|
|
138
|
-
create_protected_page(path)
|
139
|
-
end
|
140
|
-
|
141
|
-
Then /^I should see the CMS :forbidden page$/ do
|
142
|
-
assert_equal 403, page.status_code
|
143
|
-
should_see_a_page_titled("Access Denied")
|
144
|
-
end
|
145
|
-
|
146
|
-
Given /^I am adding a page to the root section$/ do
|
147
|
-
section = Cms::Section.root.first
|
148
|
-
visit "/cms/sections/#{section.id}/pages/new"
|
149
|
-
end
|
150
|
-
When /^I am adding a link on the sitemap$/ do
|
151
|
-
section = Cms::Section.root.first
|
152
|
-
visit "/cms/sections/#{section.id}/links/new"
|
153
|
-
end
|
154
|
-
When /^I edit that link$/ do
|
155
|
-
link = Cms::Link.first
|
156
|
-
visit "/cms/links/#{link.id}/edit"
|
157
|
-
end
|
158
|
-
|
159
|
-
Given /^the following link exists:$/ do |table|
|
160
|
-
table.hashes.each do |row|
|
161
|
-
section = Cms::Section.with_path(row.delete('section')).first
|
162
|
-
row['section_id'] = section.id
|
163
|
-
Factory(:link, row)
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
When /^I change the link name to "([^"]*)"$/ do |new_name|
|
168
|
-
fill_in "Name", :with=>new_name
|
169
|
-
click_on "Save And Publish"
|
170
|
-
end
|