enju_flower 0.1.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +9 -0
- data/Rakefile +47 -0
- data/app/helpers/manifestations_helper.rb +176 -0
- data/app/views/manifestations/_all_facet.html.erb +8 -0
- data/app/views/manifestations/_attachment_file.html.erb +6 -0
- data/app/views/manifestations/_book_jacket.html.erb +5 -0
- data/app/views/manifestations/_call_number.html.erb +25 -0
- data/app/views/manifestations/_carrier_type_facet.html.erb +9 -0
- data/app/views/manifestations/_edition_and_number.html.erb +22 -0
- data/app/views/manifestations/_form.html.erb +156 -0
- data/app/views/manifestations/_history_list.html.erb +12 -0
- data/app/views/manifestations/_holding.html.erb +3 -0
- data/app/views/manifestations/_index_form.html.erb +12 -0
- data/app/views/manifestations/_index_form_contributor.html.erb +15 -0
- data/app/views/manifestations/_index_form_creator.html.erb +15 -0
- data/app/views/manifestations/_index_form_item.html.erb +14 -0
- data/app/views/manifestations/_index_form_manifestation.html.erb +13 -0
- data/app/views/manifestations/_index_form_publisher.html.erb +15 -0
- data/app/views/manifestations/_index_form_series_statement.html.erb +20 -0
- data/app/views/manifestations/_language_facet.html.erb +16 -0
- data/app/views/manifestations/_library_facet.html.erb +11 -0
- data/app/views/manifestations/_list.html.erb +21 -0
- data/app/views/manifestations/_manifestation.html.erb +73 -0
- data/app/views/manifestations/_manifestation_list.html.erb +32 -0
- data/app/views/manifestations/_not_found.html.erb +7 -0
- data/app/views/manifestations/_paginate_id_link.html.erb +30 -0
- data/app/views/manifestations/_pickup.html.erb +30 -0
- data/app/views/manifestations/_pub_year_facet.html.erb +11 -0
- data/app/views/manifestations/_question_list.html.erb +13 -0
- data/app/views/manifestations/_reservable_facet.html.erb +14 -0
- data/app/views/manifestations/_search_engine.html.erb +16 -0
- data/app/views/manifestations/_serial_form.html.erb +14 -0
- data/app/views/manifestations/_session_ids.html.erb +10 -0
- data/app/views/manifestations/_show.mods.builder +86 -0
- data/app/views/manifestations/_show.rdf.builder +63 -0
- data/app/views/manifestations/_show_creators.html.erb +17 -0
- data/app/views/manifestations/_show_creators.mobile.erb +17 -0
- data/app/views/manifestations/_show_detail_librarian.html.erb +135 -0
- data/app/views/manifestations/_show_detail_user.html.erb +130 -0
- data/app/views/manifestations/_show_group.html.erb +2 -0
- data/app/views/manifestations/_show_holding.html.erb +60 -0
- data/app/views/manifestations/_show_holding.mobile.erb +38 -0
- data/app/views/manifestations/_show_index.html.erb +21 -0
- data/app/views/manifestations/_show_index.mobile.erb +14 -0
- data/app/views/manifestations/_show_periodical_master.html.erb +40 -0
- data/app/views/manifestations/_show_series_index.html.erb +15 -0
- data/app/views/manifestations/_show_series_statement.html.erb +30 -0
- data/app/views/manifestations/_submenu_series_statement.html.erb +9 -0
- data/app/views/manifestations/_tab_list.html.erb +11 -0
- data/app/views/manifestations/_tab_menu.html.erb +14 -0
- data/app/views/manifestations/_title.html.erb +27 -0
- data/app/views/manifestations/_title.mobile.erb +27 -0
- data/app/views/manifestations/edit.html.erb +21 -0
- data/app/views/manifestations/error.xml +7 -0
- data/app/views/manifestations/explain.sru +9 -0
- data/app/views/manifestations/index.atom.builder +19 -0
- data/app/views/manifestations/index.csv.erb +4 -0
- data/app/views/manifestations/index.html.erb +112 -0
- data/app/views/manifestations/index.mobile.erb +21 -0
- data/app/views/manifestations/index.mods.builder +8 -0
- data/app/views/manifestations/index.opds.builder +24 -0
- data/app/views/manifestations/index.rdf.builder +30 -0
- data/app/views/manifestations/index.rss.builder +43 -0
- data/app/views/manifestations/index.sru.builder +101 -0
- data/app/views/manifestations/new.html.erb +16 -0
- data/app/views/manifestations/show.html.erb +108 -0
- data/app/views/manifestations/show.mobile.erb +20 -0
- data/app/views/manifestations/show.mods.builder +6 -0
- data/app/views/manifestations/show.rdf.builder +12 -0
- data/config/routes.rb +2 -0
- data/lib/enju_flower/engine.rb +4 -0
- data/lib/enju_flower/version.rb +3 -0
- data/lib/enju_flower.rb +4 -0
- data/lib/generators/enju_flower/views_generator.rb +17 -0
- data/lib/tasks/enju_flower_tasks.rake +4 -0
- data/spec/controllers/manifestations_controller_spec.rb +685 -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 +184 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/notifier.rb +40 -0
- data/spec/dummy/app/models/ability.rb +186 -0
- data/spec/dummy/app/models/local_patron.rb +27 -0
- data/spec/dummy/app/models/role.rb +46 -0
- data/spec/dummy/app/models/setting.rb +4 -0
- data/spec/dummy/app/models/user.rb +102 -0
- data/spec/dummy/app/models/user_group.rb +40 -0
- data/spec/dummy/app/models/user_has_role.rb +5 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/page/403.html.erb +9 -0
- data/spec/dummy/app/views/page/403.mobile.erb +5 -0
- data/spec/dummy/app/views/page/403.xml.erb +4 -0
- data/spec/dummy/app/views/page/404.html.erb +9 -0
- data/spec/dummy/app/views/page/404.mobile.erb +5 -0
- data/spec/dummy/app/views/page/404.xml.erb +4 -0
- data/spec/dummy/app/views/page/_footer.html.erb +4 -0
- data/spec/dummy/app/views/page/_header.html.erb +2 -0
- data/spec/dummy/app/views/page/_include.html.erb +4 -0
- data/spec/dummy/app/views/page/_menu.html.erb +2 -0
- data/spec/dummy/app/views/page/_select_locale.html.erb +2 -0
- data/spec/dummy/config/application.rb +64 -0
- data/spec/dummy/config/application.yml +42 -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/devise.rb +205 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +10 -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 +60 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/migrate/001_create_patrons.rb +53 -0
- data/spec/dummy/db/migrate/005_create_manifestations.rb +56 -0
- data/spec/dummy/db/migrate/006_create_items.rb +28 -0
- data/spec/dummy/db/migrate/012_create_owns.rb +12 -0
- data/spec/dummy/db/migrate/015_create_creates.rb +12 -0
- data/spec/dummy/db/migrate/032_create_checkins.rb +17 -0
- data/spec/dummy/db/migrate/033_create_checkouts.rb +25 -0
- data/spec/dummy/db/migrate/035_create_reserves.rb +27 -0
- data/spec/dummy/db/migrate/047_create_produces.rb +12 -0
- data/spec/dummy/db/migrate/055_create_bookmarks.rb +22 -0
- data/spec/dummy/db/migrate/059_create_libraries.rb +28 -0
- data/spec/dummy/db/migrate/069_create_shelves.rb +15 -0
- data/spec/dummy/db/migrate/073_create_carrier_types.rb +11 -0
- data/spec/dummy/db/migrate/077_create_user_groups.rb +16 -0
- data/spec/dummy/db/migrate/080_create_library_groups.rb +20 -0
- data/spec/dummy/db/migrate/112_create_frequencies.rb +12 -0
- data/spec/dummy/db/migrate/113_create_events.rb +23 -0
- data/spec/dummy/db/migrate/114_create_event_categories.rb +16 -0
- data/spec/dummy/db/migrate/117_create_form_of_works.rb +12 -0
- data/spec/dummy/db/migrate/120_create_baskets.rb +12 -0
- data/spec/dummy/db/migrate/121_create_checked_items.rb +17 -0
- data/spec/dummy/db/migrate/124_create_bookstores.rb +17 -0
- data/spec/dummy/db/migrate/125_create_donates.rb +12 -0
- data/spec/dummy/db/migrate/127_create_use_restrictions.rb +16 -0
- data/spec/dummy/db/migrate/129_create_item_has_use_restrictions.rb +16 -0
- data/spec/dummy/db/migrate/130_create_request_status_types.rb +12 -0
- data/spec/dummy/db/migrate/131_create_request_types.rb +12 -0
- data/spec/dummy/db/migrate/132_create_circulation_statuses.rb +16 -0
- data/spec/dummy/db/migrate/149_create_message_templates.rb +18 -0
- data/spec/dummy/db/migrate/154_create_messages.rb +24 -0
- data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +20 -0
- data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +13 -0
- data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +13 -0
- data/spec/dummy/db/migrate/20080905191442_create_patron_types.rb +12 -0
- data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +17 -0
- data/spec/dummy/db/migrate/20081025083323_create_countries.rb +28 -0
- data/spec/dummy/db/migrate/20081025083905_create_languages.rb +23 -0
- data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +15 -0
- data/spec/dummy/db/migrate/20081028083142_create_patron_import_files.rb +22 -0
- data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +22 -0
- data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +27 -0
- data/spec/dummy/db/migrate/20081030023412_create_checkout_types.rb +17 -0
- data/spec/dummy/db/migrate/20081030023518_create_user_group_has_checkout_types.rb +25 -0
- data/spec/dummy/db/migrate/20081030023615_create_carrier_type_has_checkout_types.rb +18 -0
- data/spec/dummy/db/migrate/20081117143156_create_inventory_files.rb +18 -0
- data/spec/dummy/db/migrate/20081117143455_create_inventories.rb +17 -0
- data/spec/dummy/db/migrate/20081212075554_create_checkout_stat_has_manifestations.rb +17 -0
- data/spec/dummy/db/migrate/20081212080038_create_manifestation_checkout_stats.rb +16 -0
- data/spec/dummy/db/migrate/20081212151614_create_bookmark_stats.rb +16 -0
- data/spec/dummy/db/migrate/20081212151820_create_bookmark_stat_has_manifestations.rb +13 -0
- data/spec/dummy/db/migrate/20081215094302_create_user_checkout_stats.rb +16 -0
- data/spec/dummy/db/migrate/20081215094955_create_checkout_stat_has_users.rb +17 -0
- data/spec/dummy/db/migrate/20081216190517_create_reserve_stat_has_manifestations.rb +17 -0
- data/spec/dummy/db/migrate/20081216190724_create_manifestation_reserve_stats.rb +16 -0
- data/spec/dummy/db/migrate/20081220023628_create_user_reserve_stats.rb +16 -0
- data/spec/dummy/db/migrate/20081220034117_create_reserve_stat_has_users.rb +17 -0
- data/spec/dummy/db/migrate/20090321130448_add_completed_at_to_user_checkout_stat.rb +27 -0
- data/spec/dummy/db/migrate/20090519203307_create_participates.rb +17 -0
- data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +15 -0
- data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +15 -0
- data/spec/dummy/db/migrate/20090706125521_add_attachments_inventory_to_inventory_file.rb +15 -0
- data/spec/dummy/db/migrate/20090719201843_create_extents.rb +12 -0
- data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +12 -0
- data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +12 -0
- data/spec/dummy/db/migrate/20090812151902_create_patron_relationship_types.rb +12 -0
- data/spec/dummy/db/migrate/20090831220301_create_lending_policies.rb +21 -0
- data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +27 -0
- data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +12 -0
- data/spec/dummy/db/migrate/20091202124834_create_versions.rb +18 -0
- data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +13 -0
- data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +15 -0
- data/spec/dummy/db/migrate/20100222124420_add_allow_bookmark_external_url_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +13 -0
- data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +10 -0
- data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +13 -0
- data/spec/dummy/db/migrate/20100525171356_acts_as_taggable_on_migration.rb +30 -0
- data/spec/dummy/db/migrate/20100527113752_create_delayed_jobs.rb +21 -0
- data/spec/dummy/db/migrate/20100606073747_create_patron_relationships.rb +13 -0
- data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +12 -0
- data/spec/dummy/db/migrate/20100814091104_add_position_to_patron_relationship.rb +11 -0
- data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +15 -0
- data/spec/dummy/db/migrate/20100925074559_create_patron_import_results.rb +12 -0
- data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +15 -0
- data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +9 -0
- data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +9 -0
- data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +11 -0
- data/spec/dummy/db/migrate/20110301134521_add_expire_date_to_reserve.rb +9 -0
- data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +13 -0
- data/spec/dummy/db/migrate/20110328130826_add_current_checkout_count_to_user_group_has_checkout_type.rb +9 -0
- data/spec/dummy/db/migrate/20110425133109_add_issn_to_series_statement.rb +9 -0
- data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +9 -0
- data/spec/dummy/db/migrate/20110618091240_add_periodical_to_series_statement.rb +9 -0
- data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +9 -0
- data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +11 -0
- data/spec/dummy/db/migrate/20110621093332_remove_expire_date_from_reserve.rb +9 -0
- data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +9 -0
- data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +12 -0
- data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +13 -0
- data/spec/dummy/db/migrate/20110820131417_create_series_has_manifestations.rb +13 -0
- data/spec/dummy/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +11 -0
- data/spec/dummy/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +13 -0
- data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +13 -0
- data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +10 -0
- data/spec/dummy/db/migrate/20110918161853_rename_series_statement_manifestation_id_to_root_manifestation_id.rb +13 -0
- data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +9 -0
- data/spec/dummy/db/migrate/20111009183423_add_ndc_to_manifestation.rb +9 -0
- data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +12 -0
- data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +12 -0
- data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +12 -0
- data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +7 -0
- data/spec/dummy/db/migrate/20111201121844_create_roles.rb +12 -0
- data/spec/dummy/db/migrate/20111201155456_create_users.rb +16 -0
- data/spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb +44 -0
- data/spec/dummy/db/migrate/20111201163718_create_user_has_roles.rb +10 -0
- data/spec/dummy/db/migrate/20111217234412_add_save_checkout_history_to_user.rb +5 -0
- data/spec/dummy/db/migrate/20111218002349_add_checkout_icalendar_token_to_user.rb +6 -0
- data/spec/dummy/db/migrate/20111231145823_add_share_bookmarks_to_user.rb +5 -0
- data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +5 -0
- data/spec/dummy/db/migrate/20120105101944_add_queue_to_delayed_jobs.rb +9 -0
- data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +6 -0
- data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +6 -0
- data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +12 -0
- data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +6 -0
- data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +6 -0
- data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120413051535_add_event_import_fingerprint_to_event_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413100431_add_fingerprint_to_inventory_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_patron_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413170720_add_error_message_to_patron_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120413170734_add_error_message_to_event_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120415060308_rename_resource_import_file_imported_at_to_executed_at.rb +9 -0
- data/spec/dummy/db/migrate/20120415060323_rename_patron_import_file_imported_at_to_executed_at.rb +9 -0
- data/spec/dummy/db/migrate/20120415060342_rename_event_import_file_imported_at_to_executed_at.rb +9 -0
- data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120424103932_add_librarian_id_to_checked_item.rb +5 -0
- data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +5 -0
- data/spec/dummy/db/migrate/20120511072422_add_patron_identifier_to_patron.rb +6 -0
- data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_patron_import_file.rb +5 -0
- data/spec/dummy/db/migrate/20120728204337_create_series_statement_relationships.rb +11 -0
- data/spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20121116033446_add_doi_to_manifestation.rb +6 -0
- data/spec/dummy/db/migrate/20121119153944_add_manifestation_id_to_item.rb +5 -0
- data/spec/dummy/db/schema.rb +1240 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/plugins/ext/event-calendar.rb +38 -0
- data/spec/dummy/lib/plugins/ext/sunspot/abstract_search.rb +12 -0
- data/spec/dummy/lib/plugins/ext/sunspot/dismax.rb +41 -0
- data/spec/dummy/lib/plugins/ext/sunspot/start_record.rb +55 -0
- data/spec/dummy/lib/plugins/ext/sunspot.rb +3 -0
- data/spec/dummy/lib/plugins/ext.rb +1 -0
- data/spec/dummy/lib/plugins.rb +2 -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/solr/conf/admin-extra.html +31 -0
- data/spec/dummy/solr/conf/elevate.xml +36 -0
- data/spec/dummy/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
- data/spec/dummy/solr/conf/protwords.txt +21 -0
- data/spec/dummy/solr/conf/schema.xml +251 -0
- data/spec/dummy/solr/conf/scripts.conf +24 -0
- data/spec/dummy/solr/conf/solrconfig.xml +934 -0
- data/spec/dummy/solr/conf/spellings.txt +2 -0
- data/spec/dummy/solr/conf/stopwords.txt +58 -0
- data/spec/dummy/solr/conf/synonyms.txt +31 -0
- data/spec/dummy/solr/data/test/index/_ev.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_ev.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_ev.fnm +7 -0
- data/spec/dummy/solr/data/test/index/_ev.frq +0 -0
- data/spec/dummy/solr/data/test/index/_ev.nrm +1 -0
- data/spec/dummy/solr/data/test/index/_ev.prx +0 -0
- data/spec/dummy/solr/data/test/index/_ev.tii +0 -0
- data/spec/dummy/solr/data/test/index/_ev.tis +0 -0
- data/spec/dummy/solr/data/test/index/_ew.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_ew.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_ew.fnm +7 -0
- data/spec/dummy/solr/data/test/index/_ew.frq +0 -0
- data/spec/dummy/solr/data/test/index/_ew.nrm +1 -0
- data/spec/dummy/solr/data/test/index/_ew.prx +0 -0
- data/spec/dummy/solr/data/test/index/_ew.tii +0 -0
- data/spec/dummy/solr/data/test/index/_ew.tis +0 -0
- data/spec/dummy/solr/data/test/index/_ex.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_ex.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_ex.fnm +8 -0
- data/spec/dummy/solr/data/test/index/_ex.frq +0 -0
- data/spec/dummy/solr/data/test/index/_ex.nrm +1 -0
- data/spec/dummy/solr/data/test/index/_ex.prx +0 -0
- data/spec/dummy/solr/data/test/index/_ex.tii +0 -0
- data/spec/dummy/solr/data/test/index/_ex.tis +0 -0
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/segments_jz +0 -0
- data/spec/dummy/solr/data/test/spellchecker/segments.gen +0 -0
- data/spec/dummy/solr/data/test/spellchecker/segments_1 +0 -0
- data/spec/dummy/tmp/cache/4F7/F90/default_role +0 -0
- data/spec/dummy/tmp/cache/6E4/420/search_engine_all +0 -0
- data/spec/factories/basket.rb +5 -0
- data/spec/factories/carrier_type.rb +5 -0
- data/spec/factories/content_type.rb +5 -0
- data/spec/factories/country.rb +8 -0
- data/spec/factories/create.rb +6 -0
- data/spec/factories/create_types.rb +9 -0
- data/spec/factories/donate.rb +6 -0
- data/spec/factories/exemplify.rb +6 -0
- data/spec/factories/extent.rb +5 -0
- data/spec/factories/form_of_work.rb +5 -0
- data/spec/factories/frequency.rb +5 -0
- data/spec/factories/import_request.rb +5 -0
- data/spec/factories/item.rb +7 -0
- data/spec/factories/language.rb +8 -0
- data/spec/factories/license.rb +5 -0
- data/spec/factories/manifestation.rb +6 -0
- data/spec/factories/manifestation_relationship.rb +6 -0
- data/spec/factories/manifestation_relationship_type.rb +5 -0
- data/spec/factories/medium_of_performance.rb +5 -0
- data/spec/factories/own.rb +6 -0
- data/spec/factories/patron.rb +13 -0
- data/spec/factories/patron_relationship.rb +6 -0
- data/spec/factories/patron_relationship_type.rb +5 -0
- data/spec/factories/patron_type.rb +5 -0
- data/spec/factories/produce.rb +6 -0
- data/spec/factories/produce_types.rb +9 -0
- data/spec/factories/realize.rb +6 -0
- data/spec/factories/realize_types.rb +9 -0
- data/spec/factories/series_has_manifestation.rb +6 -0
- data/spec/factories/series_statement.rb +5 -0
- data/spec/factories/series_statement_relationship.rb +8 -0
- data/spec/factories/user.rb +37 -0
- data/spec/fixtures/baskets.yml +80 -0
- data/spec/fixtures/bookstores.yml +107 -0
- data/spec/fixtures/budget_types.yml +29 -0
- data/spec/fixtures/carrier_types.yml +51 -0
- data/spec/fixtures/content_types.yml +36 -0
- data/spec/fixtures/countries.yml +2059 -0
- data/spec/fixtures/create_types.yml +47 -0
- data/spec/fixtures/creates.yml +64 -0
- data/spec/fixtures/donates.yml +31 -0
- data/spec/fixtures/exemplifies.yml +160 -0
- data/spec/fixtures/extents.yml +29 -0
- data/spec/fixtures/form_of_works.yml +39 -0
- data/spec/fixtures/frequencies.yml +85 -0
- data/spec/fixtures/import_requests.yml +27 -0
- data/spec/fixtures/items.yml +259 -0
- data/spec/fixtures/languages.yml +1901 -0
- data/spec/fixtures/libraries.yml +102 -0
- data/spec/fixtures/library_groups.yml +33 -0
- data/spec/fixtures/licenses.yml +29 -0
- data/spec/fixtures/manifestation_relationship_types.yml +29 -0
- data/spec/fixtures/manifestation_relationships.yml +30 -0
- data/spec/fixtures/manifestations.yml +2022 -0
- data/spec/fixtures/medium_of_performances.yml +29 -0
- data/spec/fixtures/owns.yml +26 -0
- data/spec/fixtures/patron_import_files.yml +47 -0
- data/spec/fixtures/patron_import_results.yml +29 -0
- data/spec/fixtures/patron_relationship_types.yml +34 -0
- data/spec/fixtures/patron_relationships.yml +25 -0
- data/spec/fixtures/patron_types.yml +35 -0
- data/spec/fixtures/patrons.yml +334 -0
- data/spec/fixtures/picture_files.yml +63 -0
- data/spec/fixtures/produce_types.yml +31 -0
- data/spec/fixtures/produces.yml +148 -0
- data/spec/fixtures/realize_types.yml +39 -0
- data/spec/fixtures/realizes.yml +85 -0
- data/spec/fixtures/request_status_types.yml +63 -0
- data/spec/fixtures/request_types.yml +55 -0
- data/spec/fixtures/resource_import_files.yml +47 -0
- data/spec/fixtures/resource_import_results.yml +29 -0
- data/spec/fixtures/roles.yml +21 -0
- data/spec/fixtures/series_has_manifestations.yml +35 -0
- data/spec/fixtures/series_statements.yml +45 -0
- data/spec/fixtures/shelves.yml +47 -0
- data/spec/fixtures/user_groups.yml +51 -0
- data/spec/fixtures/user_has_roles.yml +41 -0
- data/spec/fixtures/users.yml +106 -0
- data/spec/spec_helper.rb +53 -0
- data/spec/support/controller_macros.rb +46 -0
- data/spec/support/devise.rb +4 -0
- data/vendor/assets/javascripts/jquery.mobile-1.3.0.js +11092 -0
- data/vendor/assets/stylesheets/jquery.mobile-1.3.0.css +3357 -0
- metadata +942 -0
@@ -0,0 +1,685 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ManifestationsController do
|
4
|
+
fixtures :all
|
5
|
+
|
6
|
+
def valid_attributes
|
7
|
+
FactoryGirl.attributes_for(:manifestation)
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "GET index", :solr => true do
|
11
|
+
before do
|
12
|
+
Manifestation.reindex
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "When logged in as Administrator" do
|
16
|
+
login_admin
|
17
|
+
|
18
|
+
it "assigns all manifestations as @manifestations" do
|
19
|
+
get :index
|
20
|
+
assigns(:manifestations).should_not be_nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe "When logged in as Librarian" do
|
25
|
+
login_librarian
|
26
|
+
|
27
|
+
it "assigns all manifestations as @manifestations" do
|
28
|
+
get :index
|
29
|
+
assigns(:manifestations).should_not be_nil
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe "When logged in as User" do
|
34
|
+
login_user
|
35
|
+
|
36
|
+
it "assigns all manifestations as @manifestations" do
|
37
|
+
get :index
|
38
|
+
assigns(:manifestations).should_not be_nil
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "When not logged in" do
|
43
|
+
it "assigns all manifestations as @manifestations" do
|
44
|
+
get :index
|
45
|
+
assigns(:manifestations).should_not be_nil
|
46
|
+
end
|
47
|
+
|
48
|
+
it "assigns all manifestations as @manifestations in xml format without operation" do
|
49
|
+
get :index, :format => 'xml'
|
50
|
+
response.should be_success
|
51
|
+
assigns(:manifestations).should_not be_nil
|
52
|
+
end
|
53
|
+
|
54
|
+
it "assigns all manifestations as @manifestations in csv format without operation" do
|
55
|
+
get :index, :format => 'csv'
|
56
|
+
response.should be_success
|
57
|
+
assigns(:manifestations).should_not be_nil
|
58
|
+
response.should render_template('manifestations/index')
|
59
|
+
end
|
60
|
+
|
61
|
+
it "assigns all manifestations as @manifestations in sru format without operation" do
|
62
|
+
get :index, :format => 'sru'
|
63
|
+
assert_response :success
|
64
|
+
assigns(:manifestations).should be_nil
|
65
|
+
response.should render_template('manifestations/explain')
|
66
|
+
end
|
67
|
+
|
68
|
+
it "assigns all manifestations as @manifestations in sru format with operation" do
|
69
|
+
get :index, :format => 'sru', :operation => 'searchRetrieve', :query => 'ruby'
|
70
|
+
assigns(:manifestations).should_not be_nil
|
71
|
+
response.should render_template('manifestations/index')
|
72
|
+
end
|
73
|
+
|
74
|
+
it "assigns all manifestations as @manifestations in sru format with operation and title" do
|
75
|
+
get :index, :format => 'sru', :query => 'title=ruby', :operation => 'searchRetrieve'
|
76
|
+
assigns(:manifestations).should_not be_nil
|
77
|
+
response.should render_template('manifestations/index')
|
78
|
+
end
|
79
|
+
|
80
|
+
it "assigns all manifestations as @manifestations in openurl" do
|
81
|
+
get :index, :api => 'openurl', :title => 'ruby'
|
82
|
+
assigns(:manifestations).should_not be_nil
|
83
|
+
end
|
84
|
+
|
85
|
+
it "assigns all manifestations as @manifestations when pub_date_from and pub_date_to are specified" do
|
86
|
+
get :index, :pub_date_from => '2000', :pub_date_to => '2007'
|
87
|
+
assigns(:query).should eq "date_of_publication_d:[#{Time.zone.parse('2000-01-01').utc.iso8601} TO #{Time.zone.parse('2007-12-31').end_of_year.utc.iso8601}]"
|
88
|
+
assigns(:manifestations).should_not be_nil
|
89
|
+
end
|
90
|
+
|
91
|
+
it "assigns all manifestations as @manifestations when acquired_from and pub_date_to are specified" do
|
92
|
+
get :index, :acquired_from => '2000', :acquired_to => '2007'
|
93
|
+
assigns(:query).should eq "acquired_at_d:[#{Time.zone.parse('2000-01-01').utc.iso8601} TO #{Time.zone.parse('2007-12-31').end_of_day.utc.iso8601}]"
|
94
|
+
assigns(:manifestations).should_not be_nil
|
95
|
+
end
|
96
|
+
|
97
|
+
it "assigns all manifestations as @manifestations when number_of_pages_at_least and number_of_pages_at_most are specified" do
|
98
|
+
get :index, :number_of_pages_at_least => '100', :number_of_pages_at_least => '200'
|
99
|
+
assigns(:manifestations).should_not be_nil
|
100
|
+
end
|
101
|
+
|
102
|
+
it "assigns all manifestations as @manifestations in mods format" do
|
103
|
+
get :index, :format => 'mods'
|
104
|
+
assigns(:manifestations).should_not be_nil
|
105
|
+
response.should render_template("manifestations/index")
|
106
|
+
end
|
107
|
+
|
108
|
+
it "assigns all manifestations as @manifestations in rdf format" do
|
109
|
+
get :index, :format => 'rdf'
|
110
|
+
assigns(:manifestations).should_not be_nil
|
111
|
+
response.should render_template("manifestations/index")
|
112
|
+
end
|
113
|
+
|
114
|
+
it "should get index with manifestation_id" do
|
115
|
+
get :index, :manifestation_id => 1
|
116
|
+
response.should be_success
|
117
|
+
assigns(:manifestation).should eq Manifestation.find(1)
|
118
|
+
assigns(:manifestations).collect(&:id).should eq assigns(:manifestation).derived_manifestations.collect(&:id)
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should get index with publisher_id" do
|
122
|
+
get :index, :publisher_id => 1
|
123
|
+
response.should be_success
|
124
|
+
assigns(:manifestations).collect(&:id).should eq Patron.find(1).manifestations.order('created_at DESC').collect(&:id)
|
125
|
+
end
|
126
|
+
|
127
|
+
it "should get index with query" do
|
128
|
+
get :index, :query => '2005'
|
129
|
+
response.should be_success
|
130
|
+
assigns(:manifestations).should_not be_blank
|
131
|
+
end
|
132
|
+
|
133
|
+
it "should get index with page number" do
|
134
|
+
get :index, :query => '2005', :number_of_pages_at_least => 1, :number_of_pages_at_most => 100
|
135
|
+
response.should be_success
|
136
|
+
assigns(:query).should eq '2005 number_of_pages_i:[1 TO 100]'
|
137
|
+
end
|
138
|
+
|
139
|
+
it "should get index with pub_date_from" do
|
140
|
+
get :index, :query => '2005', :pub_date_from => '2000'
|
141
|
+
response.should be_success
|
142
|
+
assigns(:manifestations).should be_true
|
143
|
+
assigns(:query).should eq '2005 date_of_publication_d:[1999-12-31T15:00:00Z TO *]'
|
144
|
+
end
|
145
|
+
|
146
|
+
it "should get index with pub_date_to" do
|
147
|
+
get :index, :query => '2005', :pub_date_to => '2000'
|
148
|
+
response.should be_success
|
149
|
+
assigns(:manifestations).should be_true
|
150
|
+
assigns(:query).should eq '2005 date_of_publication_d:[* TO 2000-12-31T14:59:59Z]'
|
151
|
+
end
|
152
|
+
|
153
|
+
it "should get index_all_facet" do
|
154
|
+
get :index, :query => '2005', :view => 'all_facet'
|
155
|
+
response.should be_success
|
156
|
+
assigns(:carrier_type_facet).should_not be_empty
|
157
|
+
assigns(:language_facet).should_not be_empty
|
158
|
+
assigns(:library_facet).should_not be_empty
|
159
|
+
end
|
160
|
+
|
161
|
+
it "should get index_carrier_type_facet" do
|
162
|
+
get :index, :query => '2005', :view => 'carrier_type_facet'
|
163
|
+
response.should be_success
|
164
|
+
assigns(:carrier_type_facet).should_not be_empty
|
165
|
+
end
|
166
|
+
|
167
|
+
it "should get index_language_facet" do
|
168
|
+
get :index, :query => '2005', :view => 'language_facet'
|
169
|
+
response.should be_success
|
170
|
+
assigns(:language_facet).should_not be_empty
|
171
|
+
end
|
172
|
+
|
173
|
+
it "should get index_library_facet" do
|
174
|
+
get :index, :query => '2005', :view => 'library_facet'
|
175
|
+
response.should be_success
|
176
|
+
assigns(:library_facet).should_not be_empty
|
177
|
+
end
|
178
|
+
|
179
|
+
it "should get index_pub_year_facet" do
|
180
|
+
get :index, :view => 'pub_year_facet'
|
181
|
+
response.should be_success
|
182
|
+
assigns(:pub_year_facet).first.value.should eq 2010.0..2020.0
|
183
|
+
assigns(:pub_year_facet).first.count.should eq 1
|
184
|
+
assigns(:pub_year_facet).last.value.should eq 2000.0..2010.0
|
185
|
+
assigns(:pub_year_facet).last.count.should eq 1
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
describe "GET show" do
|
191
|
+
describe "When logged in as Administrator" do
|
192
|
+
login_admin
|
193
|
+
|
194
|
+
it "assigns the requested manifestation as @manifestation" do
|
195
|
+
get :show, :id => 1
|
196
|
+
assigns(:manifestation).should eq(Manifestation.find(1))
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
describe "When logged in as Librarian" do
|
201
|
+
login_librarian
|
202
|
+
|
203
|
+
it "assigns the requested manifestation as @manifestation" do
|
204
|
+
get :show, :id => 1
|
205
|
+
assigns(:manifestation).should eq(Manifestation.find(1))
|
206
|
+
end
|
207
|
+
|
208
|
+
it "should show manifestation with patron who does not produce it" do
|
209
|
+
get :show, :id => 3, :patron_id => 3
|
210
|
+
assigns(:manifestation).should eq assigns(:patron).manifestations.find(3)
|
211
|
+
response.should be_success
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
describe "When logged in as User" do
|
216
|
+
login_fixture_user
|
217
|
+
|
218
|
+
it "assigns the requested manifestation as @manifestation" do
|
219
|
+
get :show, :id => 1
|
220
|
+
assigns(:manifestation).should eq(Manifestation.find(1))
|
221
|
+
end
|
222
|
+
|
223
|
+
it "should send manifestation detail email" do
|
224
|
+
get :show, :id => 1, :mode => 'send_email'
|
225
|
+
response.should redirect_to manifestation_url(assigns(:manifestation))
|
226
|
+
end
|
227
|
+
|
228
|
+
#it "should show myself" do
|
229
|
+
# get :show, :id => users(:user1).patron
|
230
|
+
# response.should be_success
|
231
|
+
#end
|
232
|
+
end
|
233
|
+
|
234
|
+
describe "When not logged in" do
|
235
|
+
it "assigns the requested manifestation as @manifestation" do
|
236
|
+
get :show, :id => 1
|
237
|
+
assigns(:manifestation).should eq(Manifestation.find(1))
|
238
|
+
end
|
239
|
+
|
240
|
+
it "guest should show manifestation mods template" do
|
241
|
+
get :show, :id => 22, :format => 'mods'
|
242
|
+
assigns(:manifestation).should eq Manifestation.find(22)
|
243
|
+
response.should render_template("manifestations/show")
|
244
|
+
end
|
245
|
+
|
246
|
+
it "should show manifestation rdf template" do
|
247
|
+
get :show, :id => 22, :format => 'rdf'
|
248
|
+
assigns(:manifestation).should eq Manifestation.find(22)
|
249
|
+
response.should render_template("manifestations/show")
|
250
|
+
end
|
251
|
+
|
252
|
+
it "should show_manifestation with isbn" do
|
253
|
+
get :show, :isbn => "4798002062"
|
254
|
+
response.should redirect_to manifestation_url(assigns(:manifestation))
|
255
|
+
end
|
256
|
+
|
257
|
+
it "should not show missing manifestation with isbn" do
|
258
|
+
get :show, :isbn => "47980020620"
|
259
|
+
response.should be_missing
|
260
|
+
end
|
261
|
+
|
262
|
+
it "should show manifestation with holding" do
|
263
|
+
get :show, :id => 1, :mode => 'holding'
|
264
|
+
response.should be_success
|
265
|
+
end
|
266
|
+
|
267
|
+
it "should show manifestation with show_creators" do
|
268
|
+
get :show, :id => 1, :mode => 'show_creators'
|
269
|
+
response.should render_template('manifestations/_show_creators')
|
270
|
+
response.should be_success
|
271
|
+
end
|
272
|
+
|
273
|
+
it "should show manifestation with show_all_creators" do
|
274
|
+
get :show, :id => 1, :mode => 'show_all_creators'
|
275
|
+
response.should render_template('manifestations/_show_creators')
|
276
|
+
response.should be_success
|
277
|
+
end
|
278
|
+
|
279
|
+
it "should not send manifestation's detail email" do
|
280
|
+
get :show, :id => 1, :mode => 'send_email'
|
281
|
+
response.should redirect_to new_user_session_url
|
282
|
+
end
|
283
|
+
end
|
284
|
+
end
|
285
|
+
|
286
|
+
describe "GET new" do
|
287
|
+
describe "When logged in as Administrator" do
|
288
|
+
login_admin
|
289
|
+
|
290
|
+
it "assigns the requested manifestation as @manifestation" do
|
291
|
+
get :new
|
292
|
+
assigns(:manifestation).should_not be_valid
|
293
|
+
end
|
294
|
+
|
295
|
+
it "should get new template without expression_id" do
|
296
|
+
get :new
|
297
|
+
response.should be_success
|
298
|
+
end
|
299
|
+
|
300
|
+
it "should get new template with expression_id" do
|
301
|
+
get :new, :expression_id => 1
|
302
|
+
response.should be_success
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
describe "When logged in as Librarian" do
|
307
|
+
login_librarian
|
308
|
+
|
309
|
+
it "assigns the requested manifestation as @manifestation" do
|
310
|
+
get :new
|
311
|
+
assigns(:manifestation).should_not be_valid
|
312
|
+
end
|
313
|
+
|
314
|
+
it "should get new template without expression_id" do
|
315
|
+
get :new
|
316
|
+
response.should be_success
|
317
|
+
end
|
318
|
+
|
319
|
+
it "should get new template with expression_id" do
|
320
|
+
get :new, :expression_id => 1
|
321
|
+
response.should be_success
|
322
|
+
end
|
323
|
+
end
|
324
|
+
|
325
|
+
describe "When logged in as User" do
|
326
|
+
login_user
|
327
|
+
|
328
|
+
it "should not assign the requested manifestation as @manifestation" do
|
329
|
+
get :new
|
330
|
+
assigns(:manifestation).should_not be_valid
|
331
|
+
response.should be_forbidden
|
332
|
+
end
|
333
|
+
end
|
334
|
+
|
335
|
+
describe "When not logged in" do
|
336
|
+
it "should not assign the requested manifestation as @manifestation" do
|
337
|
+
get :new
|
338
|
+
assigns(:manifestation).should_not be_valid
|
339
|
+
response.should redirect_to(new_user_session_url)
|
340
|
+
end
|
341
|
+
end
|
342
|
+
end
|
343
|
+
|
344
|
+
describe "GET edit" do
|
345
|
+
describe "When logged in as Administrator" do
|
346
|
+
login_admin
|
347
|
+
|
348
|
+
it "assigns the requested manifestation as @manifestation" do
|
349
|
+
manifestation = FactoryGirl.create(:manifestation)
|
350
|
+
get :edit, :id => manifestation.id
|
351
|
+
assigns(:manifestation).should eq(manifestation)
|
352
|
+
end
|
353
|
+
end
|
354
|
+
|
355
|
+
describe "When logged in as Librarian" do
|
356
|
+
login_librarian
|
357
|
+
|
358
|
+
it "assigns the requested manifestation as @manifestation" do
|
359
|
+
manifestation = FactoryGirl.create(:manifestation)
|
360
|
+
get :edit, :id => manifestation.id
|
361
|
+
assigns(:manifestation).should eq(manifestation)
|
362
|
+
end
|
363
|
+
end
|
364
|
+
|
365
|
+
describe "When logged in as User" do
|
366
|
+
login_user
|
367
|
+
|
368
|
+
it "assigns the requested manifestation as @manifestation" do
|
369
|
+
manifestation = FactoryGirl.create(:manifestation)
|
370
|
+
get :edit, :id => manifestation.id
|
371
|
+
response.should be_forbidden
|
372
|
+
end
|
373
|
+
|
374
|
+
it "should edit manifestation with tag_edit" do
|
375
|
+
get :edit, :id => 1, :mode => 'tag_edit'
|
376
|
+
response.should be_success
|
377
|
+
end
|
378
|
+
end
|
379
|
+
|
380
|
+
describe "When not logged in" do
|
381
|
+
it "should not assign the requested manifestation as @manifestation" do
|
382
|
+
manifestation = FactoryGirl.create(:manifestation)
|
383
|
+
get :edit, :id => manifestation.id
|
384
|
+
response.should redirect_to(new_user_session_url)
|
385
|
+
end
|
386
|
+
end
|
387
|
+
end
|
388
|
+
|
389
|
+
describe "POST create" do
|
390
|
+
before(:each) do
|
391
|
+
@attrs = valid_attributes
|
392
|
+
@invalid_attrs = {:original_title => ''}
|
393
|
+
end
|
394
|
+
|
395
|
+
describe "When logged in as Administrator" do
|
396
|
+
login_admin
|
397
|
+
|
398
|
+
describe "with valid params" do
|
399
|
+
it "assigns a newly created manifestation as @manifestation" do
|
400
|
+
post :create, :manifestation => @attrs
|
401
|
+
assigns(:manifestation).should be_valid
|
402
|
+
end
|
403
|
+
|
404
|
+
it "assigns a series_statement" do
|
405
|
+
post :create, :manifestation => @attrs.merge(:series_has_manifestation_attributes => {:series_statement_id => 1})
|
406
|
+
assigns(:manifestation).reload
|
407
|
+
assigns(:manifestation).series_statement.should eq SeriesStatement.find(1)
|
408
|
+
end
|
409
|
+
|
410
|
+
it "redirects to the created manifestation" do
|
411
|
+
post :create, :manifestation => @attrs
|
412
|
+
response.should redirect_to(manifestation_url(assigns(:manifestation)))
|
413
|
+
end
|
414
|
+
end
|
415
|
+
|
416
|
+
describe "with invalid params" do
|
417
|
+
it "assigns a newly created but unsaved manifestation as @manifestation" do
|
418
|
+
post :create, :manifestation => @invalid_attrs
|
419
|
+
assigns(:manifestation).should_not be_valid
|
420
|
+
end
|
421
|
+
|
422
|
+
it "re-renders the 'new' template" do
|
423
|
+
post :create, :manifestation => @invalid_attrs
|
424
|
+
response.should render_template("new")
|
425
|
+
end
|
426
|
+
end
|
427
|
+
end
|
428
|
+
|
429
|
+
describe "When logged in as Librarian" do
|
430
|
+
login_librarian
|
431
|
+
|
432
|
+
describe "with valid params" do
|
433
|
+
it "assigns a newly created manifestation as @manifestation" do
|
434
|
+
post :create, :manifestation => @attrs
|
435
|
+
assigns(:manifestation).should be_valid
|
436
|
+
end
|
437
|
+
|
438
|
+
it "redirects to the created manifestation" do
|
439
|
+
post :create, :manifestation => @attrs
|
440
|
+
response.should redirect_to(manifestation_url(assigns(:manifestation)))
|
441
|
+
end
|
442
|
+
end
|
443
|
+
|
444
|
+
describe "with invalid params" do
|
445
|
+
it "assigns a newly created but unsaved manifestation as @manifestation" do
|
446
|
+
post :create, :manifestation => @invalid_attrs
|
447
|
+
assigns(:manifestation).should_not be_valid
|
448
|
+
end
|
449
|
+
|
450
|
+
it "re-renders the 'new' template" do
|
451
|
+
post :create, :manifestation => @invalid_attrs
|
452
|
+
response.should render_template("new")
|
453
|
+
end
|
454
|
+
end
|
455
|
+
end
|
456
|
+
|
457
|
+
describe "When logged in as User" do
|
458
|
+
login_user
|
459
|
+
|
460
|
+
describe "with valid params" do
|
461
|
+
it "assigns a newly created manifestation as @manifestation" do
|
462
|
+
post :create, :manifestation => @attrs
|
463
|
+
assigns(:manifestation).should be_valid
|
464
|
+
end
|
465
|
+
|
466
|
+
it "should be forbidden" do
|
467
|
+
post :create, :manifestation => @attrs
|
468
|
+
response.should be_forbidden
|
469
|
+
end
|
470
|
+
end
|
471
|
+
|
472
|
+
describe "with invalid params" do
|
473
|
+
it "assigns a newly created but unsaved manifestation as @manifestation" do
|
474
|
+
post :create, :manifestation => @invalid_attrs
|
475
|
+
assigns(:manifestation).should_not be_valid
|
476
|
+
end
|
477
|
+
|
478
|
+
it "should be forbidden" do
|
479
|
+
post :create, :manifestation => @invalid_attrs
|
480
|
+
response.should be_forbidden
|
481
|
+
end
|
482
|
+
end
|
483
|
+
end
|
484
|
+
|
485
|
+
describe "When not logged in" do
|
486
|
+
describe "with valid params" do
|
487
|
+
it "assigns a newly created manifestation as @manifestation" do
|
488
|
+
post :create, :manifestation => @attrs
|
489
|
+
assigns(:manifestation).should be_valid
|
490
|
+
end
|
491
|
+
|
492
|
+
it "should be forbidden" do
|
493
|
+
post :create, :manifestation => @attrs
|
494
|
+
response.should redirect_to(new_user_session_url)
|
495
|
+
end
|
496
|
+
end
|
497
|
+
|
498
|
+
describe "with invalid params" do
|
499
|
+
it "assigns a newly created but unsaved manifestation as @manifestation" do
|
500
|
+
post :create, :manifestation => @invalid_attrs
|
501
|
+
assigns(:manifestation).should_not be_valid
|
502
|
+
end
|
503
|
+
|
504
|
+
it "should be forbidden" do
|
505
|
+
post :create, :manifestation => @invalid_attrs
|
506
|
+
response.should redirect_to(new_user_session_url)
|
507
|
+
end
|
508
|
+
end
|
509
|
+
end
|
510
|
+
end
|
511
|
+
|
512
|
+
describe "PUT update" do
|
513
|
+
before(:each) do
|
514
|
+
@manifestation = FactoryGirl.create(:manifestation)
|
515
|
+
@manifestation.series_statement = SeriesStatement.find(1)
|
516
|
+
@attrs = valid_attributes
|
517
|
+
@invalid_attrs = {:original_title => ''}
|
518
|
+
end
|
519
|
+
|
520
|
+
describe "When logged in as Administrator" do
|
521
|
+
login_admin
|
522
|
+
|
523
|
+
describe "with valid params" do
|
524
|
+
it "updates the requested manifestation" do
|
525
|
+
put :update, :id => @manifestation.id, :manifestation => @attrs
|
526
|
+
end
|
527
|
+
|
528
|
+
it "assigns a series_statement" do
|
529
|
+
put :update, :id => @manifestation.id, :manifestation => @attrs.merge(:series_has_manifestation_attributes => {:series_statement_id => 2})
|
530
|
+
assigns(:manifestation).reload
|
531
|
+
assigns(:manifestation).series_statement.should eq SeriesStatement.find(2)
|
532
|
+
end
|
533
|
+
|
534
|
+
it "assigns the requested manifestation as @manifestation" do
|
535
|
+
put :update, :id => @manifestation.id, :manifestation => @attrs
|
536
|
+
assigns(:manifestation).should eq(@manifestation)
|
537
|
+
end
|
538
|
+
end
|
539
|
+
|
540
|
+
describe "with invalid params" do
|
541
|
+
it "assigns the requested manifestation as @manifestation" do
|
542
|
+
put :update, :id => @manifestation.id, :manifestation => @invalid_attrs
|
543
|
+
response.should render_template("edit")
|
544
|
+
end
|
545
|
+
end
|
546
|
+
end
|
547
|
+
|
548
|
+
describe "When logged in as Librarian" do
|
549
|
+
login_librarian
|
550
|
+
|
551
|
+
describe "with valid params" do
|
552
|
+
it "updates the requested manifestation" do
|
553
|
+
put :update, :id => @manifestation.id, :manifestation => @attrs
|
554
|
+
end
|
555
|
+
|
556
|
+
it "assigns the requested manifestation as @manifestation" do
|
557
|
+
put :update, :id => @manifestation.id, :manifestation => @attrs
|
558
|
+
assigns(:manifestation).should eq(@manifestation)
|
559
|
+
response.should redirect_to(@manifestation)
|
560
|
+
end
|
561
|
+
end
|
562
|
+
|
563
|
+
describe "with invalid params" do
|
564
|
+
it "assigns the manifestation as @manifestation" do
|
565
|
+
put :update, :id => @manifestation, :manifestation => @invalid_attrs
|
566
|
+
assigns(:manifestation).should_not be_valid
|
567
|
+
end
|
568
|
+
|
569
|
+
it "re-renders the 'edit' template" do
|
570
|
+
put :update, :id => @manifestation, :manifestation => @invalid_attrs
|
571
|
+
response.should render_template("edit")
|
572
|
+
end
|
573
|
+
end
|
574
|
+
end
|
575
|
+
|
576
|
+
describe "When logged in as User" do
|
577
|
+
login_user
|
578
|
+
|
579
|
+
describe "with valid params" do
|
580
|
+
it "updates the requested manifestation" do
|
581
|
+
put :update, :id => @manifestation.id, :manifestation => @attrs
|
582
|
+
end
|
583
|
+
|
584
|
+
it "assigns the requested manifestation as @manifestation" do
|
585
|
+
put :update, :id => @manifestation.id, :manifestation => @attrs
|
586
|
+
assigns(:manifestation).should eq(@manifestation)
|
587
|
+
response.should be_forbidden
|
588
|
+
end
|
589
|
+
end
|
590
|
+
|
591
|
+
describe "with invalid params" do
|
592
|
+
it "assigns the requested manifestation as @manifestation" do
|
593
|
+
put :update, :id => @manifestation.id, :manifestation => @invalid_attrs
|
594
|
+
response.should be_forbidden
|
595
|
+
end
|
596
|
+
end
|
597
|
+
end
|
598
|
+
|
599
|
+
describe "When not logged in" do
|
600
|
+
describe "with valid params" do
|
601
|
+
it "updates the requested manifestation" do
|
602
|
+
put :update, :id => @manifestation.id, :manifestation => @attrs
|
603
|
+
end
|
604
|
+
|
605
|
+
it "should be forbidden" do
|
606
|
+
put :update, :id => @manifestation.id, :manifestation => @attrs
|
607
|
+
response.should redirect_to(new_user_session_url)
|
608
|
+
end
|
609
|
+
end
|
610
|
+
|
611
|
+
describe "with invalid params" do
|
612
|
+
it "assigns the requested manifestation as @manifestation" do
|
613
|
+
put :update, :id => @manifestation.id, :manifestation => @invalid_attrs
|
614
|
+
response.should redirect_to(new_user_session_url)
|
615
|
+
end
|
616
|
+
end
|
617
|
+
end
|
618
|
+
end
|
619
|
+
|
620
|
+
describe "DELETE destroy" do
|
621
|
+
before(:each) do
|
622
|
+
@manifestation = FactoryGirl.create(:manifestation)
|
623
|
+
end
|
624
|
+
|
625
|
+
describe "When logged in as Administrator" do
|
626
|
+
login_admin
|
627
|
+
|
628
|
+
it "destroys the requested manifestation" do
|
629
|
+
delete :destroy, :id => @manifestation.id
|
630
|
+
end
|
631
|
+
|
632
|
+
it "redirects to the manifestations list" do
|
633
|
+
delete :destroy, :id => @manifestation.id
|
634
|
+
response.should redirect_to(manifestations_url)
|
635
|
+
end
|
636
|
+
|
637
|
+
it "should not destroy the reserved manifestation" do
|
638
|
+
delete :destroy, :id => 2
|
639
|
+
response.should be_forbidden
|
640
|
+
end
|
641
|
+
|
642
|
+
it "should not destroy manifestation contains items" do
|
643
|
+
delete :destroy, :id => 1
|
644
|
+
response.should be_forbidden
|
645
|
+
end
|
646
|
+
end
|
647
|
+
|
648
|
+
describe "When logged in as Librarian" do
|
649
|
+
login_librarian
|
650
|
+
|
651
|
+
it "destroys the requested manifestation" do
|
652
|
+
delete :destroy, :id => @manifestation.id
|
653
|
+
end
|
654
|
+
|
655
|
+
it "should be forbidden" do
|
656
|
+
delete :destroy, :id => @manifestation.id
|
657
|
+
response.should redirect_to(manifestations_url)
|
658
|
+
end
|
659
|
+
end
|
660
|
+
|
661
|
+
describe "When logged in as User" do
|
662
|
+
login_user
|
663
|
+
|
664
|
+
it "destroys the requested manifestation" do
|
665
|
+
delete :destroy, :id => @manifestation.id
|
666
|
+
end
|
667
|
+
|
668
|
+
it "should be forbidden" do
|
669
|
+
delete :destroy, :id => @manifestation.id
|
670
|
+
response.should be_forbidden
|
671
|
+
end
|
672
|
+
end
|
673
|
+
|
674
|
+
describe "When not logged in" do
|
675
|
+
it "destroys the requested manifestation" do
|
676
|
+
delete :destroy, :id => @manifestation.id
|
677
|
+
end
|
678
|
+
|
679
|
+
it "should be forbidden" do
|
680
|
+
delete :destroy, :id => @manifestation.id
|
681
|
+
response.should redirect_to(new_user_session_url)
|
682
|
+
end
|
683
|
+
end
|
684
|
+
end
|
685
|
+
end
|