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,44 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
# Copy Atrium assets to public folder in current app.
|
3
|
-
# If you want to do this on application startup, you can
|
4
|
-
# add this next line to your one of your environment files --
|
5
|
-
# generally you'd only want to do this in 'development', and can
|
6
|
-
# add it to environments/development.rb:
|
7
|
-
# require File.join(Atrium.root, "lib", "generators", "atrium", "assets_generator.rb")
|
8
|
-
# Atrium::Assets.start(["--force", "--quiet"])
|
9
|
-
|
10
|
-
|
11
|
-
# Need the requires here so we can call the generator from environment.rb
|
12
|
-
# as suggested above.
|
13
|
-
require 'rails/generators'
|
14
|
-
require 'rails/generators/base'
|
15
|
-
module Atrium
|
16
|
-
class Assets < Rails::Generators::Base
|
17
|
-
source_root File.expand_path('../templates', __FILE__)
|
18
|
-
|
19
|
-
def assets
|
20
|
-
unless IO.read("app/assets/stylesheets/application.css").include?("Atrium")
|
21
|
-
insert_into_file "app/assets/stylesheets/application.css", :before => "*/" do
|
22
|
-
%q{
|
23
|
-
* Required by Atrium:
|
24
|
-
*= require 'colorbox'
|
25
|
-
*= require 'atrium/chosen'
|
26
|
-
*= require 'atrium/atrium'
|
27
|
-
}
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
unless IO.read("app/assets/javascripts/application.js").include?('atrium/atrium')
|
32
|
-
insert_into_file "app/assets/javascripts/application.js", :after => "//= require jquery_ujs" do
|
33
|
-
%q{
|
34
|
-
//
|
35
|
-
// Required by Atrium
|
36
|
-
//= require atrium/atrium}
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
directory("../../../../app/assets/images/atrium", "app/assets/images/atrium")
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
@@ -1,149 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
require 'rails/generators'
|
3
|
-
require 'rails/generators/migration'
|
4
|
-
|
5
|
-
# require "generators/blacklight/blacklight_generator"
|
6
|
-
|
7
|
-
module Atrium
|
8
|
-
class AtriumGenerator < Rails::Generators::Base
|
9
|
-
include Rails::Generators::Migration
|
10
|
-
|
11
|
-
source_root File.expand_path('../templates', __FILE__)
|
12
|
-
|
13
|
-
argument :model_name, :type => :string , :default => "user"
|
14
|
-
|
15
|
-
desc """
|
16
|
-
This generator makes the following changes to your application:
|
17
|
-
1. Creates several database migrations if they do not exist in /db/migrate
|
18
|
-
2. Adds additional mime types to you application in the file '/config/initializers/mime_types.rb'
|
19
|
-
3. Creates config/solr.yml which you may need to modify to tell atrium where to find fedora & solr
|
20
|
-
6. Creates a number of role_map config files that are used in the placeholder user roles implementation
|
21
|
-
Enjoy!
|
22
|
-
|
23
|
-
"""
|
24
|
-
#
|
25
|
-
# Config Files & Initializers
|
26
|
-
#
|
27
|
-
# Copy all files in templates/config directory to host config
|
28
|
-
def create_configuration_files
|
29
|
-
# Role Mappings
|
30
|
-
copy_file "config/role_map_cucumber.yml", "config/role_map_cucumber.yml"
|
31
|
-
copy_file "config/role_map_development.yml", "config/role_map_development.yml"
|
32
|
-
copy_file "config/role_map_production.yml", "config/role_map_production.yml"
|
33
|
-
copy_file "config/role_map_test.yml", "config/role_map_test.yml"
|
34
|
-
|
35
|
-
# Solr config
|
36
|
-
copy_file "config/solr.yml", "config/solr.yml"
|
37
|
-
|
38
|
-
# Themes
|
39
|
-
copy_file "themes/example.html.erb", "app/views/layouts/atrium_themes/example.html.erb"
|
40
|
-
end
|
41
|
-
|
42
|
-
# Copy all files in templates/public/ directory to public/
|
43
|
-
# Call external generator in AssetsGenerator, so we can
|
44
|
-
# leave that callable seperately too.
|
45
|
-
def copy_public_assets
|
46
|
-
generate "atrium:assets"
|
47
|
-
end
|
48
|
-
|
49
|
-
# Register mimetypes required by hydra-head
|
50
|
-
def add_mime_types
|
51
|
-
puts "Updating Mime Types"
|
52
|
-
insert_into_file "config/initializers/mime_types.rb", :before => 'Mime::Type.register_alias "text/plain", :refworks_marc_txt' do <<EOF
|
53
|
-
Mime::Type.register_alias "text/html", :textile
|
54
|
-
Mime::Type.register_alias "text/html", :inline
|
55
|
-
|
56
|
-
EOF
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
#
|
61
|
-
# Migrations
|
62
|
-
#
|
63
|
-
|
64
|
-
# Implement the required interface for Rails::Generators::Migration.
|
65
|
-
# taken from http://github.com/rails/rails/blob/master/activerecord/lib/generators/active_record.rb
|
66
|
-
def self.next_migration_number(dirname)
|
67
|
-
unless @previous_migration_nr
|
68
|
-
if ActiveRecord::Base.timestamped_migrations
|
69
|
-
@previous_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
|
70
|
-
else
|
71
|
-
@previous_migration_nr = "%.3d" % (current_migration_number(dirname) + 1).to_i
|
72
|
-
end
|
73
|
-
else
|
74
|
-
@previous_migration_nr +=1
|
75
|
-
end
|
76
|
-
@previous_migration_nr.to_s
|
77
|
-
end
|
78
|
-
|
79
|
-
# Add Atrium behaviors and Filters to ApplicationHelper
|
80
|
-
def inject_atrium_helper_behavior
|
81
|
-
insert_into_file "app/helpers/application_helper.rb", :after => 'module ApplicationHelper' do
|
82
|
-
"\n # Adds a atrium collections behaviors into the application helper \n " +
|
83
|
-
" include Atrium::ApplicationHelper\n" +
|
84
|
-
" include Atrium::CollectionsHelper\n" +
|
85
|
-
" include CatalogHelper\n"
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
# Add Atrium behaviors and Filters to CatalogController
|
90
|
-
def inject_atrium_catalog_behavior
|
91
|
-
puts "Adding Atrium behaviors to CatalogController"
|
92
|
-
controller_name = "catalog_controller"
|
93
|
-
file_path = "app/controllers/#{controller_name.underscore}.rb"
|
94
|
-
if File.exists?(file_path)
|
95
|
-
insert_into_file file_path, :after => "require 'blacklight/catalog'" do
|
96
|
-
"\nrequire 'atrium/catalog'"
|
97
|
-
end
|
98
|
-
insert_into_file file_path, :after => 'include Blacklight::Catalog' do
|
99
|
-
"\n # Extend Blacklight::Catalog with Atrium behaviors (primarily editing)." +
|
100
|
-
"\n include Atrium::Catalog"
|
101
|
-
end
|
102
|
-
else
|
103
|
-
puts " \e[31mFailure\e[0m Could not find #{model_name.underscore}.rb. To add Atrium behaviors to your Blacklight::Catalog Controllers, you must include the Atrium::Controller module in the Controller class definition."
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
# Add Atrium to the application controller
|
108
|
-
def inject_atrium_controller_behavior
|
109
|
-
inject_into_class "app/controllers/application_controller.rb", "ApplicationController" do
|
110
|
-
" # Adds Atrium behaviors into the application controller \n " +
|
111
|
-
" include Atrium::Controller\n\n"
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
# Inject call to Atrium.add_routes in config/routes.rb
|
116
|
-
def inject_atrium_routes
|
117
|
-
puts "here"
|
118
|
-
insert_into_file "config/routes.rb", :after => 'Blacklight.add_routes(self)' do
|
119
|
-
"\n # Add Atrium routes."
|
120
|
-
"\n Atrium.add_routes(self)"
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
# Setup the database migrations
|
125
|
-
def copy_migrations
|
126
|
-
# Can't get this any more DRY, because we need this order.
|
127
|
-
better_migration_template "create_atrium_collections.rb"
|
128
|
-
better_migration_template "create_atrium_search_facets.rb"
|
129
|
-
better_migration_template "create_atrium_exhibits.rb"
|
130
|
-
better_migration_template "create_atrium_showcases.rb"
|
131
|
-
better_migration_template "create_atrium_showcase_items.rb"
|
132
|
-
better_migration_template "create_atrium_showcase_facet_selections.rb"
|
133
|
-
better_migration_template "create_atrium_browse_levels.rb"
|
134
|
-
better_migration_template "create_atrium_descriptions.rb"
|
135
|
-
better_migration_template "create_atrium_essays.rb"
|
136
|
-
end
|
137
|
-
|
138
|
-
private
|
139
|
-
|
140
|
-
def better_migration_template(file)
|
141
|
-
begin
|
142
|
-
migration_template "migrations/#{file}", "db/migrate/#{file}"
|
143
|
-
sleep 1 # ensure scripts have different time stamps
|
144
|
-
rescue
|
145
|
-
puts " \e[1m\e[34mMigrations\e[0m " + $!.message
|
146
|
-
end
|
147
|
-
end
|
148
|
-
end # AtriumGenerator
|
149
|
-
end # Atrium
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
require 'rails/generators'
|
3
|
-
require 'rails/generators/migration'
|
4
|
-
|
5
|
-
module Atrium
|
6
|
-
class CucumberSupportGenerator < Rails::Generators::Base
|
7
|
-
|
8
|
-
source_root File.expand_path('../../../../test_support/features', __FILE__)
|
9
|
-
|
10
|
-
argument :features_dir, :type => :string , :default => "features"
|
11
|
-
|
12
|
-
desc """
|
13
|
-
This Generator copies Hydra's cucumber step definitions and paths into your application's features directory.
|
14
|
-
We have plans to provide the step definitions directly through the hydra-head gem without requiring this step of copying the files.
|
15
|
-
In the meantime, you need to copy the files in order to use them.
|
16
|
-
|
17
|
-
Defaults to assuming that your cucumber features live in a directory called \"features\". To pass in an alternative path to your features directory,
|
18
|
-
|
19
|
-
rails generate atrium:cucumber_support test_support/features
|
20
|
-
|
21
|
-
"""
|
22
|
-
|
23
|
-
def cucumber_support
|
24
|
-
directory("step_definitions", "#{features_dir}/step_definitions")
|
25
|
-
copy_file("support/paths.rb", "#{features_dir}/support/paths.rb")
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
29
|
-
end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# This is a sample config file that does not have multiple solr instances. You will also need to be sure to
|
2
|
-
# edit the fedora.yml file to match the solr URL for active-fedora.
|
3
|
-
development:
|
4
|
-
url: http://localhost:8983/solr
|
5
|
-
test: &TEST
|
6
|
-
url: http://127.0.0.1:8983/solr
|
7
|
-
cucumber:
|
8
|
-
<<: *TEST
|
9
|
-
production:
|
10
|
-
url: http://your.production.server:8080/bl_solr/core0
|
@@ -1,87 +0,0 @@
|
|
1
|
-
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
-
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
3
|
-
#
|
4
|
-
# Examples:
|
5
|
-
#
|
6
|
-
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
|
7
|
-
# Mayor.create(:name => 'Emanuel', :city => cities.first)
|
8
|
-
|
9
|
-
#############################################
|
10
|
-
# User Configuration
|
11
|
-
#############################################
|
12
|
-
email= "test@test.com"
|
13
|
-
if User.find_by_email(email).nil?
|
14
|
-
user= User.create(:email => email, :password => "password", :password_confirmation => "password")
|
15
|
-
else
|
16
|
-
user= User.find_by_email(email)
|
17
|
-
end
|
18
|
-
puts "user created: #{user.inspect}"
|
19
|
-
|
20
|
-
#############################################
|
21
|
-
# Collection Configuration
|
22
|
-
#############################################
|
23
|
-
|
24
|
-
collection= Atrium::Collection.create
|
25
|
-
search_facet= Atrium::Search::Facet.create([{:name=> "format", :atrium_collection_id=> collection.id}])
|
26
|
-
puts "collection created: #{collection.inspect}, search_facet: #{search_facet.inspect}"
|
27
|
-
collection2=Atrium::Collection.create
|
28
|
-
|
29
|
-
#############################################
|
30
|
-
# Exhibit Configuration
|
31
|
-
#############################################
|
32
|
-
exhibit= Atrium::Exhibit.create([{:set_number=> 1, :atrium_collection_id=> collection.id, :label=> "Exhibit 1"}])
|
33
|
-
exhibit2= Atrium::Exhibit.create([{:set_number=> 1, :atrium_collection_id=> collection2.id, :label=> "Exhibit 1"}])
|
34
|
-
puts "exhibit created: #{exhibit.inspect}"
|
35
|
-
facet1=Atrium::BrowseLevel.create([{:atrium_exhibit_id=>1, :level_number=>1, :solr_facet_name=>'pub_date', :label=>'Publication Year'}])
|
36
|
-
facet2=Atrium::BrowseLevel.create([{:atrium_exhibit_id=>1, :level_number=>2, :solr_facet_name=>'language_facet', :label=>'Language'}])
|
37
|
-
|
38
|
-
########################################################################
|
39
|
-
# Add some description to solr which can be used to link to collection
|
40
|
-
########################################################################
|
41
|
-
Blacklight.solr.delete_by_id("desc_solr:1")
|
42
|
-
Blacklight.solr.delete_by_id("desc_solr:2")
|
43
|
-
Blacklight.solr.delete_by_id("desc_solr:3")
|
44
|
-
Blacklight.solr.commit
|
45
|
-
|
46
|
-
doc1= {
|
47
|
-
:id => "desc_solr:1",
|
48
|
-
:format => "Description",
|
49
|
-
:active_fedora_model_s => "Description",
|
50
|
-
:title_t => "Land Office Bank Currency",
|
51
|
-
:title_facet => "Land Office Bank Currency",
|
52
|
-
:title_s => "Land Office Bank Currency",
|
53
|
-
:page_display_s => "newpage",
|
54
|
-
:page_display_t => "newpage",
|
55
|
-
:description_content_s => "<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; \"><span class=\"Apple-style-span\" style=\"color: rgb(51, 51, 51); font-family: Verdana, 'Lucida Grande', 'Lucida Sans Unicode', Arial, sans-serif; font-size: 11px; line-height: 15px; \">Very few colonists had liquid assets as most settlers were small farmers or local merchants holding their wealth as land or in the form of perishable commodities. This situation inhibited investment and economic development. In order to assist people in obtaining liquidity several colonies instituted "Land Office Banks." The bank was operated by the colony with the consent of the Governor and the Board of Trade in London. Basically, a colony would print emissions of currency called "Land Office" notes. In several colonies the notes were allotted to local town or county boards. Property owners could then apply to their local board for a loan, usually up to £100 offering as collateral a portion of their property that was assessed at twice the value of the loan. The individual was required to pay off the loan with interest over a prescribed period of time.</span></p>"
|
56
|
-
}
|
57
|
-
|
58
|
-
|
59
|
-
doc2= {
|
60
|
-
:id => "desc_solr:2",
|
61
|
-
:format => "Description",
|
62
|
-
:active_fedora_model_s => "Description",
|
63
|
-
:title_t => "Description 2",
|
64
|
-
:title_facet => "Description 2",
|
65
|
-
:title_s => "Description 2",
|
66
|
-
:page_display_s => "samepage",
|
67
|
-
:page_display_t => "samepage",
|
68
|
-
:description_content_s => "this is the actually description of the essay"
|
69
|
-
}
|
70
|
-
|
71
|
-
|
72
|
-
doc3= {
|
73
|
-
:id => "desc_solr:3",
|
74
|
-
:format => "Description",
|
75
|
-
:active_fedora_model_s => "Description",
|
76
|
-
:title_t => "Description 3",
|
77
|
-
:title_facet => "Description 3",
|
78
|
-
:title_s => "Description 3",
|
79
|
-
:page_display_s => "newpage",
|
80
|
-
:page_display_t => "newpage",
|
81
|
-
:description_content_s => "this is the actually description of the essay"
|
82
|
-
}
|
83
|
-
|
84
|
-
Blacklight.solr.add doc1
|
85
|
-
Blacklight.solr.add doc2
|
86
|
-
Blacklight.solr.add doc3
|
87
|
-
Blacklight.solr.commit
|
@@ -1,17 +0,0 @@
|
|
1
|
-
class CreateAtriumShowcaseItems < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :atrium_showcase_items do |t|
|
4
|
-
t.string :solr_doc_id, :null=>false
|
5
|
-
t.string :type
|
6
|
-
t.integer :atrium_showcase_id, :null=>false
|
7
|
-
end
|
8
|
-
|
9
|
-
add_index :atrium_showcase_items, :solr_doc_id
|
10
|
-
add_index :atrium_showcase_items, :id
|
11
|
-
add_index :atrium_showcase_items, :atrium_showcase_id
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.down
|
15
|
-
drop_table :atrium_showcase_items
|
16
|
-
end
|
17
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<%#
|
2
|
-
Theming in Atrium isn't very sophisticated. When a collection is given a
|
3
|
-
theme it renders all the atrium views using a different layout file.
|
4
|
-
|
5
|
-
A custom layout file can be as simple as this one. It simply fills in the
|
6
|
-
content blocks present in the default layout. For a greater degree of freedom
|
7
|
-
you can copy the default layout from within the gem to the 'atrium_layouts'
|
8
|
-
directory in this application and make whatever changes you want to it.
|
9
|
-
|
10
|
-
For more information about nesting layouts see:
|
11
|
-
http://guides.rubyonrails.org/layouts_and_rendering.html#using-nested-layouts
|
12
|
-
%>
|
13
|
-
<% content_for :theme_styles do %>
|
14
|
-
<style type="text/css">
|
15
|
-
/* Theme-specific styles */
|
16
|
-
body {background: #497EC9;}
|
17
|
-
</style>
|
18
|
-
<% end %>
|
19
|
-
<%# content_for :main_header do %>
|
20
|
-
<%# end %>
|
21
|
-
<%= render :template => 'layouts/atrium' %>
|
data/lib/railties/all_tests.rake
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
namespace :atrium do
|
2
|
-
begin
|
3
|
-
require 'cucumber/rake/task'
|
4
|
-
require 'rspec/core'
|
5
|
-
require 'rspec/core/rake_task'
|
6
|
-
|
7
|
-
desc "Run Atrium cucumber and rspec, with test solr"
|
8
|
-
task :all_tests => ['atrium:spec:with_solr', 'atrium:cucumber:with_solr']
|
9
|
-
|
10
|
-
namespace :all_tests do
|
11
|
-
desc "Run Atrium rspec and cucumber tests with rcov"
|
12
|
-
rm "atrium-coverage.data" if File.exist?("atrium-coverage.data")
|
13
|
-
task :rcov => ['atrium:spec:rcov', 'atrium:cucumber:rcov']
|
14
|
-
end
|
15
|
-
|
16
|
-
rescue LoadError
|
17
|
-
desc "Not available! (cucumber and rspec not avail)"
|
18
|
-
task :all_tests do
|
19
|
-
abort 'Not available. Both cucumber and rspec need to be installed to run atrium:all_tests'
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
@@ -1,121 +0,0 @@
|
|
1
|
-
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
2
|
-
# It is recommended to regenerate this file in the future when you upgrade to a
|
3
|
-
# newer version of cucumber-rails. Consider adding your own code to a new file
|
4
|
-
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
5
|
-
# files.
|
6
|
-
|
7
|
-
# Atrium customization, trick Cucumber into looking in our current
|
8
|
-
# location for Rails.root, even though we're going to give it features
|
9
|
-
# from elsewhere.
|
10
|
-
#ENV['RAILS_ROOT'] = Rails.root.to_s
|
11
|
-
#ENV['RAILS_ENV'] = 'test'
|
12
|
-
|
13
|
-
# atrium_features, where to find features inside atrium source?
|
14
|
-
atrium_features = File.expand_path("../test_support/features",File.dirname(__FILE__))
|
15
|
-
unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
|
16
|
-
|
17
|
-
vendored_cucumber_bin = Dir[File.expand_path("../vendor/{gems,plugins}/cucumber*/bin/cucumber",File.dirname(__FILE__))].first
|
18
|
-
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
|
19
|
-
|
20
|
-
begin
|
21
|
-
require 'cucumber/rake/task'
|
22
|
-
|
23
|
-
namespace :atrium do
|
24
|
-
desc 'Alias for atrium:cucumber:ok'
|
25
|
-
task :cucumber => 'atrium:cucumber:ok'
|
26
|
-
namespace :cucumber do
|
27
|
-
Cucumber::Rake::Task.new({:ok => ['atrium:test:prepare', 'db:seed']}, 'Run features that should pass') do |t|
|
28
|
-
# Atrium customization, call features from external location, pass
|
29
|
-
# in feature location wtih cucumber_opts, yeah it's weird but that's how.
|
30
|
-
t.cucumber_opts = atrium_features
|
31
|
-
|
32
|
-
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
|
33
|
-
t.fork = true # You may get faster startup if you set this to false
|
34
|
-
t.profile = 'default'
|
35
|
-
end
|
36
|
-
|
37
|
-
Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
|
38
|
-
# Atrium customization, call features from external location, pass
|
39
|
-
# in feature location wtih cucumber_opts, yeah it's weird but that's how.
|
40
|
-
t.cucumber_opts = atrium_features
|
41
|
-
t.binary = vendored_cucumber_bin
|
42
|
-
t.fork = true # You may get faster startup if you set this to false
|
43
|
-
t.profile = 'wip'
|
44
|
-
end
|
45
|
-
|
46
|
-
Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
|
47
|
-
# Atrium customization, call features from external location, pass
|
48
|
-
# in feature location wtih cucumber_opts, yeah it's weird but that's how.
|
49
|
-
t.cucumber_opts = atrium_features
|
50
|
-
|
51
|
-
t.binary = vendored_cucumber_bin
|
52
|
-
t.fork = true # You may get faster startup if you set this to false
|
53
|
-
t.profile = 'rerun'
|
54
|
-
end
|
55
|
-
|
56
|
-
if (RUBY_VERSION.to_f < 1.9) then
|
57
|
-
Cucumber::Rake::Task.new({:rcov => 'db:test:prepare'}, 'Run features with rcov') do |t|
|
58
|
-
# Atrium customization, call features from external location, pass
|
59
|
-
# in feature location wtih cucumber_opts, yeah it's weird but that's how.
|
60
|
-
t.cucumber_opts = atrium_features
|
61
|
-
|
62
|
-
|
63
|
-
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
|
64
|
-
t.fork = true # You may get faster startup if you set this to false
|
65
|
-
t.profile = 'default'
|
66
|
-
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
desc 'Run all features'
|
71
|
-
task :all => [:ok]
|
72
|
-
|
73
|
-
|
74
|
-
# Solr wrapper. for now just for atrium:cucumber, plan to
|
75
|
-
# provide it for all variants eventually.
|
76
|
-
# if you would like to see solr startup messages on STDERR
|
77
|
-
# when starting solr test server during functional tests use:
|
78
|
-
#
|
79
|
-
# rake SOLR_CONSOLE=true
|
80
|
-
require File.expand_path('../jetty_solr_server.rb', __FILE__)
|
81
|
-
desc "atrium:cucumber with jetty/solr launch"
|
82
|
-
task :with_solr do
|
83
|
-
# wrap tests with a test-specific Solr server
|
84
|
-
# Need to look up where the test jetty is located
|
85
|
-
# from solr.yml, we don't hardcode it anymore.
|
86
|
-
|
87
|
-
solr_yml_path = locate_path("config", "solr.yml")
|
88
|
-
jetty_path = if ( File.exists?( solr_yml_path ))
|
89
|
-
solr_config = YAML::load(File.open(solr_yml_path))
|
90
|
-
solr_config["test"]["jetty_path"] if solr_config["test"]
|
91
|
-
end
|
92
|
-
raise Exception.new("Can't find jetty path to start test jetty. Expect a jetty_path key in config/solr.yml for test environment.") unless jetty_path
|
93
|
-
|
94
|
-
JettySolrServer.new(
|
95
|
-
:jetty_home => File.expand_path(jetty_path, Rails.root),
|
96
|
-
:sleep_after_start => 2).wrap do
|
97
|
-
Rake::Task["atrium:cucumber"].invoke
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
end
|
102
|
-
|
103
|
-
|
104
|
-
end
|
105
|
-
|
106
|
-
|
107
|
-
task :features => :cucumber do
|
108
|
-
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
|
109
|
-
end
|
110
|
-
|
111
|
-
# In case we don't have ActiveRecord, append a no-op task that we can depend upon.
|
112
|
-
task 'db:test:prepare' do
|
113
|
-
end
|
114
|
-
rescue LoadError
|
115
|
-
desc 'cucumber rake task not available (cucumber not installed)'
|
116
|
-
task :cucumber do
|
117
|
-
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
end
|