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,150 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
-
|
3
|
-
describe Atrium::DescriptionsController do
|
4
|
-
before do
|
5
|
-
#Atrium::Description.stubs(:new).returns(@atrium_description)
|
6
|
-
@collection = Atrium::Collection.new
|
7
|
-
@collection.save
|
8
|
-
@collection_showcase = Atrium::Showcase.new(:showcases_id=>@collection.id, :showcases_type=>@collection.class.name)
|
9
|
-
@collection_showcase.save
|
10
|
-
controller.stubs(:initialize_collection).returns(@collection)
|
11
|
-
controller.stubs(:get_exhibit_navigation_data).returns([])
|
12
|
-
end
|
13
|
-
|
14
|
-
describe '#determine_collection_id' do
|
15
|
-
before do
|
16
|
-
@description = Atrium::Description.new(:atrium_showcase_id=>@collection_showcase.id)
|
17
|
-
@description.save
|
18
|
-
Atrium::Description.stubs(:find).with(1).returns(@description)
|
19
|
-
end
|
20
|
-
it 'should return collection id from params id' do
|
21
|
-
Atrium::Showcase.stubs(:find).with(1).returns(@collection_showcase)
|
22
|
-
@collection_showcase.stubs(:parent).returns(@collection)
|
23
|
-
controller.params[:id] = @description.id
|
24
|
-
collection_id=controller.send(:determine_collection_id)
|
25
|
-
collection_id.should == @collection.id
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'return nil if exhibit id not available in params' do
|
29
|
-
collection_id=controller.send(:determine_collection_id)
|
30
|
-
collection_id.should == nil
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
describe "Get index" do
|
35
|
-
before do
|
36
|
-
@description = Atrium::Description.new(:atrium_showcase_id=>@collection_showcase.id)
|
37
|
-
@description.save
|
38
|
-
Atrium::Showcase.stubs(:find).with("1").returns(@collection_showcase)
|
39
|
-
#@collection_showcase.expects(:descriptions).returns([@description])
|
40
|
-
end
|
41
|
-
it "returns list of descriptions for given showcase" do
|
42
|
-
get :index, {:showcase_id => @collection_showcase.id}
|
43
|
-
response.should render_template 'layouts/atrium'
|
44
|
-
response.should render_template("index")
|
45
|
-
end
|
46
|
-
it "returns list of descriptions for given showcase without layout" do
|
47
|
-
get :index, {:showcase_id => @collection_showcase.id, :no_layout=>true}
|
48
|
-
puts "Res: #{response.body.inspect}"
|
49
|
-
response.should render_template("index")
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
describe "Get New" do
|
54
|
-
it "build new description form" do
|
55
|
-
get :new, {:showcase_id => @collection_showcase.id}
|
56
|
-
response.should render_template 'layouts/atrium'
|
57
|
-
response.should render_template("new")
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
describe "POST create" do
|
62
|
-
let(:@atrium_description) { mock_model(Atrium::Description) }
|
63
|
-
it "sets a flash[:notice] message" do
|
64
|
-
post :create, {:showcase_id => @collection_showcase.id,:atrium_description =>{:atrium_showcase_id => @collection_showcase.id}}
|
65
|
-
flash[:notice].should eq('Description was successfully created.')
|
66
|
-
end
|
67
|
-
it "redirects to the edit page" do
|
68
|
-
post :create, {:showcase_id => @collection_showcase.id,:atrium_description =>{:atrium_showcase_id => @collection_showcase.id}}
|
69
|
-
response.code.should == "302"
|
70
|
-
response.should redirect_to(edit_atrium_description_path(:id=>1))
|
71
|
-
end
|
72
|
-
it "create fails if showcase id not passed" do
|
73
|
-
threw_exception = false
|
74
|
-
begin
|
75
|
-
post :create
|
76
|
-
rescue
|
77
|
-
threw_exception = true
|
78
|
-
end
|
79
|
-
threw_exception.should == true
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
describe "Get Edit" do
|
84
|
-
before do
|
85
|
-
@description = mock()
|
86
|
-
@essay=mock()
|
87
|
-
@summary=mock()
|
88
|
-
Atrium::Description.stubs(:find).with("1").returns(@description)
|
89
|
-
@description.expects(:essay).returns(nil)
|
90
|
-
@description.expects(:summary).returns(nil)
|
91
|
-
@description.stubs(:build_essay).with(:content_type=>"essay").returns(@essay)
|
92
|
-
@description.stubs(:build_summary).with(:content_type=>"summary").returns(@summary)
|
93
|
-
end
|
94
|
-
it "returns description of the given description id" do
|
95
|
-
get :edit, { :id => "1" }
|
96
|
-
assigns[:atrium_description].should == @description
|
97
|
-
end
|
98
|
-
it "build description form for given description id" do
|
99
|
-
get :edit, { :id => "1" }
|
100
|
-
response.should render_template 'layouts/atrium'
|
101
|
-
response.should render_template("edit")
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
describe "Put Update" do
|
106
|
-
before do
|
107
|
-
@description = mock()
|
108
|
-
Atrium::Description.stubs(:find).with("1").returns(@description)
|
109
|
-
@description.stubs(:update_attributes).returns(true)
|
110
|
-
@description.expects(:essay).returns(nil)
|
111
|
-
end
|
112
|
-
it "sets a flash[:notice] message" do
|
113
|
-
put :update, {:id => "1", :atrium_description =>{:atrium_showcase_id => @collection_showcase.id}}
|
114
|
-
flash[:notice].should eq('Description was successfully updated.')
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
describe "Get Show" do
|
119
|
-
before do
|
120
|
-
@description = mock()
|
121
|
-
Atrium::Description.stubs(:find).with("1").returns(@description)
|
122
|
-
@description.expects(:description_solr_id).returns(nil)
|
123
|
-
end
|
124
|
-
it "returns description of the given description id" do
|
125
|
-
get :show, { :id => "1" }
|
126
|
-
response.should render_template 'layouts/atrium'
|
127
|
-
response.should render_template("show")
|
128
|
-
end
|
129
|
-
|
130
|
-
end
|
131
|
-
|
132
|
-
describe "Delete" do
|
133
|
-
before do
|
134
|
-
@description = mock()
|
135
|
-
Atrium::Description.stubs(:find).with("1").returns(@description)
|
136
|
-
end
|
137
|
-
it "returns description of the given description id" do
|
138
|
-
Atrium::Description.expects(:destroy).with("1").returns(true)
|
139
|
-
delete :destroy, { :id => "1" }
|
140
|
-
response.body.should == "Description 1 was deleted successfully."
|
141
|
-
end
|
142
|
-
|
143
|
-
end
|
144
|
-
|
145
|
-
describe "atrium_descriptions_add"
|
146
|
-
|
147
|
-
|
148
|
-
describe "atrium_descriptions_link"
|
149
|
-
|
150
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
-
|
3
|
-
describe Atrium::ExhibitFacetOrderController do
|
4
|
-
|
5
|
-
describe "Get index" do
|
6
|
-
it "returns facet order" do
|
7
|
-
mock_exhibit = mock("exhibit")
|
8
|
-
mock_facet_order = mock({})
|
9
|
-
Atrium::Exhibit.stubs(:find).with("1").returns(mock_exhibit)
|
10
|
-
mock_exhibit.expects("facet_order").returns(mock_facet_order)
|
11
|
-
get :index,{ :id=>"1"}
|
12
|
-
assigns[:facet_order].should == mock_facet_order
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should render JSON of session" do
|
16
|
-
mock_exhibit = mock("exhibit")
|
17
|
-
Atrium::Exhibit.stubs(:find).with("1").returns(mock_exhibit)
|
18
|
-
mock_exhibit.expects("facet_order").returns({})
|
19
|
-
get :index,{ :id=>"1", :format=> "json"}
|
20
|
-
response.body.should == {}.to_json
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
describe "Post update" do
|
25
|
-
it "should render JSON of facet order after updating the facet order" do
|
26
|
-
mock_exhibit = mock("exhibit")
|
27
|
-
mock_facet_order = {"1"=>"2", "2"=>"3","3"=>"1"}
|
28
|
-
Atrium::Exhibit.stubs(:find).with("1").returns(mock_exhibit)
|
29
|
-
mock_exhibit.expects(:facet_order=).with({"3"=>"1", "2"=>"3", "1"=>"2"}).returns(mock_facet_order)
|
30
|
-
mock_exhibit.expects("facet_order").returns(mock_facet_order)
|
31
|
-
post :update,{ :id=>"1", :collection =>{"1"=>"2", "2"=>"3", "3"=>"1"}, :format=> "json"}
|
32
|
-
response.body.should == mock_facet_order.to_json
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
@@ -1,192 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
-
|
3
|
-
describe Atrium::ExhibitsController do
|
4
|
-
before do
|
5
|
-
@collection = mock("atrium_collection")
|
6
|
-
controller.stubs(:initialize_collection).returns(@collection)
|
7
|
-
controller.stubs(:current_layout).returns("atrium")
|
8
|
-
end
|
9
|
-
|
10
|
-
describe '#determine_collection_id' do
|
11
|
-
it 'should return collection id from params id' do
|
12
|
-
exhibit = Atrium::Exhibit.new(:atrium_collection_id=>1)
|
13
|
-
Atrium::Exhibit.expects(:find).with("1").returns(exhibit)
|
14
|
-
controller.params[:id] = '1'
|
15
|
-
collection_id=controller.send(:determine_collection_id)
|
16
|
-
collection_id.should == 1
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'return nil if exhibit id not available in params' do
|
20
|
-
collection_id=controller.send(:determine_collection_id)
|
21
|
-
collection_id.should == nil
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe "Get New" do
|
26
|
-
it "build new exhibit form" do
|
27
|
-
get :new
|
28
|
-
response.should render_template 'layouts/atrium'
|
29
|
-
response.should render_template("new")
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
describe "POST create" do
|
34
|
-
it "sets a flash[:notice] exhibit" do
|
35
|
-
@exhibit = mock("atrium_exhibit")
|
36
|
-
Atrium::Exhibit.stubs(:new).returns(@exhibit)
|
37
|
-
@exhibit.expects(:update_attributes).returns(true)
|
38
|
-
@exhibit.expects(:atrium_collection_id).returns(1)
|
39
|
-
post :create, {:atrium_exhibit =>{:atrium_collection_id => 1, :set_number=>1}}
|
40
|
-
flash[:notice].should eq('Exhibit was successfully created.')
|
41
|
-
end
|
42
|
-
it "redirects to the edit page" do
|
43
|
-
@exhibit = mock("atrium_exhibit")
|
44
|
-
Atrium::Exhibit.stubs(:new).returns(@exhibit)
|
45
|
-
@exhibit.expects(:update_attributes).returns(true)
|
46
|
-
@exhibit.expects(:atrium_collection_id).returns(1)
|
47
|
-
post :create, {:atrium_exhibit =>{:atrium_collection_id => 1, :set_number=>1}}
|
48
|
-
response.code.should == "302"
|
49
|
-
response.should redirect_to(edit_atrium_collection_path(:id=>1))
|
50
|
-
end
|
51
|
-
#it "create fails if collection id not passed" do
|
52
|
-
# threw_exception = false
|
53
|
-
# begin
|
54
|
-
# post :create
|
55
|
-
# rescue
|
56
|
-
# threw_exception = true
|
57
|
-
# end
|
58
|
-
# threw_exception.should == true
|
59
|
-
#end
|
60
|
-
end
|
61
|
-
|
62
|
-
describe "Get Edit" do
|
63
|
-
before do
|
64
|
-
@exhibit = mock("atrium_exhibit")
|
65
|
-
Atrium::Exhibit.stubs(:find).with("1").returns(@exhibit)
|
66
|
-
@exhibit.expects(:collection).returns(@collection)
|
67
|
-
controller.stubs(:get_exhibit_navigation_data).returns([])
|
68
|
-
end
|
69
|
-
it "returns exhibit of the given exhibit id" do
|
70
|
-
get :edit, { :id => "1" }
|
71
|
-
assigns[:exhibit].should == @exhibit
|
72
|
-
end
|
73
|
-
it "build exhibit form for given exhibit id" do
|
74
|
-
get :edit, { :id => "1" }
|
75
|
-
response.should render_template 'layouts/atrium'
|
76
|
-
response.should render_template("edit")
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
describe "Put Update" do
|
81
|
-
before do
|
82
|
-
@exhibit = mock("atrium_exhibit")
|
83
|
-
Atrium::Exhibit.stubs(:find).with("1").returns(@exhibit)
|
84
|
-
@exhibit.expects(:update_attributes).returns(true)
|
85
|
-
end
|
86
|
-
it "sets a flash[:notice] after successful update" do
|
87
|
-
put :update, {:id => "1", :atrium_exhibit =>{:atrium_collection_id => 1, :set_number=>1}}
|
88
|
-
flash[:notice].should eq('Exhibit was successfully updated.')
|
89
|
-
end
|
90
|
-
|
91
|
-
it "redirects to the edit page" do
|
92
|
-
put :update, {:id => "1", :atrium_exhibit =>{:atrium_collection_id => 1, :set_number=>1}}
|
93
|
-
response.code.should == "302"
|
94
|
-
response.should redirect_to(edit_atrium_exhibit_path(:id=>1))
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
describe "Get Show" do
|
99
|
-
before do
|
100
|
-
@exhibit = mock("atrium_exhibit")
|
101
|
-
Atrium::Exhibit.stubs(:find).with("1").returns(@exhibit)
|
102
|
-
controller.stubs(:get_all_children).returns([])
|
103
|
-
controller.stubs(:get_exhibit_navigation_data).returns([])
|
104
|
-
@exhibit.expects(:filter_query_params).returns(nil)
|
105
|
-
end
|
106
|
-
it "returns exhibit of the given exhibit id with template" do
|
107
|
-
Atrium::Showcase.expects(:with_selected_facets).returns([])
|
108
|
-
get :show, { :id => "1" }
|
109
|
-
response.should render_template 'layouts/atrium'
|
110
|
-
response.should render_template("show")
|
111
|
-
end
|
112
|
-
|
113
|
-
it "returns exhibit of the given exhibit id without template" do
|
114
|
-
Atrium::Showcase.expects(:with_selected_facets).returns([])
|
115
|
-
get :show, { :id => "1", :no_layout=>true }
|
116
|
-
response.should_not render_template 'layouts/atrium'
|
117
|
-
response.should render_template("show")
|
118
|
-
end
|
119
|
-
|
120
|
-
it "should return only items that are through exhibit scope filter" do
|
121
|
-
pending
|
122
|
-
end
|
123
|
-
|
124
|
-
it "should return any featured item added through showcase" do
|
125
|
-
pending
|
126
|
-
end
|
127
|
-
|
128
|
-
it "should return any descriptions added through showcase" do
|
129
|
-
pending
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
describe "Get Set Exhibit Scope" do
|
134
|
-
before do
|
135
|
-
session[:folder_document_ids]=[]
|
136
|
-
@exhibit = mock("atrium_exhibit")
|
137
|
-
Atrium::Exhibit.stubs(:find).with("1").returns(@exhibit)
|
138
|
-
end
|
139
|
-
|
140
|
-
it "set session documents to exhibit filter query params solr documents if present" do
|
141
|
-
@exhibit.stubs(:filter_query_params).returns(nil)
|
142
|
-
get :set_exhibit_scope, {:id => "1"}
|
143
|
-
response.should redirect_to(catalog_index_path)
|
144
|
-
end
|
145
|
-
|
146
|
-
it "set session documents to exhibit filter query params solr documents if present" do
|
147
|
-
@exhibit.stubs(:filter_query_params).returns({:solr_doc_ids=>"1,2,3"})
|
148
|
-
get :set_exhibit_scope, {:id => "1"}
|
149
|
-
session[:folder_document_ids] == ["1", "2", "3"]
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
|
-
|
154
|
-
describe "Get Unset Exhibit Scope" do
|
155
|
-
before do
|
156
|
-
session[:folder_document_ids]=[]
|
157
|
-
@exhibit = mock("atrium_exhibit")
|
158
|
-
Atrium::Exhibit.stubs(:find).with("1").returns(@exhibit)
|
159
|
-
@exhibit.expects(:update_attributes).returns(true)
|
160
|
-
end
|
161
|
-
|
162
|
-
it "sets a flash[:notice] after removing scope of the exhibit update" do
|
163
|
-
get :unset_exhibit_scope, {:id => "1"}
|
164
|
-
flash[:notice].should eq('Exhibit scope removed successfully')
|
165
|
-
end
|
166
|
-
|
167
|
-
it "redirects to the edit page" do
|
168
|
-
put :unset_exhibit_scope, {:id => "1"}
|
169
|
-
response.code.should == "200"
|
170
|
-
response.should render_template("edit")
|
171
|
-
end
|
172
|
-
end
|
173
|
-
|
174
|
-
describe "Delete" do
|
175
|
-
before do
|
176
|
-
@exhibit = mock("atrium_exhibit")
|
177
|
-
Atrium::Exhibit.stubs(:find).with("1").returns(@exhibit)
|
178
|
-
Atrium::Exhibit.expects(:destroy).with("1").returns(true)
|
179
|
-
@exhibit.expects(:atrium_collection_id).returns(1)
|
180
|
-
end
|
181
|
-
it "destroy exhibit successfully" do
|
182
|
-
delete :destroy, { :id => "1" }
|
183
|
-
flash[:notice].should == "Exhibit 1 was deleted successfully."
|
184
|
-
end
|
185
|
-
|
186
|
-
it "redirects to collection edit page" do
|
187
|
-
delete :destroy, { :id => "1" }
|
188
|
-
response.should redirect_to(edit_atrium_collection_path(:id=>1))
|
189
|
-
end
|
190
|
-
|
191
|
-
end
|
192
|
-
end
|
@@ -1,219 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
-
|
3
|
-
describe Atrium::ShowcasesController do
|
4
|
-
before do
|
5
|
-
@collection = mock("atrium_collection")
|
6
|
-
controller.stubs(:initialize_collection).returns(@collection)
|
7
|
-
controller.stubs(:current_layout).returns("atrium")
|
8
|
-
end
|
9
|
-
|
10
|
-
describe '#determine_collection_id' do
|
11
|
-
#before do
|
12
|
-
# @description = Atrium::Description.new(:atrium_showcase_id=>@collection_showcase.id)
|
13
|
-
# @description.save
|
14
|
-
# @collection_showcase.stub(:parent).returns(@collection)
|
15
|
-
#end
|
16
|
-
it 'should return collection id of collection showcase from params ' do
|
17
|
-
collection = Atrium::Collection.new
|
18
|
-
collection.save
|
19
|
-
showcase = Atrium::Showcase.new(:showcases_id=> collection.id, :showcases_type=>collection.class.name)
|
20
|
-
showcase.save
|
21
|
-
Atrium::Showcase.stubs(:find).with("1").returns(showcase)
|
22
|
-
controller.params[:id] = '1'
|
23
|
-
collection_id=controller.send(:determine_collection_id)
|
24
|
-
collection_id.should == 1
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'should return collection id of exhibit showcase from params ' do
|
28
|
-
collection = Atrium::Collection.new
|
29
|
-
collection.save
|
30
|
-
exhibit = Atrium::Exhibit.new(:atrium_collection_id=> collection.id, :set_number=>1)
|
31
|
-
exhibit.save
|
32
|
-
showcase = Atrium::Showcase.new(:showcases_id=> exhibit.id, :showcases_type=>exhibit.class.name)
|
33
|
-
showcase.save
|
34
|
-
Atrium::Showcase.stubs(:find).with("1").returns(showcase)
|
35
|
-
showcase.stubs(:parent).returns(exhibit)
|
36
|
-
#showcase.should_receive(:parent).and_return(exhibit)
|
37
|
-
controller.params[:id] = '1'
|
38
|
-
collection_id=controller.send(:determine_collection_id)
|
39
|
-
collection_id.should == 1
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'return nil if exhibit id not available in params' do
|
43
|
-
collection_id=controller.send(:determine_collection_id)
|
44
|
-
collection_id.should == nil
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
describe "Get New" do
|
49
|
-
before do
|
50
|
-
@collection = mock("atrium_collection")
|
51
|
-
@exhibit = mock("atrium_exhibit")
|
52
|
-
@showcase = mock("atrium_showcase")
|
53
|
-
@showcase.stubs(:showcases_id).returns(1)
|
54
|
-
@showcase.stubs(:build).returns(@showcase)
|
55
|
-
@showcase.stubs(:showcases_id).returns(1)
|
56
|
-
Atrium::Collection.stubs(:find_by_id).returns(@collection)
|
57
|
-
Atrium::Exhibit.stubs(:find_by_id).returns(@exhibit)
|
58
|
-
end
|
59
|
-
it "create showcase for collection" do
|
60
|
-
Atrium::Showcase.expects(:with_selected_facets).returns([])
|
61
|
-
@collection.expects(:showcases).returns(@showcase)
|
62
|
-
@showcase.stubs(:for_exhibit?).returns(false)
|
63
|
-
@showcase.expects(:save!)
|
64
|
-
xhr :get, :new, {:collection_id => 1}
|
65
|
-
session[:edit_showcase].should == true
|
66
|
-
response.should redirect_to atrium_collection_showcase_path(1,@showcase.id)
|
67
|
-
end
|
68
|
-
it "create showcase for exhibit" do
|
69
|
-
Atrium::Showcase.expects(:with_selected_facets).returns([])
|
70
|
-
@showcase.stubs(:for_exhibit?).returns(true)
|
71
|
-
@exhibit.expects(:showcases).returns(@showcase)
|
72
|
-
@showcase.expects(:save!)
|
73
|
-
xhr :get, :new, {:exhibit_id => 1}
|
74
|
-
session[:edit_showcase].should == true
|
75
|
-
response.should redirect_to atrium_exhibit_path(1)
|
76
|
-
end
|
77
|
-
it "return existing showcase for collection" do
|
78
|
-
Atrium::Showcase.expects(:with_selected_facets).returns([@showcase])
|
79
|
-
@showcase.expects(:for_exhibit?).returns(false)
|
80
|
-
xhr :get, :new, {:collection_id => 1}
|
81
|
-
assigns[:atrium_showcase].should == @showcase
|
82
|
-
end
|
83
|
-
it "show redirect to collection page" do
|
84
|
-
Atrium::Showcase.expects(:with_selected_facets).returns([@showcase])
|
85
|
-
@showcase.expects(:for_exhibit?).returns(false)
|
86
|
-
xhr :get, :new, {:collection_id => 1}
|
87
|
-
session[:edit_showcase].should == true
|
88
|
-
response.should redirect_to atrium_collection_showcase_path(1,@showcase.id)
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
|
93
|
-
describe "Get Show" do
|
94
|
-
it "should assign showcase to mocked showcase" do
|
95
|
-
session[:folder_document_ids]=nil
|
96
|
-
@showcase = mock("atrium_showcase")
|
97
|
-
Atrium::Showcase.stubs(:find).returns(@showcase)
|
98
|
-
@showcase.stubs(:showcase_items=).returns({})
|
99
|
-
@showcase.stubs(:showcase_items).returns({})
|
100
|
-
@showcase.expects(:save)
|
101
|
-
get :show, {:id=>1}
|
102
|
-
assigns[:atrium_showcase].should == @showcase
|
103
|
-
end
|
104
|
-
it "redirect to show view when featured items are not selected" do
|
105
|
-
session[:folder_document_ids]=nil
|
106
|
-
@showcase = mock("atrium_showcase")
|
107
|
-
Atrium::Showcase.stubs(:find).returns(@showcase)
|
108
|
-
@showcase.stubs(:showcase_items=).returns({})
|
109
|
-
@showcase.stubs(:showcase_items).returns({})
|
110
|
-
@showcase.expects(:save)
|
111
|
-
get :show, {:id=>1}
|
112
|
-
response.should render_template 'layouts/atrium'
|
113
|
-
response.should render_template("show")
|
114
|
-
end
|
115
|
-
it "should not assign layout when params is passed" do
|
116
|
-
session[:folder_document_ids]=nil
|
117
|
-
@showcase = mock("atrium_showcase")
|
118
|
-
@showcase.stubs(:showcase_items=).returns({})
|
119
|
-
@showcase.stubs(:showcase_items).returns({})
|
120
|
-
@showcase.expects(:save)
|
121
|
-
Atrium::Showcase.stubs(:find).returns(@showcase)
|
122
|
-
get :show, { :id => "1", :no_layout=>true }
|
123
|
-
response.should_not render_template 'layouts/atrium'
|
124
|
-
response.should render_template("show")
|
125
|
-
end
|
126
|
-
|
127
|
-
it "save session documents to showcase showcase_items" do
|
128
|
-
@showcase = Atrium::Showcase.new({:showcases_id=>1, :showcases_type=>"Atrium::Collection"})
|
129
|
-
@showcase.save!
|
130
|
-
Atrium::Showcase.stubs(:find).returns(@showcase)
|
131
|
-
#@showcase.expects(:save)
|
132
|
-
session[:folder_document_ids]=["1", "2", "3"]
|
133
|
-
get :show, { :id => 1, :no_layout=>true }
|
134
|
-
assigns[:atrium_showcase].should == @showcase
|
135
|
-
response.should_not render_template 'layouts/atrium'
|
136
|
-
response.should render_template("show")
|
137
|
-
end
|
138
|
-
end
|
139
|
-
|
140
|
-
describe "Post remove_featured" do
|
141
|
-
it "should assign showcase to mocked showcase" do
|
142
|
-
session[:folder_document_ids]=nil
|
143
|
-
@showcase = mock("atrium_showcase")
|
144
|
-
Atrium::Showcase.stubs(:find).returns(@showcase)
|
145
|
-
@showcase.stubs(:showcase_items=).returns({})
|
146
|
-
@showcase.stubs(:showcase_items).returns({})
|
147
|
-
@showcase.expects(:save)
|
148
|
-
post :remove_featured, {:id=>1}
|
149
|
-
assigns[:atrium_showcase].should == @showcase
|
150
|
-
end
|
151
|
-
it "remove given featured solr doc ide from showcase item" do
|
152
|
-
@showcase = mock("atrium_showcase")
|
153
|
-
Atrium::Showcase.stubs(:find).returns(@showcase)
|
154
|
-
@showcase.stubs(:showcase_items=).returns({:type=>"featured", :solr_doc_ids=>"1,2,3"})
|
155
|
-
@showcase.stubs(:showcase_items).returns({:type=>"featured", :solr_doc_ids=>"1,2,3"})
|
156
|
-
@showcase.expects(:save)
|
157
|
-
post :remove_featured, {:id=>1, :solr_doc_id=>"1"}
|
158
|
-
assigns[:featured_items].should == ["2", "3"]
|
159
|
-
end
|
160
|
-
|
161
|
-
it "save session documents to showcase showcase_items" do
|
162
|
-
@showcase = Atrium::Showcase.new({:showcases_id=>1, :showcases_type=>"Atrium::Collection"})
|
163
|
-
@showcase.save!
|
164
|
-
Atrium::Showcase.stubs(:find).returns(@showcase)
|
165
|
-
#@showcase.expects(:save)
|
166
|
-
session[:folder_document_ids]=["1", "2", "3"]
|
167
|
-
get :show, { :id => 1, :no_layout=>true }
|
168
|
-
assigns[:atrium_showcase].should == @showcase
|
169
|
-
response.should_not render_template 'layouts/atrium'
|
170
|
-
response.should render_template("show")
|
171
|
-
end
|
172
|
-
end
|
173
|
-
|
174
|
-
describe "Get featured" do
|
175
|
-
before do
|
176
|
-
session[:folder_document_ids]=nil
|
177
|
-
@showcase = mock("atrium_showcase")
|
178
|
-
Atrium::Showcase.stubs(:find).with("1").returns(@showcase)
|
179
|
-
end
|
180
|
-
|
181
|
-
it "set session documents to showcase featured items solr documents if present" do
|
182
|
-
@showcase.stubs(:showcase_items).returns(nil)
|
183
|
-
@showcase.stubs(:parent).returns(nil)
|
184
|
-
get :featured, {:id => "1"}
|
185
|
-
response.should redirect_to(catalog_index_path(:add_featured=>true, :search_field=>"all_fields"))
|
186
|
-
end
|
187
|
-
|
188
|
-
it "set session documents to exhibit filter query params solr documents if present" do
|
189
|
-
@showcase.stubs(:showcase_items).returns({:solr_doc_ids=>"1,2,3"})
|
190
|
-
@showcase.stubs(:parent).returns(nil)
|
191
|
-
get :featured, {:id => "1"}
|
192
|
-
session[:folder_document_ids] == ["1", "2", "3"]
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
|
-
describe "Get refresh_showcase" do
|
197
|
-
before do
|
198
|
-
@showcase = mock("atrium_showcase")
|
199
|
-
Atrium::Showcase.stubs(:find).returns(@showcase)
|
200
|
-
end
|
201
|
-
it "should return collection path for collection showcase" do
|
202
|
-
@showcase.expects(:showcases_id).returns(1)
|
203
|
-
@showcase.stubs(:for_exhibit?).returns(false)
|
204
|
-
get :refresh_showcase, {:id=>1}
|
205
|
-
assigns[:atrium_showcase].should == @showcase
|
206
|
-
session[:edit_showcase].should be_nil
|
207
|
-
response.should redirect_to atrium_collection_path(1)
|
208
|
-
end
|
209
|
-
it "should return exhibit path for exhibit showcase" do
|
210
|
-
@showcase.expects(:showcases_id).returns(1)
|
211
|
-
@showcase.stubs(:for_exhibit?).returns(true)
|
212
|
-
get :refresh_showcase, {:id=>1, :f=>{"continent"=>["North America"]}}
|
213
|
-
assigns[:atrium_showcase].should == @showcase
|
214
|
-
session[:edit_showcase].should be_nil
|
215
|
-
response.should redirect_to atrium_exhibit_path(1, :f=>{"continent"=>["North America"]})
|
216
|
-
end
|
217
|
-
end
|
218
|
-
|
219
|
-
end
|