atrium 0.0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +9 -1
- data/.rspec +2 -0
- data/.rvmrc +1 -1
- data/CONTRIBUTING.md +73 -0
- data/Gemfile +27 -2
- data/Gemfile.lock +122 -246
- data/Guardfile +40 -10
- data/LICENSE +14 -0
- data/README.mkd +23 -39
- data/ROADMAP.mkd +41 -9
- data/Rakefile +39 -4
- data/app/assets/images/atrium/remove.png +0 -0
- data/app/assets/images/atrium/white-arrow.png +0 -0
- data/app/assets/javascripts/{atrium/atrium.js → atrium.js} +8 -153
- data/app/assets/stylesheets/{atrium/atrium.css → atrium.css} +110 -37
- data/app/assets/stylesheets/atrium/collections.css +4 -0
- data/app/assets/stylesheets/atrium/descriptions.css +4 -0
- data/app/assets/stylesheets/atrium/exhibits.css +4 -0
- data/app/assets/stylesheets/atrium/reset.css +69 -0
- data/app/assets/stylesheets/atrium/showcases.css +4 -0
- data/app/assets/stylesheets/atrium/theme.css +248 -0
- data/app/controllers/atrium/application_controller.rb +12 -0
- data/app/controllers/atrium/browse_levels_controller.rb +22 -0
- data/app/controllers/atrium/collections_controller.rb +42 -138
- data/app/controllers/atrium/descriptions_controller.rb +27 -146
- data/app/controllers/atrium/exhibits_controller.rb +51 -77
- data/app/controllers/atrium/order_controller.rb +74 -0
- data/app/controllers/atrium/showcases_controller.rb +96 -117
- data/app/helpers/atrium/application_helper.rb +8 -0
- data/app/helpers/atrium/collections_helper.rb +44 -0
- data/app/helpers/atrium/descriptions_helper.rb +4 -0
- data/app/helpers/atrium/exhibits_helper.rb +4 -0
- data/app/helpers/atrium/showcases_helper.rb +34 -0
- data/app/models/atrium/browse_level.rb +21 -11
- data/app/models/atrium/collection.rb +70 -36
- data/app/models/atrium/configuration.rb +66 -0
- data/app/models/atrium/description.rb +39 -88
- data/app/models/atrium/essay.rb +4 -5
- data/app/models/atrium/exhibit.rb +28 -19
- data/app/models/atrium/is_showcased_mixin.rb +34 -0
- data/app/models/atrium/query_param_mixin.rb +105 -0
- data/app/models/atrium/search/facet.rb +14 -25
- data/app/models/atrium/search/facet_selection.rb +10 -12
- data/app/models/atrium/showcase.rb +105 -95
- data/app/models/atrium/showcase/facet_selection.rb +18 -18
- data/app/models/atrium/showcase/featured_selection.rb +15 -0
- data/app/services/browse_level_evaluation_service.rb +131 -0
- data/app/services/current_filter_query_params_extraction_service.rb +91 -0
- data/app/services/navigation_tree.rb +13 -0
- data/app/services/params_adaptor_for_filter.rb +18 -0
- data/app/views/atrium/collections/_form.html.erb +149 -72
- data/app/views/atrium/collections/_head.html.erb +3 -0
- data/app/views/atrium/collections/edit.html.erb +1 -4
- data/app/views/atrium/collections/index.html.erb +14 -0
- data/app/views/atrium/collections/new.html.erb +2 -5
- data/app/views/atrium/collections/show.html.erb +11 -29
- data/app/views/atrium/descriptions/_form.html.erb +47 -49
- data/app/views/atrium/descriptions/edit.html.erb +1 -2
- data/app/views/atrium/descriptions/index.html.erb +2 -8
- data/app/views/atrium/descriptions/new.html.erb +2 -1
- data/app/views/atrium/descriptions/show.html.erb +2 -20
- data/app/views/atrium/exhibits/_exhibit.html.erb +1 -0
- data/app/views/atrium/exhibits/_form.html.erb +143 -96
- data/app/views/atrium/exhibits/edit.html.erb +1 -8
- data/app/views/atrium/exhibits/index.html.erb +2 -0
- data/app/views/atrium/exhibits/new.html.erb +0 -5
- data/app/views/atrium/exhibits/show.html.erb +2 -34
- data/app/views/atrium/showcases/_configure_menu.html.erb +55 -0
- data/app/views/atrium/showcases/_form.html.erb +40 -0
- data/app/views/atrium/showcases/edit.html.erb +3 -0
- data/app/views/atrium/showcases/index.html.erb +32 -0
- data/app/views/atrium/showcases/new.html.erb +3 -0
- data/app/views/atrium/showcases/show.html.erb +2 -1
- data/app/views/layouts/atrium.html.erb +16 -24
- data/app/views/layouts/atrium/application.html.erb +49 -0
- data/app/views/layouts/atrium/themes/default.html.erb +15 -0
- data/app/views/shared/_list_searchs.html.erb +4 -0
- data/app/views/shared/_navigation.html.erb +19 -0
- data/atrium.gemspec +31 -64
- data/config/routes.rb +40 -10
- data/{lib/generators/atrium/templates/migrations/create_atrium_collections.rb → db/migrate/20120730170406_create_atrium_collections.rb} +2 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_showcases.rb → db/migrate/20120731134846_create_atrium_showcases.rb} +3 -4
- data/{lib/generators/atrium/templates/migrations/create_atrium_exhibits.rb → db/migrate/20120731134856_create_atrium_exhibits.rb} +2 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_descriptions.rb → db/migrate/20120731134904_create_atrium_descriptions.rb} +2 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_essays.rb → db/migrate/20120731135534_create_atrium_essays.rb} +3 -2
- data/{lib/generators/atrium/templates/migrations/create_atrium_search_facets.rb → db/migrate/20120731135721_create_atrium_search_facets.rb} +1 -1
- data/{lib/generators/atrium/templates/migrations/create_atrium_showcase_facet_selections.rb → db/migrate/20120731140621_create_atrium_showcase_facet_selections.rb} +6 -2
- data/{lib/generators/atrium/templates/migrations/create_atrium_browse_levels.rb → db/migrate/20120801145241_create_atrium_browse_levels.rb} +1 -1
- data/db/migrate/20120820183808_create_selected_items.rb +16 -0
- data/db/migrate/20120823135716_update_atrium_collection_indices.rb +13 -0
- data/db/migrate/20120823143315_add_lookup_indices_as_required.rb +11 -0
- data/lib/atrium.rb +40 -36
- data/lib/atrium/engine.rb +4 -8
- data/lib/atrium/exceptions.rb +10 -0
- data/lib/atrium/version.rb +2 -2
- data/lib/generators/atrium/install/USAGE +8 -0
- data/lib/generators/atrium/install/install_generator.rb +86 -0
- data/lib/generators/atrium/install/templates/atrium_initializer.rb +21 -0
- data/lib/generators/atrium/install/templates/controllers/atrium_base_controller.rb +18 -0
- data/lib/generators/atrium/install/templates/controllers/collections_controller.rb +40 -0
- data/lib/generators/atrium/install/templates/controllers/descriptions_controller.rb +36 -0
- data/lib/generators/atrium/install/templates/controllers/exhibits_controller.rb +47 -0
- data/lib/generators/atrium/install/templates/controllers/selected_items_controller.rb +26 -0
- data/lib/generators/atrium/install/templates/helpers/application_helper.rb +42 -0
- data/lib/generators/atrium/install/templates/helpers/collections_helper.rb +15 -0
- data/lib/generators/atrium/install/templates/helpers/navigation_helper.rb +62 -0
- data/lib/generators/atrium/install/templates/helpers/solr_helper.rb +138 -0
- data/lib/generators/atrium/install/templates/models/selected_item.rb +7 -0
- data/lib/generators/atrium/install/templates/views/collections/_document.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/collections/_exhibits.html.erb +3 -0
- data/lib/generators/atrium/install/templates/views/collections/_pagination.html.erb +6 -0
- data/lib/generators/atrium/install/templates/views/collections/browse.html.erb +16 -0
- data/lib/generators/atrium/install/templates/views/collections/show.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/descriptions/show.html.erb +8 -0
- data/lib/generators/atrium/install/templates/views/exhibits/_document.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/exhibits/_pagination.html.erb +6 -0
- data/lib/generators/atrium/install/templates/views/exhibits/show.html.erb +28 -0
- data/lib/generators/atrium/install/templates/views/folder/_selected_items_form.html.erb +8 -0
- data/lib/generators/atrium/install/templates/views/folder/index.html.erb +45 -0
- data/lib/generators/atrium/install/templates/views/shared/_document_list.html.erb +14 -0
- data/lib/generators/atrium/install/templates/views/shared/_featured_sources.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/shared/_list_descriptions.html.erb +25 -0
- data/lib/generators/atrium/install/templates/views/shared/_masthead.html.erb +19 -0
- data/lib/generators/atrium/install/templates/views/shared/_navigation_browse_level.html.erb +34 -0
- data/lib/generators/atrium/install/templates/views/shared/_showcases.html.erb +12 -0
- data/lib/generators/atrium/install/templates/views/shared/_side_bar_navigation.html.erb +20 -0
- data/lib/generators/atrium/service/USAGE +9 -0
- data/lib/generators/atrium/service/service_generator.rb +16 -0
- data/lib/generators/atrium/service/templates/service.rb.erb +2 -0
- data/lib/generators/atrium/service/templates/service_spec.rb.erb +4 -0
- data/lib/generators/atrium/theme/USAGE +8 -0
- data/lib/generators/atrium/theme/templates/theme.html.erb +14 -0
- data/lib/generators/atrium/theme/theme_generator.rb +11 -0
- data/lib/tasks/atrium_tasks.rake +4 -0
- data/script/rails +10 -0
- data/spec/atrium_spec.rb +10 -0
- data/spec/controllers/atrium/application_controller_spec.rb +7 -0
- data/spec/controllers/atrium/collections_controller_spec.rb +125 -0
- data/spec/controllers/atrium/descriptions_controller_spec.rb +142 -0
- data/spec/controllers/atrium/exhibits_controller_spec.rb +102 -0
- data/spec/controllers/atrium/order_controller_spec.rb +100 -0
- data/spec/controllers/atrium/showcases_controller_spec.rb +217 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/models/collection.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +59 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/db/schema.rb +124 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/test/fixtures/collections.yml +11 -0
- data/spec/dummy/test/unit/collection_test.rb +7 -0
- data/spec/factories/atrium_collections.rb +8 -0
- data/spec/factories/atrium_exhibits.rb +9 -0
- data/spec/factories/atrium_search_facets.rb +8 -0
- data/spec/factories/atrium_showcases.rb +25 -0
- data/spec/helpers/atrium/collections_helper_spec.rb +57 -0
- data/spec/helpers/atrium/showcases_helper_spec.rb +56 -0
- data/spec/models/atrium/browse_level_spec.rb +56 -0
- data/spec/models/atrium/collection_spec.rb +76 -0
- data/spec/models/atrium/configuration_spec.rb +114 -0
- data/spec/models/atrium/description_spec.rb +56 -0
- data/spec/models/atrium/essay_spec.rb +16 -0
- data/spec/models/atrium/exhibit_spec.rb +90 -0
- data/spec/models/atrium/search/facet_selection_spec.rb +23 -0
- data/{test_support/spec → spec}/models/atrium/search/facet_spec.rb +2 -4
- data/{test_support/spec → spec}/models/atrium/showcase/facet_selection_spec.rb +5 -5
- data/spec/models/atrium/showcase/featured_selection_spec.rb +18 -0
- data/spec/models/atrium/showcase_spec.rb +97 -0
- data/spec/services/browse_level_evaluation_service_spec.rb +33 -0
- data/spec/services/current_filter_query_params_extraction_service_spec.rb +34 -0
- data/spec/services/navigation_tree_spec.rb +18 -0
- data/spec/services/params_adaptor_for_filter_spec.rb +8 -0
- data/spec/spec_helper.rb +39 -0
- data/spec/support/accept_nested_attributes_for.rb +39 -0
- data/{test_support/spec → spec}/support/be_accessible_matcher.rb +0 -0
- data/{test_support/spec → spec}/support/be_routed_mixin.rb +0 -0
- data/spec/support/controller_hacks.rb +35 -0
- data/spec/support/routes.rb +5 -0
- data/spec/support/shared_examples/is_showcased_mixin.rb +20 -0
- data/spec/support/shared_examples/query_param_mixin.rb +179 -0
- data/{app/assets/stylesheets/atrium → vendor/assets/images}/chosen-sprite.png +0 -0
- data/{app → vendor}/assets/javascripts/chosen.jquery.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor.warning.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/config.js.coffee +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/jquery.generateId.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/jquery.jeditable.ckeditor.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/application_link.png +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/dialogs/linkItem.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/plugin.js +0 -0
- data/{app → vendor}/assets/javascripts/ckeditor/plugins/linkItem/ui_toolbar_pencil.png +0 -0
- data/vendor/assets/javascripts/jquery-ui-1.8.23.custom.min.js +41 -0
- data/vendor/assets/javascripts/jquery-ui-build.txt +8 -0
- data/{app → vendor}/assets/javascripts/jquery.jeditable.js +0 -0
- data/{app/assets/stylesheets/atrium → vendor/assets/stylesheets}/chosen.css +4 -4
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/vendor/assets/stylesheets/ui-lightness/jquery-ui-1.8.23.custom.css +334 -0
- metadata +431 -949
- data/GETTING_STARTED.textile +0 -102
- data/app/assets/images/atrium/ajax-loader.gif +0 -0
- data/app/assets/images/atrium/lightbox-ico-loading.gif +0 -0
- data/app/assets/images/atrium/logo.png +0 -0
- data/app/assets/javascripts/jquery.colorbox.js +0 -864
- data/app/assets/stylesheets/colorbox.css +0 -42
- data/app/assets/stylesheets/controls.png +0 -0
- data/app/assets/stylesheets/loading.gif +0 -0
- data/app/controllers/atrium/base_controller.rb +0 -25
- data/app/controllers/atrium/collection_exhibit_order_controller.rb +0 -21
- data/app/controllers/atrium/customization_controller.rb +0 -41
- data/app/controllers/atrium/exhibit_facet_order_controller.rb +0 -19
- data/app/helpers/atrium/base_helper.rb +0 -6
- data/app/models/ability.rb +0 -14
- data/app/models/atrium/showcase/item.rb +0 -19
- data/app/models/role_mapper.rb +0 -23
- data/app/views/_user_util_links.html.erb +0 -25
- data/app/views/atrium/collections/_bookmark_control.html.erb +0 -25
- data/app/views/atrium/collections/_browse_index.html.erb +0 -20
- data/app/views/atrium/collections/_collection_items_index.html.erb +0 -10
- data/app/views/atrium/collections/_document.html.erb +0 -24
- data/app/views/atrium/collections/_document_list.html.erb +0 -6
- data/app/views/atrium/collections/_edit_navigation.html.erb +0 -20
- data/app/views/atrium/collections/_folder_control.html.erb +0 -12
- data/app/views/atrium/collections/_listing.html.erb +0 -18
- data/app/views/atrium/collections/_navigation.html.erb +0 -50
- data/app/views/atrium/collections/_results_pagination.html.erb +0 -9
- data/app/views/atrium/collections/_sort_and_per_page.html.erb +0 -23
- data/app/views/atrium/exhibits/_bookmark_control.html.erb +0 -25
- data/app/views/atrium/exhibits/_folder_control.html.erb +0 -12
- data/app/views/atrium/exhibits/_navigation.html.erb +0 -30
- data/app/views/atrium/showcases/_showcase_navigation.html.erb +0 -23
- data/app/views/catalog/_collection_home_text.html.erb +0 -6
- data/app/views/catalog/_constraints.html.erb +0 -9
- data/app/views/catalog/_default_collection_text.html.erb +0 -18
- data/app/views/catalog/_default_home_text.html.erb +0 -6
- data/app/views/catalog/_home_text.html.erb +0 -6
- data/app/views/catalog/_index_partials/_description.html.erb +0 -8
- data/app/views/catalog/_search_form.html.erb +0 -66
- data/app/views/catalog/_show_partials/_description.html.erb +0 -15
- data/app/views/catalog/browse_show.html.erb +0 -18
- data/app/views/catalog/index.html.erb +0 -41
- data/app/views/catalog/list_description.html.erb +0 -24
- data/app/views/catalog/list_item.html.erb +0 -3
- data/app/views/layouts/atrium_themes/default.html.erb +0 -4
- data/app/views/layouts/item_listing.html.erb +0 -36
- data/app/views/listing/_document.html.erb +0 -27
- data/app/views/listing/_document_list.html.erb +0 -3
- data/app/views/listing/_item_search.html.erb +0 -27
- data/app/views/shared/_banner.html.erb +0 -5
- data/app/views/shared/_collection_complete_list.html.erb +0 -33
- data/app/views/shared/_collection_search_form.html.erb +0 -12
- data/app/views/shared/_collection_title_header.html.erb +0 -3
- data/app/views/shared/_featured_sources.html.erb +0 -23
- data/app/views/shared/_list_descriptions.html.erb +0 -39
- data/app/views/shared/_navigation_browse_levels.html.erb +0 -34
- data/app/views/shared/_showcase_configure_menu.html.erb +0 -22
- data/app/views/shared/_top_navigation.html.erb +0 -9
- data/init.rb +0 -3
- data/lib/application_controller.rb +0 -24
- data/lib/atrium/application_helper.rb +0 -24
- data/lib/atrium/atrium_helper_behavior.rb +0 -159
- data/lib/atrium/catalog.rb +0 -203
- data/lib/atrium/collections_helper.rb +0 -172
- data/lib/atrium/controller.rb +0 -10
- data/lib/atrium/descriptions_helper.rb +0 -27
- data/lib/atrium/layout_helper.rb +0 -13
- data/lib/atrium/routes.rb +0 -100
- data/lib/atrium/solr_helper.rb +0 -440
- data/lib/generators/atrium/assets_generator.rb +0 -44
- data/lib/generators/atrium/atrium_generator.rb +0 -149
- data/lib/generators/atrium/cucumber_support_generator.rb +0 -29
- data/lib/generators/atrium/templates/config/role_map_cucumber.yml +0 -2
- data/lib/generators/atrium/templates/config/role_map_development.yml +0 -2
- data/lib/generators/atrium/templates/config/role_map_production.yml +0 -2
- data/lib/generators/atrium/templates/config/role_map_test.yml +0 -2
- data/lib/generators/atrium/templates/config/solr.yml +0 -10
- data/lib/generators/atrium/templates/db/seeds.rb +0 -87
- data/lib/generators/atrium/templates/migrations/create_atrium_showcase_items.rb +0 -17
- data/lib/generators/atrium/templates/themes/example.html.erb +0 -21
- data/lib/railties/all_tests.rake +0 -23
- data/lib/railties/atrium_cucumber.rake +0 -121
- data/lib/railties/index.rake +0 -37
- data/tasks/atrium.rake +0 -268
- data/tasks/atrium_rspec.rake +0 -91
- data/test_support/etc/Gemfile +0 -33
- data/test_support/etc/bundle_config +0 -3
- data/test_support/etc/rvmrc +0 -32
- data/test_support/features/atrium_collections.feature +0 -162
- data/test_support/features/atrium_exhibits.feature +0 -164
- data/test_support/features/step_definitions/atrium_collection_steps.rb +0 -102
- data/test_support/features/step_definitions/atrium_exhibit_steps.rb +0 -53
- data/test_support/features/step_definitions/bookmarks_steps.rb +0 -6
- data/test_support/features/step_definitions/error_steps.rb +0 -5
- data/test_support/features/step_definitions/folder_steps.rb +0 -27
- data/test_support/features/step_definitions/general_steps.rb +0 -50
- data/test_support/features/step_definitions/record_view_steps.rb +0 -12
- data/test_support/features/step_definitions/saved_searches_steps.rb +0 -22
- data/test_support/features/step_definitions/search_facets_steps.rb +0 -29
- data/test_support/features/step_definitions/search_history_steps.rb +0 -9
- data/test_support/features/step_definitions/search_result_steps.rb +0 -114
- data/test_support/features/step_definitions/search_steps.rb +0 -103
- data/test_support/features/step_definitions/user_steps.rb +0 -5
- data/test_support/features/step_definitions/web_steps.rb +0 -213
- data/test_support/features/support/env.rb +0 -67
- data/test_support/features/support/paths.rb +0 -76
- data/test_support/features/support/selectors.rb +0 -40
- data/test_support/fixtures/atrium_exhibits.yml +0 -3
- data/test_support/spec/controllers/atrium/base_controller_spec.rb +0 -13
- data/test_support/spec/controllers/atrium/collection_exhibit_order_controller_spec.rb +0 -29
- data/test_support/spec/controllers/atrium/collections_controller_spec.rb +0 -185
- data/test_support/spec/controllers/atrium/customization_controller_spec.rb +0 -38
- data/test_support/spec/controllers/atrium/descriptions_controller_spec.rb +0 -150
- data/test_support/spec/controllers/atrium/exhibit_facet_order_controller_spec.rb +0 -36
- data/test_support/spec/controllers/atrium/exhibits_controller_spec.rb +0 -192
- data/test_support/spec/controllers/atrium/showcases_controller_spec.rb +0 -219
- data/test_support/spec/helpers/atrium_collections_helper_spec.rb +0 -147
- data/test_support/spec/helpers/atrium_description_helper_spec.rb +0 -47
- data/test_support/spec/helpers/atrium_solr_helper_spec.rb +0 -522
- data/test_support/spec/models/atrium/browse_level_spec.rb +0 -31
- data/test_support/spec/models/atrium/collection_spec.rb +0 -30
- data/test_support/spec/models/atrium/description_spec.rb +0 -67
- data/test_support/spec/models/atrium/essay_spec.rb +0 -12
- data/test_support/spec/models/atrium/exhibit_spec.rb +0 -76
- data/test_support/spec/models/atrium/search/facet_selection_spec.rb +0 -24
- data/test_support/spec/models/atrium/search_facet_spec.rb +0 -54
- data/test_support/spec/models/atrium/showcase/item_spec.rb +0 -12
- data/test_support/spec/models/atrium/showcase_facet_selection_spec.rb +0 -65
- data/test_support/spec/models/atrium/showcase_spec.rb +0 -134
- data/test_support/spec/rcov.opts +0 -3
- data/test_support/spec/routing/atrium/collections_routing_spec.rb +0 -33
- data/test_support/spec/spec.opts +0 -4
- data/test_support/spec/spec_helper.rb +0 -47
- data/test_support/tmp/step_definitions/catalog_index_steps.rb +0 -14
- data/test_support/tmp/step_definitions/edit_document_steps.rb +0 -67
- data/test_support/tmp/step_definitions/hydra_metadata_steps.rb +0 -3
- data/test_support/tmp/step_definitions/hydra_steps.rb +0 -8
- data/test_support/tmp/step_definitions/search_steps.rb +0 -86
- data/test_support/tmp/step_definitions/searching_steps.rb +0 -22
- data/test_support/tmp/step_definitions/select_steps.rb +0 -8
- data/test_support/tmp/step_definitions/show_document_steps.rb +0 -73
- data/test_support/tmp/step_definitions/user_steps.rb +0 -15
- data/test_support/tmp/step_definitions/web_steps.rb +0 -273
- data/test_support/tmp/support/env.rb +0 -54
- data/test_support/tmp/support/paths.rb +0 -57
@@ -1,27 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
Then /^I should see an add to folder form$/ do
|
3
|
-
page.should have_selector("form.addFolder")
|
4
|
-
end
|
5
|
-
|
6
|
-
Then /^I should see a remove from folder form$/ do
|
7
|
-
page.should have_selector("form.deleteFolder")
|
8
|
-
end
|
9
|
-
|
10
|
-
When /^I (add|remove) record (.+) (to|from) my folder$/ do |add_or_remove, id, wording|
|
11
|
-
click_button("folder_submit_#{id}")
|
12
|
-
end
|
13
|
-
|
14
|
-
Given /^I have record (.+) in my folder$/ do |arg1|
|
15
|
-
visit catalog_path(arg1)
|
16
|
-
click_button("Select")
|
17
|
-
click_link("Selected Items")
|
18
|
-
end
|
19
|
-
|
20
|
-
Then /^I (should|should not) see the Folder tools$/ do |comparator|
|
21
|
-
case comparator
|
22
|
-
when "should"
|
23
|
-
page.should have_selector("ul.folderTools")
|
24
|
-
when "should not"
|
25
|
-
page.should_not have_selector("ul.folderTools")
|
26
|
-
end
|
27
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
When /^I follow "([^\"]*)" in "([^\"]*)"$/ do |link, scope|
|
3
|
-
within(scope) do
|
4
|
-
click_link(link)
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
|
-
Then /^I should see a stylesheet/ do
|
9
|
-
page.should have_selector("link[rel=stylesheet]")
|
10
|
-
end
|
11
|
-
|
12
|
-
Then /I should see "(.*)" (at least|at most|exactly) (.*) times?$/i do |target, comparator, expected_num|
|
13
|
-
actual_num = page.split(target).length - 1
|
14
|
-
case comparator
|
15
|
-
when "at least"
|
16
|
-
actual_num.should >= expected_num.to_i
|
17
|
-
when "at most"
|
18
|
-
actual_num.should <= expected_num.to_i
|
19
|
-
when "exactly"
|
20
|
-
actual_num.should == expected_num.to_i
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
Then /I should see a "(.*)" element with "(.*)" = "(.*)" (at least|at most|exactly) (.*) times?$/i do |target, type, selector,comparator, expected_num|
|
25
|
-
actual_num = page.all("#{target}[#{type}=\"#{selector}\"]").length
|
26
|
-
case comparator
|
27
|
-
when "at least"
|
28
|
-
actual_num.should >= expected_num.to_i
|
29
|
-
when "at most"
|
30
|
-
actual_num.should <= expected_num.to_i
|
31
|
-
when "exactly"
|
32
|
-
actual_num.should == expected_num.to_i
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
Then /^I (should not|should) see an? "([^\"]*)" element with an? "([^\"]*)" attribute of "([^\"]*)"$/ do |bool,elem,attribute,value|
|
37
|
-
if bool == "should not"
|
38
|
-
page.should_not have_selector("#{elem}[#{attribute}=#{value}]")
|
39
|
-
else
|
40
|
-
page.should have_selector("#{elem}[#{attribute}=#{value}]")
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
Then /^I (should not|should) see an? "([^\"]*)" element with an? "([^\"]*)" attribute of "([^\"]*)" and an? "([^\"]*)" attribute of "([^\"]*)"$/ do |bool,elem,attribute,value,attribute2,value2|
|
45
|
-
if bool == "should not"
|
46
|
-
page.should_not have_selector("#{elem}[#{attribute}=#{value}][#{attribute2}=#{value2}]")
|
47
|
-
else
|
48
|
-
page.should have_selector("#{elem}[#{attribute}=#{value}][#{attribute2}=#{value2}]")
|
49
|
-
end
|
50
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
Then /^I (should|should not) see an? "([^\"]*)" element containing "([^\"]*)"$/ do |bool,elem,content|
|
3
|
-
if bool == "should"
|
4
|
-
page.should have_xpath("//#{elem}[text()='#{content}']")
|
5
|
-
else
|
6
|
-
page.should have_no_xpath("//#{elem}[text()='#{content}']")
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
Then /^I should see link rel=alternate tags/ do
|
11
|
-
page.should have_selector("link[rel=alternate]")
|
12
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
Given /^I am logged in as "([^\"]*)"$/ do |login|
|
3
|
-
email = "#{login}@#{login}.com"
|
4
|
-
user = User.create(:login => login, :email => email, :password => "password", :password_confirmation => "password")
|
5
|
-
# visit user_sessions_path(:user_session => {:login => login, :password => "password"}), :post
|
6
|
-
# User.find(user.id).should_not be_nil
|
7
|
-
visit new_user_session_path
|
8
|
-
fill_in("user_email", :with => email)
|
9
|
-
fill_in("user_password", :with => "password")
|
10
|
-
click_button("Sign in")
|
11
|
-
# response.body.should =~ /Logged/m
|
12
|
-
Then 'I should see "Log Out"'
|
13
|
-
end
|
14
|
-
|
15
|
-
Given /^"([^\"]*)" has saved a search with term "([^\"]*)"$/ do |user, term|
|
16
|
-
user = User.find_by_email("#{user}@#{user}.com")
|
17
|
-
user.searches << Search.create(:query_params => {:q => term})
|
18
|
-
user.save!
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
# deprecated
|
3
|
-
Then /^I should see the applied filter "([^\"]*)" with the value "([^\"]*)"$/ do |filter, text|
|
4
|
-
page.should have_selector(".facet_limit") do |node|
|
5
|
-
node.should have_selector("h3", :content => filter)
|
6
|
-
node.should have_selector("span.selected", :content => text)
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
Then /^I should see the applied facet "([^\"]*)" with the value "([^\"]*)"$/ do |filter, text|
|
11
|
-
page.should have_selector(".facet_limit") do |node|
|
12
|
-
node.should have_selector("h3", :content => filter)
|
13
|
-
node.should have_selector("span.selected", :content => text)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
Then /^I should see the facet "([^\"]*)" with the value "([^\"]*)"$/ do |filter, text|
|
18
|
-
page.should have_selector(".facet_limit") do |node|
|
19
|
-
node.should have_selector("h3", :content => filter)
|
20
|
-
node.should have_selector("a.label", :content => text)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
Then /^the facet "([^\"]+)" should display$/ do |filter|
|
25
|
-
page.should have_selector(".facet_limit") do |node|
|
26
|
-
node.should have_selector("h3", :content => filter)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
@@ -1,114 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
#include Blacklight::SolrHelper
|
3
|
-
|
4
|
-
When /^I fill in the search box with "(.*?)"$/ do |query|
|
5
|
-
query.gsub!(/\\"/, '"')
|
6
|
-
fill_in(:q, :with => query)
|
7
|
-
end
|
8
|
-
|
9
|
-
|
10
|
-
Then /^I should get (at least|at most|exactly) (\d+) results?$/i do |comparator, comparison_num|
|
11
|
-
number_of_records = get_number_of_results_from_page(page)
|
12
|
-
|
13
|
-
case comparator
|
14
|
-
when "at least"
|
15
|
-
number_of_records.should >= comparison_num.to_i
|
16
|
-
when "at most"
|
17
|
-
number_of_records.should <= comparison_num.to_i
|
18
|
-
when "exactly"
|
19
|
-
number_of_records.should == comparison_num.to_i
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
|
24
|
-
Then /^I should have (the same number of|fewer|more) results (?:than|as) a(?:n?) search for "(.*)"$/i do |comparator, query|
|
25
|
-
query.gsub!(/\\"/, '"')
|
26
|
-
number_of_records = get_number_of_results_from_page(page)
|
27
|
-
|
28
|
-
case comparator
|
29
|
-
when "the same number of"
|
30
|
-
get_number_of_results_for_query(query).should == number_of_records
|
31
|
-
when "fewer"
|
32
|
-
get_number_of_results_for_query(query).should > number_of_records
|
33
|
-
when "fewer"
|
34
|
-
get_number_of_results_for_query(query).should < number_of_records
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
Then /^I should get id "([^\"]+)" in the results$/i do |id|
|
39
|
-
page.should have_xpath("//a[contains(@href, #{id})]")
|
40
|
-
end
|
41
|
-
|
42
|
-
Then /^I should not get id "([^\"]+)" in the results$/i do |id|
|
43
|
-
page.should_not have_xpath("//a[contains(@href, #{id})]")
|
44
|
-
end
|
45
|
-
|
46
|
-
Then /^I should get id "([^\"]+)" in the first (\d+) results?$/i do |id, max_num|
|
47
|
-
pos = get_position_in_result_page(page, id)
|
48
|
-
pos.should_not == -1
|
49
|
-
pos.should < max_num.to_i
|
50
|
-
end
|
51
|
-
|
52
|
-
Then /^I should not get id "([^\"]+)" in the first (\d+) results?$/i do |id, max_num|
|
53
|
-
pos = get_position_in_result_page(page, id)
|
54
|
-
pos.should_not == -1
|
55
|
-
|
56
|
-
if pos > 0
|
57
|
-
pos.should >= max_num.to_i
|
58
|
-
else
|
59
|
-
pos.should == -1 if pos == -1
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
Then /^I should get id "([^\"]+)" before id "([^\"]+)"$/i do |id1, id2|
|
64
|
-
pos1 = get_position_in_result_page(page, id1)
|
65
|
-
pos2 = get_position_in_result_page(page, id2)
|
66
|
-
pos1.should_not == -1
|
67
|
-
pos2.should_not == -1
|
68
|
-
|
69
|
-
pos1.should < pos2
|
70
|
-
end
|
71
|
-
|
72
|
-
Then /^I should get id "([^\"]+)" and id "([^\"]+)" no more than (\d+) positions? from each other$/i do |id1, id2, limit|
|
73
|
-
|
74
|
-
pos1 = get_position_in_result_page(page, id1)
|
75
|
-
pos2 = get_position_in_result_page(page, id2)
|
76
|
-
pos1.should_not == -1
|
77
|
-
pos2.should_not == -1
|
78
|
-
|
79
|
-
(pos1 - pos2).abs.should <= limit.to_i
|
80
|
-
end
|
81
|
-
|
82
|
-
Then /^I should get at least (\d+) of these ids in the first (\d+) results: "([^\"]+)"$/i do |how_many, limit, id_string|
|
83
|
-
id_string.split(/,/).select do |id|
|
84
|
-
pos = get_position_in_result_page(page, id)
|
85
|
-
pos != -1 and pos < limit.to_i
|
86
|
-
end.length.should >= how_many.to_i
|
87
|
-
end
|
88
|
-
|
89
|
-
Then /^I (should not|should) see an? "([^\"]*)" element with an? "([^\"]*)" attribute of "([^\"]*)"$/ do |bool,elem,attribute,value|
|
90
|
-
if bool == "should not"
|
91
|
-
page.should_not have_selector("#{elem}[#{attribute}=#{value}]")
|
92
|
-
else
|
93
|
-
page.should have_selector("#{elem}[#{attribute}=#{value}]")
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
def get_position_in_result_page(page, id)
|
98
|
-
i = -1
|
99
|
-
page.all(".index_title a").each_with_index do |link, idx|
|
100
|
-
i = (idx+1) if link['href'] =~ Regexp.new(Regexp.escape(id) + "$")
|
101
|
-
end
|
102
|
-
i.to_i
|
103
|
-
end
|
104
|
-
|
105
|
-
def get_number_of_results_for_query(query)
|
106
|
-
visit root_path
|
107
|
-
fill_in "q", :with => query
|
108
|
-
click_button "search"
|
109
|
-
get_number_of_results_from_page(page)
|
110
|
-
end
|
111
|
-
|
112
|
-
def get_number_of_results_from_page(page)
|
113
|
-
page.find("meta[name=totalResults]")['content'].to_i rescue 0
|
114
|
-
end
|
@@ -1,103 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
# User added
|
3
|
-
Then /^I should see a search field$/ do
|
4
|
-
page.should have_selector("input#q")
|
5
|
-
end
|
6
|
-
|
7
|
-
Then /^I should see a selectable list with field choices$/ do
|
8
|
-
page.should have_selector("select#search_field")
|
9
|
-
end
|
10
|
-
|
11
|
-
Then /^I should see a selectable list with per page choices$/ do
|
12
|
-
page.should have_selector("select#per_page")
|
13
|
-
end
|
14
|
-
|
15
|
-
Then /^I should see a "([^\"]*)" button$/ do |label|
|
16
|
-
page.should have_selector("input[type='submit'][value='#{label}']")
|
17
|
-
end
|
18
|
-
|
19
|
-
Then /^I should not see the "([^\"]*)" element$/ do |id|
|
20
|
-
page.should_not have_selector("##{id}")
|
21
|
-
end
|
22
|
-
|
23
|
-
Then /^I should see the "([^\"]*)" element$/ do |id|
|
24
|
-
page.should have_selector("##{id}")
|
25
|
-
end
|
26
|
-
|
27
|
-
Given /^the application is configured to have searchable fields "([^\"]*)" with values "([^\"]*)"$/ do |fields, values|
|
28
|
-
labels = fields.split(", ")
|
29
|
-
values = values.split(", ")
|
30
|
-
combined = labels.zip(values)
|
31
|
-
Blacklight.config[:search_fields] = []
|
32
|
-
combined.each do |pair|
|
33
|
-
Blacklight.config[:search_fields] << pair
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
Then /^I should see select list "([^\"]*)" with field labels "([^\"]*)"$/ do |list_css, names|
|
38
|
-
page.should have_selector(list_css) do
|
39
|
-
labels = names.split(", ")
|
40
|
-
labels.each do |label|
|
41
|
-
with_tag('option', label)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
Then /^I should see select list "([^\"]*)" with "([^\"]*)" selected$/ do |list_css, label|
|
47
|
-
page.should have_selector(list_css) do |e|
|
48
|
-
with_tag("[selected=selected]", {:count => 1}) do
|
49
|
-
with_tag("option", {:count => 1, :text => label})
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
# Results Page
|
55
|
-
Given /^the application is configured to have sort fields "([^\"]*)" with values "([^\"]*)"$/ do |fields, values|
|
56
|
-
labels = fields.split(", ")
|
57
|
-
values = values.split(", ")
|
58
|
-
combined = labels.zip(values)
|
59
|
-
Blacklight.config[:sort_fields] = []
|
60
|
-
combined.each do |pair|
|
61
|
-
Blacklight.config[:sort_fields] << pair
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
Then /^I should get results$/ do
|
66
|
-
page.should have_selector("div.document")
|
67
|
-
end
|
68
|
-
|
69
|
-
Then /^I should not get results$/ do
|
70
|
-
page.should_not have_selector("div.document")
|
71
|
-
end
|
72
|
-
|
73
|
-
Then /^I should see the applied filter "([^\"]*)" with the value "([^\"]*)"$/ do |filter, text|
|
74
|
-
page.should have_selector("div#facets div h3", :content => filter)
|
75
|
-
page.should have_selector("div#facets div span.selected", :content => text)
|
76
|
-
end
|
77
|
-
|
78
|
-
Then /^I should see an rss discovery link/ do
|
79
|
-
page.should have_selector("link[rel=alternate][type='application/rss+xml']")
|
80
|
-
end
|
81
|
-
|
82
|
-
Then /^I should see an atom discovery link/ do
|
83
|
-
page.should have_selector("link[rel=alternate][type='application/atom+xml']")
|
84
|
-
end
|
85
|
-
|
86
|
-
Then /^I should see an unAPI discovery link/ do
|
87
|
-
page.should have_selector("link[rel=unapi-server][type='application/xml']")
|
88
|
-
end
|
89
|
-
|
90
|
-
Then /^I should see opensearch response metadata tags/ do
|
91
|
-
page.should have_selector("meta[name=totalResults]")
|
92
|
-
page.should have_selector("meta[name=startIndex]")
|
93
|
-
page.should have_selector("meta[name=itemsPerPage]")
|
94
|
-
end
|
95
|
-
|
96
|
-
# Then /^I should see the applied filter "([^\"]*)" with the value
|
97
|
-
# "([^\"]*)"$/ do |filter, text|
|
98
|
-
# page.should have_tag("div#facets div") do |node|
|
99
|
-
# node.should have_selector("h3", :content => filter)
|
100
|
-
# node.should have_selector("span.selected", :content => /#{text}.*/)
|
101
|
-
# end
|
102
|
-
# end
|
103
|
-
|
@@ -1,5 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
Given /^user with login "([^\"]*)" and email "([^\"]*)" and password "([^\"]*)"$/ do |login, email, password|
|
3
|
-
user = User.create(:login => login, :email => email, :password => password, :password_confirmation => password)
|
4
|
-
User.find(user.id).should_not be_nil
|
5
|
-
end
|
@@ -1,213 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
# TL;DR: YOU SHOULD DELETE THIS FILE
|
3
|
-
#
|
4
|
-
# This file iwas generated by Cucumber-Rails and is only here to get you a head start
|
5
|
-
# These step definitions are thin wrappers around the Capybara/Webrat API that lets you
|
6
|
-
# visit pages, interact with widgets and make assertions about page content.
|
7
|
-
#
|
8
|
-
# If you use these step definitions as basis for your features you will quickly end up
|
9
|
-
# with features that are:
|
10
|
-
#
|
11
|
-
# * Hard to maintain
|
12
|
-
# * Verbose to read
|
13
|
-
#
|
14
|
-
# A much better approach is to write your own higher level step definitions, following
|
15
|
-
# the advice in the following blog posts:
|
16
|
-
#
|
17
|
-
# * http://benmabey.com/2008/05/19/imperative-vs-declarative-scenarios-in-user-stories.html
|
18
|
-
# * http://dannorth.net/2011/01/31/whose-domain-is-it-anyway/
|
19
|
-
# * http://elabs.se/blog/15-you-re-cuking-it-wrong
|
20
|
-
#
|
21
|
-
|
22
|
-
|
23
|
-
require 'uri'
|
24
|
-
require 'cgi'
|
25
|
-
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
26
|
-
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "selectors"))
|
27
|
-
|
28
|
-
module WithinHelpers
|
29
|
-
def with_scope(locator)
|
30
|
-
locator ? within(*selector_for(locator)) { yield } : yield
|
31
|
-
end
|
32
|
-
end
|
33
|
-
World(WithinHelpers)
|
34
|
-
|
35
|
-
# Single-line step scoper
|
36
|
-
When /^(.*) within ([^:]+)$/ do |step, parent|
|
37
|
-
with_scope(parent) { When step }
|
38
|
-
end
|
39
|
-
|
40
|
-
# Multi-line step scoper
|
41
|
-
When /^(.*) within ([^:]+):$/ do |step, parent, table_or_string|
|
42
|
-
with_scope(parent) { When "#{step}:", table_or_string }
|
43
|
-
end
|
44
|
-
|
45
|
-
Given /^(?:|I )am on (.+)$/ do |page_name|
|
46
|
-
visit path_to(page_name)
|
47
|
-
end
|
48
|
-
|
49
|
-
When /^(?:|I )go to (.+)$/ do |page_name|
|
50
|
-
visit path_to(page_name)
|
51
|
-
end
|
52
|
-
|
53
|
-
When /^(?:|I )press "([^"]*)"$/ do |button|
|
54
|
-
#save_and_open_page
|
55
|
-
click_button(button)
|
56
|
-
end
|
57
|
-
|
58
|
-
When /^(?:|I )follow "([^"]*)"$/ do |link|
|
59
|
-
click_link(link)
|
60
|
-
end
|
61
|
-
|
62
|
-
When /^(?:|I )fill in "([^"]*)" with "([^"]*)"$/ do |field, value|
|
63
|
-
fill_in(field, :with => value)
|
64
|
-
end
|
65
|
-
|
66
|
-
When /^(?:|I )fill in "([^"]*)" for "([^"]*)"$/ do |value, field|
|
67
|
-
fill_in(field, :with => value)
|
68
|
-
end
|
69
|
-
|
70
|
-
# Use this to fill in an entire form with data from a table. Example:
|
71
|
-
#
|
72
|
-
# When I fill in the following:
|
73
|
-
# | Account Number | 5002 |
|
74
|
-
# | Expiry date | 2009-11-01 |
|
75
|
-
# | Note | Nice guy |
|
76
|
-
# | Wants Email? | |
|
77
|
-
#
|
78
|
-
# TODO: Add support for checkbox, select og option
|
79
|
-
# based on naming conventions.
|
80
|
-
#
|
81
|
-
When /^(?:|I )fill in the following:$/ do |fields|
|
82
|
-
fields.rows_hash.each do |name, value|
|
83
|
-
When %{I fill in "#{name}" with "#{value}"}
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
When /^(?:|I )select "([^"]*)" from "([^"]*)"$/ do |value, field|
|
88
|
-
select(value, :from => field)
|
89
|
-
end
|
90
|
-
|
91
|
-
When /^(?:|I )check "([^"]*)"$/ do |field|
|
92
|
-
check(field)
|
93
|
-
end
|
94
|
-
|
95
|
-
When /^(?:|I )uncheck "([^"]*)"$/ do |field|
|
96
|
-
uncheck(field)
|
97
|
-
end
|
98
|
-
|
99
|
-
When /^(?:|I )choose "([^"]*)"$/ do |field|
|
100
|
-
choose(field)
|
101
|
-
end
|
102
|
-
|
103
|
-
When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"$/ do |path, field|
|
104
|
-
attach_file(field, File.expand_path(path))
|
105
|
-
end
|
106
|
-
|
107
|
-
Then /^(?:|I )should see "([^"]*)"$/ do |text|
|
108
|
-
if page.respond_to? :should
|
109
|
-
page.should have_content(text)
|
110
|
-
else
|
111
|
-
assert page.has_content?(text)
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
Then /^(?:|I )should see \/([^\/]*)\/$/ do |regexp|
|
116
|
-
regexp = Regexp.new(regexp)
|
117
|
-
|
118
|
-
if page.respond_to? :should
|
119
|
-
page.should have_xpath('//*', :text => regexp)
|
120
|
-
else
|
121
|
-
assert page.has_xpath?('//*', :text => regexp)
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
|
-
Then /^(?:|I )should not see "([^"]*)"$/ do |text|
|
126
|
-
if page.respond_to? :should
|
127
|
-
page.should have_no_content(text)
|
128
|
-
else
|
129
|
-
assert page.has_no_content?(text)
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
Then /^(?:|I )should not see \/([^\/]*)\/$/ do |regexp|
|
134
|
-
regexp = Regexp.new(regexp)
|
135
|
-
|
136
|
-
if page.respond_to? :should
|
137
|
-
page.should have_no_xpath('//*', :text => regexp)
|
138
|
-
else
|
139
|
-
assert page.has_no_xpath?('//*', :text => regexp)
|
140
|
-
end
|
141
|
-
end
|
142
|
-
|
143
|
-
Then /^the "([^"]*)" field(?: within (.*))? should contain "([^"]*)"$/ do |field, parent, value|
|
144
|
-
with_scope(parent) do
|
145
|
-
field = find_field(field)
|
146
|
-
field_value = (field.tag_name == 'textarea') ? field.text : field.value
|
147
|
-
if field_value.respond_to? :should
|
148
|
-
field_value.should =~ /#{value}/
|
149
|
-
else
|
150
|
-
assert_match(/#{value}/, field_value)
|
151
|
-
end
|
152
|
-
end
|
153
|
-
end
|
154
|
-
|
155
|
-
Then /^the "([^"]*)" field(?: within (.*))? should not contain "([^"]*)"$/ do |field, parent, value|
|
156
|
-
with_scope(parent) do
|
157
|
-
field = find_field(field)
|
158
|
-
field_value = (field.tag_name == 'textarea') ? field.text : field.value
|
159
|
-
if field_value.respond_to? :should_not
|
160
|
-
field_value.should_not =~ /#{value}/
|
161
|
-
else
|
162
|
-
assert_no_match(/#{value}/, field_value)
|
163
|
-
end
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
Then /^the "([^"]*)" checkbox(?: within (.*))? should be checked$/ do |label, parent|
|
168
|
-
with_scope(parent) do
|
169
|
-
field_checked = find_field(label)['checked']
|
170
|
-
if field_checked.respond_to? :should
|
171
|
-
field_checked.should be_true
|
172
|
-
else
|
173
|
-
assert field_checked
|
174
|
-
end
|
175
|
-
end
|
176
|
-
end
|
177
|
-
|
178
|
-
Then /^the "([^"]*)" checkbox(?: within (.*))? should not be checked$/ do |label, parent|
|
179
|
-
with_scope(parent) do
|
180
|
-
field_checked = find_field(label)['checked']
|
181
|
-
if field_checked.respond_to? :should
|
182
|
-
field_checked.should be_false
|
183
|
-
else
|
184
|
-
assert !field_checked
|
185
|
-
end
|
186
|
-
end
|
187
|
-
end
|
188
|
-
|
189
|
-
Then /^(?:|I )should be on (.+)$/ do |page_name|
|
190
|
-
current_path = URI.parse(current_url).path
|
191
|
-
if current_path.respond_to? :should
|
192
|
-
current_path.should == path_to(page_name)
|
193
|
-
else
|
194
|
-
assert_equal path_to(page_name), current_path
|
195
|
-
end
|
196
|
-
end
|
197
|
-
|
198
|
-
Then /^(?:|I )should have the following query string:$/ do |expected_pairs|
|
199
|
-
query = URI.parse(current_url).query
|
200
|
-
actual_params = query ? CGI.parse(query) : {}
|
201
|
-
expected_params = {}
|
202
|
-
expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')}
|
203
|
-
|
204
|
-
if actual_params.respond_to? :should
|
205
|
-
actual_params.should == expected_params
|
206
|
-
else
|
207
|
-
assert_equal expected_params, actual_params
|
208
|
-
end
|
209
|
-
end
|
210
|
-
|
211
|
-
Then /^show me the page$/ do
|
212
|
-
save_and_open_page
|
213
|
-
end
|