enju_biblio 0.1.3 → 0.2.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +3 -3
- data/app/controllers/agent_import_files_controller.rb +13 -3
- data/app/controllers/agent_import_results_controller.rb +12 -1
- data/app/controllers/agent_merge_lists_controller.rb +11 -1
- data/app/controllers/agent_merges_controller.rb +12 -2
- data/app/controllers/agent_relationship_types_controller.rb +13 -2
- data/app/controllers/agent_relationships_controller.rb +13 -4
- data/app/controllers/agent_types_controller.rb +13 -2
- data/app/controllers/agents_controller.rb +18 -12
- data/app/controllers/carrier_types_controller.rb +12 -2
- data/app/controllers/concerns/enju_biblio/controller.rb +99 -0
- data/app/controllers/content_types_controller.rb +12 -1
- data/app/controllers/countries_controller.rb +12 -1
- data/app/controllers/create_types_controller.rb +13 -2
- data/app/controllers/creates_controller.rb +13 -4
- data/app/controllers/donates_controller.rb +11 -1
- data/app/controllers/form_of_works_controller.rb +13 -2
- data/app/controllers/frequencies_controller.rb +13 -2
- data/app/controllers/identifier_types_controller.rb +13 -2
- data/app/controllers/import_requests_controller.rb +19 -9
- data/app/controllers/items_controller.rb +25 -13
- data/app/controllers/languages_controller.rb +12 -1
- data/app/controllers/licenses_controller.rb +13 -2
- data/app/controllers/manifestation_relationship_types_controller.rb +12 -1
- data/app/controllers/manifestation_relationships_controller.rb +13 -4
- data/app/controllers/manifestations_controller.rb +58 -30
- data/app/controllers/medium_of_performances_controller.rb +13 -2
- data/app/controllers/owns_controller.rb +12 -3
- data/app/controllers/picture_files_controller.rb +13 -3
- data/app/controllers/produce_types_controller.rb +13 -2
- data/app/controllers/produces_controller.rb +13 -4
- data/app/controllers/realize_types_controller.rb +13 -2
- data/app/controllers/realizes_controller.rb +13 -4
- data/app/controllers/resource_export_files_controller.rb +13 -3
- data/app/controllers/resource_import_files_controller.rb +14 -4
- data/app/controllers/resource_import_results_controller.rb +12 -1
- data/app/controllers/series_statement_merge_lists_controller.rb +11 -1
- data/app/controllers/series_statement_merges_controller.rb +12 -2
- data/app/controllers/series_statements_controller.rb +13 -5
- data/app/helpers/manifestations_helper.rb +8 -8
- data/app/jobs/agent_import_file_job.rb +7 -0
- data/app/jobs/resource_export_file_job.rb +7 -0
- data/app/jobs/resource_import_file_job.rb +7 -0
- data/app/models/agent.rb +23 -1
- data/app/models/agent_import_file.rb +0 -1
- data/app/models/carrier_type.rb +0 -1
- data/app/models/identifier.rb +1 -1
- data/app/models/item.rb +2 -9
- data/app/models/manifestation.rb +180 -75
- data/app/models/picture_file.rb +1 -1
- data/app/models/resource_export_file.rb +5 -3
- data/app/models/resource_import_file.rb +34 -50
- data/app/models/series_statement.rb +8 -1
- data/app/policies/agent_import_file_policy.rb +21 -0
- data/app/policies/agent_import_result_policy.rb +21 -0
- data/app/policies/agent_merge_list_policy.rb +25 -0
- data/app/policies/agent_merge_policy.rb +25 -0
- data/app/policies/agent_policy.rb +30 -0
- data/app/policies/agent_relationship_policy.rb +21 -0
- data/app/policies/agent_relationship_type_policy.rb +21 -0
- data/app/policies/agent_type_policy.rb +23 -0
- data/app/policies/carrier_type_policy.rb +23 -0
- data/app/policies/content_type_policy.rb +23 -0
- data/app/policies/country_policy.rb +21 -0
- data/app/policies/create_policy.rb +21 -0
- data/app/policies/create_type_policy.rb +21 -0
- data/app/policies/donate_policy.rb +21 -0
- data/app/policies/form_of_work_policy.rb +21 -0
- data/app/policies/frequency_policy.rb +23 -0
- data/app/policies/identifier_type_policy.rb +23 -0
- data/app/policies/import_request_policy.rb +21 -0
- data/app/policies/item_policy.rb +27 -0
- data/app/policies/language_policy.rb +21 -0
- data/app/policies/license_policy.rb +21 -0
- data/app/policies/manifestation_policy.rb +67 -0
- data/app/policies/manifestation_relationship_policy.rb +21 -0
- data/app/policies/manifestation_relationship_type_policy.rb +21 -0
- data/app/policies/medium_of_performance_policy.rb +21 -0
- data/app/policies/own_policy.rb +21 -0
- data/app/policies/picture_file_policy.rb +32 -0
- data/app/policies/produce_policy.rb +21 -0
- data/app/policies/produce_type_policy.rb +21 -0
- data/app/policies/realize_policy.rb +21 -0
- data/app/policies/realize_type_policy.rb +21 -0
- data/app/policies/resource_export_file_policy.rb +21 -0
- data/app/policies/resource_import_file_policy.rb +21 -0
- data/app/policies/resource_import_result_policy.rb +21 -0
- data/app/policies/series_statement_merge_list_policy.rb +25 -0
- data/app/policies/series_statement_merge_policy.rb +25 -0
- data/app/policies/series_statement_policy.rb +25 -0
- data/app/views/agent_relationship_types/index.html.erb +4 -4
- data/app/views/agent_types/index.html.erb +4 -4
- data/app/views/agent_types/show.html.erb +1 -1
- data/app/views/agents/_agent.html.erb +2 -2
- data/app/views/agents/_index.html.erb +1 -1
- data/app/views/agents/_index_agent.html.erb +4 -4
- data/app/views/agents/_index_agent_merge_list.html.erb +2 -2
- data/app/views/agents/_index_expression.html.erb +3 -3
- data/app/views/agents/_index_manifestation.html.erb +3 -3
- data/app/views/agents/_index_work.html.erb +3 -3
- data/app/views/agents/edit.html.erb +1 -1
- data/app/views/agents/{index.mobile.erb → index.html+phone.erb} +0 -0
- data/app/views/agents/index.json.jbuilder +5 -0
- data/app/views/agents/index.rss.builder +2 -2
- data/app/views/agents/{show.mobile.erb → show.html+phone.erb} +0 -0
- data/app/views/agents/show.html.erb +3 -3
- data/app/views/carrier_types/_form.html.erb +1 -1
- data/app/views/carrier_types/index.html.erb +4 -4
- data/app/views/carrier_types/show.html.erb +1 -1
- data/app/views/content_types/index.html.erb +4 -4
- data/app/views/content_types/show.html.erb +1 -1
- data/app/views/countries/index.html.erb +3 -3
- data/app/views/countries/show.html.erb +1 -1
- data/app/views/create_types/index.html.erb +4 -4
- data/app/views/creates/_index.html.erb +2 -2
- data/app/views/creates/_index_agent.html.erb +3 -3
- data/app/views/creates/_index_work.html.erb +2 -2
- data/app/views/donates/index.html.erb +2 -2
- data/app/views/form_of_works/index.html.erb +4 -4
- data/app/views/form_of_works/show.html.erb +1 -1
- data/app/views/frequencies/index.html.erb +4 -4
- data/app/views/frequencies/show.html.erb +1 -1
- data/app/views/identifier_types/index.html.erb +4 -4
- data/app/views/identifier_types/show.html.erb +1 -1
- data/app/views/import_requests/index.html.erb +1 -1
- data/app/views/items/{_shelf_picture.mobile.erb → _shelf_picture.html+phone.erb} +0 -0
- data/app/views/items/edit.html.erb +2 -2
- data/app/views/items/{index.mobile.erb → index.html+phone.erb} +1 -1
- data/app/views/items/index.html.erb +2 -2
- data/app/views/items/new.html.erb +1 -5
- data/app/views/items/{show.mobile.erb → show.html+phone.erb} +0 -0
- data/app/views/items/show.html.erb +10 -6
- data/app/views/languages/index.html.erb +3 -3
- data/app/views/languages/show.html.erb +1 -1
- data/app/views/layouts/{agents.mobile.erb → agents.html+phone.erb} +1 -1
- data/app/views/layouts/agents.html.erb +2 -2
- data/app/views/layouts/{manifestations.mobile.erb → manifestations.html+phone.erb} +1 -1
- data/app/views/layouts/manifestations.html.erb +2 -2
- data/app/views/licenses/index.html.erb +4 -4
- data/app/views/manifestation_relationship_types/index.html.erb +4 -4
- data/app/views/manifestations/_attachment_file.html.erb +1 -1
- data/app/views/manifestations/_carrier_type_facet.html.erb +1 -1
- data/app/views/manifestations/_classification_facet.html.erb +2 -2
- data/app/views/manifestations/_contributor_fields.html.erb +4 -0
- data/app/views/manifestations/_creator_fields.html.erb +5 -0
- data/app/views/manifestations/_edit_detail.html.erb +1 -1
- data/app/views/manifestations/_export_list.html.erb +3 -3
- data/app/views/manifestations/_form.html.erb +25 -30
- data/app/views/manifestations/_holding.html.erb +6 -8
- data/app/views/manifestations/_identifier_fields.html.erb +5 -0
- data/app/views/manifestations/_index_form_contributor.html.erb +2 -2
- data/app/views/manifestations/_index_form_creator.html.erb +2 -2
- data/app/views/manifestations/_index_form_item.html.erb +2 -2
- data/app/views/manifestations/_index_form_manifestation.html.erb +2 -2
- data/app/views/manifestations/_index_form_parent.html.erb +1 -1
- data/app/views/manifestations/_index_form_publisher.html.erb +2 -2
- data/app/views/manifestations/_index_form_series_statement.html.erb +2 -2
- data/app/views/manifestations/_language_facet.html.erb +1 -1
- data/app/views/manifestations/_library_facet.html.erb +1 -1
- data/app/views/manifestations/_manifestation.html.erb +6 -2
- data/app/views/manifestations/_manifestation.txt.erb +1 -1
- data/app/views/manifestations/_paginate_id_store.html.erb +8 -6
- data/app/views/manifestations/_pub_year_facet.html.erb +1 -1
- data/app/views/manifestations/_publisher_fields.html.erb +4 -0
- data/app/views/manifestations/_reservable_facet.html.erb +2 -2
- data/app/views/manifestations/_series_statement_fields.html.erb +13 -0
- data/app/views/manifestations/_show.rdf.builder +3 -87
- data/app/views/manifestations/{_show_creators.mobile.erb → _show_creators.html+phone.erb} +0 -0
- data/app/views/manifestations/_show_creators.html.erb +0 -1
- data/app/views/manifestations/_show_detail_librarian.html.erb +20 -22
- data/app/views/manifestations/_show_detail_user.html.erb +13 -15
- data/app/views/manifestations/{_show_holding.mobile.erb → _show_holding.html+phone.erb} +0 -0
- data/app/views/manifestations/_show_holding.html.erb +1 -1
- data/app/views/manifestations/{_show_index.mobile.erb → _show_index.html+phone.erb} +0 -0
- data/app/views/manifestations/_submenu_parent.html.erb +3 -3
- data/app/views/manifestations/{_title.mobile.erb → _title.html+phone.erb} +0 -0
- data/app/views/manifestations/edit.html.erb +2 -6
- data/app/views/manifestations/{index.mobile.erb → index.html+phone.erb} +0 -0
- data/app/views/manifestations/index.html.erb +40 -24
- data/app/views/manifestations/index.rdf.builder +5 -3
- data/app/views/manifestations/index.rss.builder +2 -2
- data/app/views/manifestations/index.txt.erb +1 -2
- data/app/views/manifestations/{show.mobile.erb → show.html+phone.erb} +1 -1
- data/app/views/manifestations/show.html.erb +1 -1
- data/app/views/manifestations/show.txt.erb +1 -2
- data/app/views/medium_of_performances/index.html.erb +4 -4
- data/app/views/owns/index.html.erb +2 -2
- data/app/views/picture_files/_index.html.erb +3 -3
- data/app/views/picture_files/_index_agent.html.erb +4 -4
- data/app/views/picture_files/_index_manifestation.html.erb +4 -4
- data/app/views/picture_files/{_link.mobile.erb → _link.html+phone.erb} +0 -0
- data/app/views/picture_files/{show.mobile.erb → show.html+phone.erb} +0 -0
- data/app/views/produce_types/index.html.erb +4 -4
- data/app/views/produces/_index.html.erb +2 -2
- data/app/views/produces/_index_agent.html.erb +2 -2
- data/app/views/produces/_index_manifestation.html.erb +2 -2
- data/app/views/realize_types/index.html.erb +4 -4
- data/app/views/realizes/_index.html.erb +2 -2
- data/app/views/realizes/_index_agent.html.erb +2 -2
- data/app/views/realizes/_index_expression.html.erb +2 -2
- data/app/views/series_statement_merges/show.html.erb +0 -2
- data/app/views/series_statements/_index.html.erb +4 -4
- data/app/views/series_statements/_index_series_statement_merge_list.html.erb +2 -2
- data/app/views/series_statements/show.html.erb +1 -1
- data/config/locales/translation_en.yml +13 -0
- data/config/locales/translation_ja.yml +13 -0
- data/config/routes.rb +3 -43
- data/lib/enju_biblio/engine.rb +0 -1
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/enju_biblio.rb +0 -107
- data/lib/tasks/enju_biblio_tasks.rake +1 -1
- data/spec/cassette_library/ImportRequest/import/should_import_bibliographic_record.yml +43 -43
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_isbn_which_is_already_imported/redirects_to_the_created_import_request.yml +45 -45
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/assigns_a_newly_created_import_request_as_import_request.yml +50 -50
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/redirects_to_the_created_import_request.yml +44 -44
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/assigns_a_newly_created_import_request_as_import_request.yml +48 -48
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/redirects_to_the_created_import_request.yml +41 -41
- data/spec/cassette_library/ResourceImportFile/should_import_in_background.yml +50 -50
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/ISBN_import/with_record_not_found/should_record_an_error_message.yml +49 -49
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_has_only_isbn/should_be_imported.yml +45 -45
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_shift_jis/should_be_imported.yml +50 -50
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_be_imported.yml +48 -48
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_be_searchable_right_after_the_import.yml +512 -0
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_send_message_when_import_is_completed.yml +42 -42
- data/spec/controllers/agent_import_files_controller_spec.rb +5 -5
- data/spec/controllers/agent_import_results_controller_spec.rb +3 -3
- data/spec/controllers/agent_merge_lists_controller_spec.rb +9 -9
- data/spec/controllers/agent_merges_controller_spec.rb +9 -9
- data/spec/controllers/agent_relationship_types_controller_spec.rb +14 -14
- data/spec/controllers/agent_relationships_controller_spec.rb +9 -9
- data/spec/controllers/agent_types_controller_spec.rb +2 -2
- data/spec/controllers/agents_controller_spec.rb +8 -8
- data/spec/controllers/carrier_types_controller_spec.rb +1 -1
- data/spec/controllers/content_types_controller_spec.rb +1 -1
- data/spec/controllers/countries_controller_spec.rb +10 -10
- data/spec/controllers/create_types_controller_spec.rb +2 -2
- data/spec/controllers/creates_controller_spec.rb +7 -7
- data/spec/controllers/donates_controller_spec.rb +9 -9
- data/spec/controllers/form_of_works_controller_spec.rb +2 -2
- data/spec/controllers/frequencies_controller_spec.rb +2 -2
- data/spec/controllers/identifier_types_controller_spec.rb +2 -2
- data/spec/controllers/import_requests_controller_spec.rb +9 -9
- data/spec/controllers/items_controller_spec.rb +13 -7
- data/spec/controllers/languages_controller_spec.rb +8 -8
- data/spec/controllers/licenses_controller_spec.rb +2 -2
- data/spec/controllers/manifestation_relationship_types_controller_spec.rb +10 -10
- data/spec/controllers/manifestation_relationships_controller_spec.rb +9 -9
- data/spec/controllers/manifestations_controller_spec.rb +86 -12
- data/spec/controllers/medium_of_performances_controller_spec.rb +2 -2
- data/spec/controllers/owns_controller_spec.rb +7 -7
- data/spec/controllers/picture_files_controller_spec.rb +9 -9
- data/spec/controllers/produce_types_controller_spec.rb +2 -2
- data/spec/controllers/produces_controller_spec.rb +7 -7
- data/spec/controllers/realize_types_controller_spec.rb +2 -2
- data/spec/controllers/realizes_controller_spec.rb +7 -7
- data/spec/controllers/resource_export_files_controller_spec.rb +9 -15
- data/spec/controllers/resource_import_files_controller_spec.rb +7 -7
- data/spec/controllers/resource_import_results_controller_spec.rb +3 -3
- data/spec/controllers/series_statement_merge_lists_controller_spec.rb +9 -9
- data/spec/controllers/series_statement_merges_controller_spec.rb +9 -9
- data/spec/controllers/series_statements_controller_spec.rb +7 -7
- data/spec/dummy/app/assets/javascripts/application.js +0 -2
- data/spec/dummy/app/controllers/application_controller.rb +10 -6
- data/spec/dummy/app/models/user.rb +4 -4
- data/spec/dummy/config/application.rb +13 -41
- data/spec/dummy/config/environments/development.rb +22 -18
- data/spec/dummy/config/environments/production.rb +46 -34
- data/spec/dummy/config/environments/test.rb +19 -14
- data/spec/dummy/config/initializers/assets.rb +1 -1
- data/spec/dummy/config/initializers/enju_leaf.rb +8 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +13 -0
- data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +13 -0
- data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +9 -0
- data/spec/dummy/db/schema.rb +27 -2
- data/spec/factories/classification_type.rb +5 -0
- data/spec/factories/reserve.rb +12 -0
- data/spec/factories/role.rb +9 -0
- data/spec/factories/subject.rb +7 -0
- data/spec/factories/subject_heading_type.rb +5 -0
- data/spec/factories/subject_heading_type_has_subject.rb +6 -0
- data/spec/factories/subject_type.rb +5 -0
- data/spec/fixtures/checked_items.yml +4 -4
- data/spec/fixtures/checkouts.yml +12 -12
- data/spec/fixtures/classification_types.yml +1 -1
- data/spec/fixtures/classifications.yml +1 -0
- data/spec/fixtures/manifestations.yml +4 -4
- data/spec/fixtures/reserves.yml +16 -16
- data/spec/fixtures/subjects.yml +79 -0
- data/spec/models/agent_import_file_spec.rb +1 -1
- data/spec/models/manifestation_spec.rb +27 -13
- data/spec/models/resource_export_file_spec.rb +15 -2
- data/spec/models/resource_import_file_spec.rb +29 -9
- data/spec/models/series_statement_merge_list_spec.rb +1 -1
- data/spec/policies/manifestation_policy_spec.rb +24 -0
- data/spec/rails_helper.rb +82 -0
- data/spec/spec_helper.rb +81 -56
- data/spec/support/devise.rb +2 -2
- data/spec/support/vcr.rb +8 -0
- data/spec/views/agent_types/index.html.erb_spec.rb +2 -1
- data/spec/views/agent_types/show.html.erb_spec.rb +1 -0
- data/spec/views/create_types/index.html.erb_spec.rb +2 -1
- data/spec/views/creates/edit.html.erb_spec.rb +0 -3
- data/spec/views/creates/index.html.erb_spec.rb +2 -4
- data/spec/views/creates/new.html.erb_spec.rb +0 -3
- data/spec/views/creates/show.html.erb_spec.rb +0 -3
- data/spec/views/import_requests/index.html.erb_spec.rb +3 -2
- data/spec/views/manifestations/index.html.erb_spec.rb +25 -0
- data/spec/views/manifestations/index.rdf.builder_spec.rb +23 -0
- data/spec/views/manifestations/index.txt.erb_spec.rb +17 -0
- data/spec/views/manifestations/show.html.erb_spec.rb +2 -3
- data/spec/views/manifestations/show.txt.erb_spec.rb +16 -0
- data/spec/views/owns/edit.html.erb_spec.rb +0 -3
- data/spec/views/owns/index.html.erb_spec.rb +2 -4
- data/spec/views/owns/new.html.erb_spec.rb +0 -3
- data/spec/views/owns/show.html.erb_spec.rb +0 -3
- data/spec/views/produce_types/index.html.erb_spec.rb +2 -1
- data/spec/views/produces/edit.html.erb_spec.rb +0 -3
- data/spec/views/produces/index.html.erb_spec.rb +2 -4
- data/spec/views/produces/new.html.erb_spec.rb +0 -3
- data/spec/views/produces/show.html.erb_spec.rb +0 -3
- data/spec/views/realize_types/index.html.erb_spec.rb +2 -1
- data/spec/views/realizes/edit.html.erb_spec.rb +0 -3
- data/spec/views/realizes/index.html.erb_spec.rb +2 -4
- data/spec/views/realizes/new.html.erb_spec.rb +0 -3
- data/spec/views/realizes/show.html.erb_spec.rb +0 -3
- data/spec/views/resource_import_files/index.html.erb_spec.rb +0 -3
- data/spec/views/resource_import_files/{show.html.erb_spec.erb → show.html.erb_spec.rb} +0 -3
- data/spec/views/resource_import_results/index.html.erb_spec.rb +0 -3
- data/spec/views/resource_import_results/{show.html.erb_spec.erb → show.html.erb_spec.rb} +1 -4
- data/spec/views/series_statement_merge_lists/index.html.erb_spec.rb +1 -1
- data/spec/views/series_statement_merges/edit.html.erb_spec.rb +0 -3
- data/spec/views/series_statement_merges/index.html.erb_spec.rb +0 -3
- data/spec/views/series_statement_merges/new.html.erb_spec.rb +0 -3
- data/spec/views/series_statement_merges/show.html.erb_spec.rb +0 -3
- metadata +170 -131
- data/app/models/enju_biblio/ability.rb +0 -238
- data/app/workers/agent_import_file_queue.rb +0 -7
- data/app/workers/resource_export_file_queue.rb +0 -7
- data/app/workers/resource_import_file_queue.rb +0 -7
- data/spec/dummy/config/application.yml +0 -42
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'rails_helper'
|
4
4
|
|
5
5
|
describe ManifestationsController do
|
6
6
|
fixtures :all
|
@@ -148,14 +148,14 @@ describe ManifestationsController do
|
|
148
148
|
get :index, :query => '2005', :pub_date_from => '2000'
|
149
149
|
expect(response).to be_success
|
150
150
|
expect(assigns(:manifestations)).to be_truthy
|
151
|
-
assigns(:query).should eq '2005 date_of_publication_d:[
|
151
|
+
assigns(:query).should eq '2005 date_of_publication_d:[2000-01-01T00:00:00Z TO *]'
|
152
152
|
end
|
153
153
|
|
154
154
|
it "should get index with pub_date_until" do
|
155
155
|
get :index, :query => '2005', :pub_date_until => '2000'
|
156
156
|
expect(response).to be_success
|
157
157
|
expect(assigns(:manifestations)).to be_truthy
|
158
|
-
assigns(:query).should eq '2005 date_of_publication_d:[* TO 2000-12-
|
158
|
+
assigns(:query).should eq '2005 date_of_publication_d:[* TO 2000-12-31T23:59:59Z]'
|
159
159
|
end
|
160
160
|
|
161
161
|
it "should get tag_cloud" do
|
@@ -223,6 +223,15 @@ describe ManifestationsController do
|
|
223
223
|
expect(manifestations_page2.count).to eq 10
|
224
224
|
expect(original_manifestations.first).not_to eq manifestations_page2.first
|
225
225
|
end
|
226
|
+
|
227
|
+
it "should accept sort_by parameter" do
|
228
|
+
get :index, sort_by: "created_at:desc"
|
229
|
+
manifestations = assigns(:manifestations)
|
230
|
+
expect(manifestations.first.created_at).to be >= manifestations.last.created_at
|
231
|
+
get :index, sort_by: "created_at:asc"
|
232
|
+
manifestations = assigns(:manifestations)
|
233
|
+
expect(manifestations.first.created_at).to be <= manifestations.last.created_at
|
234
|
+
end
|
226
235
|
end
|
227
236
|
end
|
228
237
|
|
@@ -367,6 +376,51 @@ describe ManifestationsController do
|
|
367
376
|
get :new, :expression_id => 1
|
368
377
|
expect(response).to be_success
|
369
378
|
end
|
379
|
+
|
380
|
+
it "should get new template with parent_id" do
|
381
|
+
serial = FactoryGirl.create(:manifestation_serial,
|
382
|
+
statement_of_responsibility: "statement_of_responsibility1",
|
383
|
+
title_alternative: "title_alternative1",
|
384
|
+
publication_place: "publication_place1",
|
385
|
+
height: 123,
|
386
|
+
width: 123,
|
387
|
+
depth: 123,
|
388
|
+
price: "price1",
|
389
|
+
access_address: "http://example.jp",
|
390
|
+
language_id: FactoryGirl.create(:language).id,
|
391
|
+
frequency_id: FactoryGirl.create(:frequency).id,
|
392
|
+
required_role_id: FactoryGirl.create(:role).id,
|
393
|
+
)
|
394
|
+
serial.creators << FactoryGirl.create(:agent)
|
395
|
+
serial.contributors << FactoryGirl.create(:agent)
|
396
|
+
serial.publishers << FactoryGirl.create(:agent)
|
397
|
+
serial.subjects << FactoryGirl.create(:subject)
|
398
|
+
serial.classifications << FactoryGirl.create(:classification)
|
399
|
+
serial.save!
|
400
|
+
get :new, :parent_id => serial.id
|
401
|
+
expect(response).to be_success
|
402
|
+
manifestation = assigns(:manifestation)
|
403
|
+
parent = assigns(:parent)
|
404
|
+
expect(parent).to be_truthy
|
405
|
+
expect(manifestation.original_title).to eq parent.original_title
|
406
|
+
expect(manifestation.creators).to eq parent.creators
|
407
|
+
expect(manifestation.contributors).to eq parent.contributors
|
408
|
+
expect(manifestation.publishers).to eq parent.publishers
|
409
|
+
expect(manifestation.classifications).to eq parent.classifications
|
410
|
+
expect(manifestation.subjects).to eq parent.subjects
|
411
|
+
expect(manifestation.statement_of_responsibility).to eq parent.statement_of_responsibility
|
412
|
+
expect(manifestation.title_alternative).to eq parent.title_alternative
|
413
|
+
expect(manifestation.publication_place).to eq parent.publication_place
|
414
|
+
expect(manifestation.height).to eq parent.height
|
415
|
+
expect(manifestation.width).to eq parent.width
|
416
|
+
expect(manifestation.depth).to eq parent.depth
|
417
|
+
expect(manifestation.price).to eq parent.price
|
418
|
+
expect(manifestation.access_address).to eq parent.access_address
|
419
|
+
expect(manifestation.language).to eq parent.language
|
420
|
+
expect(manifestation.frequency).to eq parent.frequency
|
421
|
+
expect(manifestation.required_role).to eq parent.required_role
|
422
|
+
end
|
423
|
+
|
370
424
|
end
|
371
425
|
|
372
426
|
describe "When logged in as User" do
|
@@ -374,7 +428,7 @@ describe ManifestationsController do
|
|
374
428
|
|
375
429
|
it "should not assign the requested manifestation as @manifestation" do
|
376
430
|
get :new
|
377
|
-
expect(assigns(:manifestation)).
|
431
|
+
expect(assigns(:manifestation)).to be_nil
|
378
432
|
expect(response).to be_forbidden
|
379
433
|
end
|
380
434
|
end
|
@@ -382,7 +436,7 @@ describe ManifestationsController do
|
|
382
436
|
describe "When not logged in" do
|
383
437
|
it "should not assign the requested manifestation as @manifestation" do
|
384
438
|
get :new
|
385
|
-
expect(assigns(:manifestation)).
|
439
|
+
expect(assigns(:manifestation)).to be_nil
|
386
440
|
expect(response).to redirect_to(new_user_session_url)
|
387
441
|
end
|
388
442
|
end
|
@@ -407,6 +461,17 @@ describe ManifestationsController do
|
|
407
461
|
get :edit, :id => manifestation.id
|
408
462
|
expect(assigns(:manifestation)).to eq(manifestation)
|
409
463
|
end
|
464
|
+
|
465
|
+
render_views
|
466
|
+
it "assigns the identifiers to @manifestation" do
|
467
|
+
manifestation = FactoryGirl.create(:manifestation)
|
468
|
+
identifier = FactoryGirl.create(:identifier)
|
469
|
+
manifestation.identifiers << identifier
|
470
|
+
get :edit, :id => manifestation.id
|
471
|
+
expect(assigns(:manifestation)).to eq manifestation
|
472
|
+
expect(assigns(:manifestation).identifiers).to eq manifestation.identifiers
|
473
|
+
expect(response).to render_template(partial: "manifestations/_identifier_fields")
|
474
|
+
end
|
410
475
|
end
|
411
476
|
|
412
477
|
describe "When logged in as User" do
|
@@ -512,7 +577,7 @@ describe ManifestationsController do
|
|
512
577
|
describe "with valid params" do
|
513
578
|
it "assigns a newly created manifestation as @manifestation" do
|
514
579
|
post :create, :manifestation => @attrs
|
515
|
-
expect(assigns(:manifestation)).to
|
580
|
+
expect(assigns(:manifestation)).to be_nil
|
516
581
|
end
|
517
582
|
|
518
583
|
it "should be forbidden" do
|
@@ -524,7 +589,7 @@ describe ManifestationsController do
|
|
524
589
|
describe "with invalid params" do
|
525
590
|
it "assigns a newly created but unsaved manifestation as @manifestation" do
|
526
591
|
post :create, :manifestation => @invalid_attrs
|
527
|
-
expect(assigns(:manifestation)).
|
592
|
+
expect(assigns(:manifestation)).to be_nil
|
528
593
|
end
|
529
594
|
|
530
595
|
it "should be forbidden" do
|
@@ -538,7 +603,7 @@ describe ManifestationsController do
|
|
538
603
|
describe "with valid params" do
|
539
604
|
it "assigns a newly created manifestation as @manifestation" do
|
540
605
|
post :create, :manifestation => @attrs
|
541
|
-
expect(assigns(:manifestation)).to
|
606
|
+
expect(assigns(:manifestation)).to be_nil
|
542
607
|
end
|
543
608
|
|
544
609
|
it "should be forbidden" do
|
@@ -550,7 +615,7 @@ describe ManifestationsController do
|
|
550
615
|
describe "with invalid params" do
|
551
616
|
it "assigns a newly created but unsaved manifestation as @manifestation" do
|
552
617
|
post :create, :manifestation => @invalid_attrs
|
553
|
-
expect(assigns(:manifestation)).
|
618
|
+
expect(assigns(:manifestation)).to be_nil
|
554
619
|
end
|
555
620
|
|
556
621
|
it "should be forbidden" do
|
@@ -610,6 +675,14 @@ describe ManifestationsController do
|
|
610
675
|
expect(assigns(:manifestation)).to eq(@manifestation)
|
611
676
|
expect(response).to redirect_to(@manifestation)
|
612
677
|
end
|
678
|
+
|
679
|
+
it "assigns identifiers to @manifestation" do
|
680
|
+
identifiers_attrs = {
|
681
|
+
identifier_attributes: [ FactoryGirl.create(:identifier) ]
|
682
|
+
}
|
683
|
+
put :update, id: @manifestation.id, manifestation: @attrs.merge(identifiers_attrs)
|
684
|
+
expect(assigns(:manifestation)).to eq @manifestation
|
685
|
+
end
|
613
686
|
end
|
614
687
|
|
615
688
|
describe "with invalid params" do
|
@@ -697,10 +770,11 @@ describe ManifestationsController do
|
|
697
770
|
end
|
698
771
|
|
699
772
|
it "should not destroy manifestation of series master with children" do
|
700
|
-
@
|
701
|
-
|
773
|
+
@manifestation = FactoryGirl.create(:manifestation_serial)
|
774
|
+
child = FactoryGirl.create(:manifestation)
|
775
|
+
@manifestation.derived_manifestations << child
|
702
776
|
delete :destroy, :id => @manifestation.id
|
703
|
-
expect(response).to
|
777
|
+
expect(response).to be_forbidden
|
704
778
|
end
|
705
779
|
|
706
780
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rails_helper'
|
2
2
|
|
3
3
|
# This spec was generated by rspec-rails when you ran the scaffold generator.
|
4
4
|
# It demonstrates how one might use RSpec to specify the controller code that
|
@@ -33,7 +33,7 @@ describe MediumOfPerformancesController do
|
|
33
33
|
it "assigns all medium_of_performances as @medium_of_performances" do
|
34
34
|
medium_of_performance = MediumOfPerformance.create! valid_attributes
|
35
35
|
get :index
|
36
|
-
expect(assigns(:medium_of_performances)).to eq(MediumOfPerformance.
|
36
|
+
expect(assigns(:medium_of_performances)).to eq(MediumOfPerformance.order(:position))
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rails_helper'
|
2
2
|
require 'sunspot/rails/spec_helper'
|
3
3
|
|
4
4
|
describe OwnsController do
|
@@ -115,7 +115,7 @@ describe OwnsController do
|
|
115
115
|
|
116
116
|
it "should not assign the requested own as @own" do
|
117
117
|
get :new
|
118
|
-
expect(assigns(:own)).
|
118
|
+
expect(assigns(:own)).to be_nil
|
119
119
|
expect(response).to be_forbidden
|
120
120
|
end
|
121
121
|
end
|
@@ -123,7 +123,7 @@ describe OwnsController do
|
|
123
123
|
describe "When not logged in" do
|
124
124
|
it "should not assign the requested own as @own" do
|
125
125
|
get :new
|
126
|
-
expect(assigns(:own)).
|
126
|
+
expect(assigns(:own)).to be_nil
|
127
127
|
expect(response).to redirect_to(new_user_session_url)
|
128
128
|
end
|
129
129
|
end
|
@@ -237,7 +237,7 @@ describe OwnsController do
|
|
237
237
|
describe "with valid params" do
|
238
238
|
it "assigns a newly created own as @own" do
|
239
239
|
post :create, :own => @attrs
|
240
|
-
expect(assigns(:own)).to
|
240
|
+
expect(assigns(:own)).to be_nil
|
241
241
|
end
|
242
242
|
|
243
243
|
it "should be forbidden" do
|
@@ -249,7 +249,7 @@ describe OwnsController do
|
|
249
249
|
describe "with invalid params" do
|
250
250
|
it "assigns a newly created but unsaved own as @own" do
|
251
251
|
post :create, :own => @invalid_attrs
|
252
|
-
expect(assigns(:own)).
|
252
|
+
expect(assigns(:own)).to be_nil
|
253
253
|
end
|
254
254
|
|
255
255
|
it "should be forbidden" do
|
@@ -263,7 +263,7 @@ describe OwnsController do
|
|
263
263
|
describe "with valid params" do
|
264
264
|
it "assigns a newly created own as @own" do
|
265
265
|
post :create, :own => @attrs
|
266
|
-
expect(assigns(:own)).to
|
266
|
+
expect(assigns(:own)).to be_nil
|
267
267
|
end
|
268
268
|
|
269
269
|
it "should be forbidden" do
|
@@ -275,7 +275,7 @@ describe OwnsController do
|
|
275
275
|
describe "with invalid params" do
|
276
276
|
it "assigns a newly created but unsaved own as @own" do
|
277
277
|
post :create, :own => @invalid_attrs
|
278
|
-
expect(assigns(:own)).
|
278
|
+
expect(assigns(:own)).to be_nil
|
279
279
|
end
|
280
280
|
|
281
281
|
it "should be forbidden" do
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rails_helper'
|
2
2
|
require 'sunspot/rails/spec_helper'
|
3
3
|
|
4
4
|
describe PictureFilesController do
|
@@ -87,7 +87,7 @@ describe PictureFilesController do
|
|
87
87
|
|
88
88
|
it "assigns the requested picture_file as @picture_file" do
|
89
89
|
get :new
|
90
|
-
expect(assigns(:picture_file)).
|
90
|
+
expect(assigns(:picture_file)).to be_nil
|
91
91
|
expect(response).to redirect_to picture_files_url
|
92
92
|
end
|
93
93
|
end
|
@@ -97,7 +97,7 @@ describe PictureFilesController do
|
|
97
97
|
|
98
98
|
it "assigns the requested picture_file as @picture_file" do
|
99
99
|
get :new
|
100
|
-
expect(assigns(:picture_file)).
|
100
|
+
expect(assigns(:picture_file)).to be_nil
|
101
101
|
expect(response).to redirect_to picture_files_url
|
102
102
|
end
|
103
103
|
end
|
@@ -107,7 +107,7 @@ describe PictureFilesController do
|
|
107
107
|
|
108
108
|
it "should not assign the requested picture_file as @picture_file" do
|
109
109
|
get :new
|
110
|
-
expect(assigns(:picture_file)).
|
110
|
+
expect(assigns(:picture_file)).to be_nil
|
111
111
|
expect(response).to be_forbidden
|
112
112
|
end
|
113
113
|
end
|
@@ -115,7 +115,7 @@ describe PictureFilesController do
|
|
115
115
|
describe "When not logged in" do
|
116
116
|
it "should not assign the requested picture_file as @picture_file" do
|
117
117
|
get :new
|
118
|
-
expect(assigns(:picture_file)).
|
118
|
+
expect(assigns(:picture_file)).to be_nil
|
119
119
|
expect(response).to redirect_to(new_user_session_url)
|
120
120
|
end
|
121
121
|
end
|
@@ -229,7 +229,7 @@ describe PictureFilesController do
|
|
229
229
|
describe "with valid params" do
|
230
230
|
it "assigns a newly created picture_file as @picture_file" do
|
231
231
|
post :create, :picture_file => @attrs
|
232
|
-
expect(assigns(:picture_file)).to
|
232
|
+
expect(assigns(:picture_file)).to be_nil
|
233
233
|
end
|
234
234
|
|
235
235
|
it "should be forbidden" do
|
@@ -241,7 +241,7 @@ describe PictureFilesController do
|
|
241
241
|
describe "with invalid params" do
|
242
242
|
it "assigns a newly created but unsaved picture_file as @picture_file" do
|
243
243
|
post :create, :picture_file => @invalid_attrs
|
244
|
-
expect(assigns(:picture_file)).
|
244
|
+
expect(assigns(:picture_file)).to be_nil
|
245
245
|
end
|
246
246
|
|
247
247
|
it "should be forbidden" do
|
@@ -255,7 +255,7 @@ describe PictureFilesController do
|
|
255
255
|
describe "with valid params" do
|
256
256
|
it "assigns a newly created picture_file as @picture_file" do
|
257
257
|
post :create, :picture_file => @attrs
|
258
|
-
expect(assigns(:picture_file)).to
|
258
|
+
expect(assigns(:picture_file)).to be_nil
|
259
259
|
end
|
260
260
|
|
261
261
|
it "should be forbidden" do
|
@@ -267,7 +267,7 @@ describe PictureFilesController do
|
|
267
267
|
describe "with invalid params" do
|
268
268
|
it "assigns a newly created but unsaved picture_file as @picture_file" do
|
269
269
|
post :create, :picture_file => @invalid_attrs
|
270
|
-
expect(assigns(:picture_file)).
|
270
|
+
expect(assigns(:picture_file)).to be_nil
|
271
271
|
end
|
272
272
|
|
273
273
|
it "should be forbidden" do
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rails_helper'
|
2
2
|
|
3
3
|
# This spec was generated by rspec-rails when you ran the scaffold generator.
|
4
4
|
# It demonstrates how one might use RSpec to specify the controller code that
|
@@ -33,7 +33,7 @@ describe ProduceTypesController do
|
|
33
33
|
it "assigns all produce_types as @produce_types" do
|
34
34
|
produce_type = ProduceType.create! valid_attributes
|
35
35
|
get :index
|
36
|
-
expect(assigns(:produce_types)).to eq(ProduceType.
|
36
|
+
expect(assigns(:produce_types)).to eq(ProduceType.order(:position))
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rails_helper'
|
2
2
|
require 'sunspot/rails/spec_helper'
|
3
3
|
|
4
4
|
describe ProducesController do
|
@@ -109,7 +109,7 @@ describe ProducesController do
|
|
109
109
|
|
110
110
|
it "should not assign the requested produce as @produce" do
|
111
111
|
get :new
|
112
|
-
expect(assigns(:produce)).
|
112
|
+
expect(assigns(:produce)).to be_nil
|
113
113
|
expect(response).to be_forbidden
|
114
114
|
end
|
115
115
|
end
|
@@ -117,7 +117,7 @@ describe ProducesController do
|
|
117
117
|
describe "When not logged in" do
|
118
118
|
it "should not assign the requested produce as @produce" do
|
119
119
|
get :new
|
120
|
-
expect(assigns(:produce)).
|
120
|
+
expect(assigns(:produce)).to be_nil
|
121
121
|
expect(response).to redirect_to(new_user_session_url)
|
122
122
|
end
|
123
123
|
end
|
@@ -231,7 +231,7 @@ describe ProducesController do
|
|
231
231
|
describe "with valid params" do
|
232
232
|
it "assigns a newly created produce as @produce" do
|
233
233
|
post :create, :produce => @attrs
|
234
|
-
expect(assigns(:produce)).to
|
234
|
+
expect(assigns(:produce)).to be_nil
|
235
235
|
end
|
236
236
|
|
237
237
|
it "should be forbidden" do
|
@@ -243,7 +243,7 @@ describe ProducesController do
|
|
243
243
|
describe "with invalid params" do
|
244
244
|
it "assigns a newly created but unsaved produce as @produce" do
|
245
245
|
post :create, :produce => @invalid_attrs
|
246
|
-
expect(assigns(:produce)).
|
246
|
+
expect(assigns(:produce)).to be_nil
|
247
247
|
end
|
248
248
|
|
249
249
|
it "should be forbidden" do
|
@@ -257,7 +257,7 @@ describe ProducesController do
|
|
257
257
|
describe "with valid params" do
|
258
258
|
it "assigns a newly created produce as @produce" do
|
259
259
|
post :create, :produce => @attrs
|
260
|
-
expect(assigns(:produce)).to
|
260
|
+
expect(assigns(:produce)).to be_nil
|
261
261
|
end
|
262
262
|
|
263
263
|
it "should be forbidden" do
|
@@ -269,7 +269,7 @@ describe ProducesController do
|
|
269
269
|
describe "with invalid params" do
|
270
270
|
it "assigns a newly created but unsaved produce as @produce" do
|
271
271
|
post :create, :produce => @invalid_attrs
|
272
|
-
expect(assigns(:produce)).
|
272
|
+
expect(assigns(:produce)).to be_nil
|
273
273
|
end
|
274
274
|
|
275
275
|
it "should be forbidden" do
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rails_helper'
|
2
2
|
|
3
3
|
# This spec was generated by rspec-rails when you ran the scaffold generator.
|
4
4
|
# It demonstrates how one might use RSpec to specify the controller code that
|
@@ -33,7 +33,7 @@ describe RealizeTypesController do
|
|
33
33
|
it "assigns all realize_types as @realize_types" do
|
34
34
|
realize_type = RealizeType.create! valid_attributes
|
35
35
|
get :index
|
36
|
-
expect(assigns(:realize_types)).to eq(RealizeType.
|
36
|
+
expect(assigns(:realize_types)).to eq(RealizeType.order(:position))
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rails_helper'
|
2
2
|
require 'sunspot/rails/spec_helper'
|
3
3
|
|
4
4
|
describe RealizesController do
|
@@ -105,7 +105,7 @@ describe RealizesController do
|
|
105
105
|
|
106
106
|
it "should not assign the requested realize as @realize" do
|
107
107
|
get :new
|
108
|
-
expect(assigns(:realize)).
|
108
|
+
expect(assigns(:realize)).to be_nil
|
109
109
|
expect(response).to be_forbidden
|
110
110
|
end
|
111
111
|
end
|
@@ -113,7 +113,7 @@ describe RealizesController do
|
|
113
113
|
describe "When not logged in" do
|
114
114
|
it "should not assign the requested realize as @realize" do
|
115
115
|
get :new
|
116
|
-
expect(assigns(:realize)).
|
116
|
+
expect(assigns(:realize)).to be_nil
|
117
117
|
expect(response).to redirect_to(new_user_session_url)
|
118
118
|
end
|
119
119
|
end
|
@@ -227,7 +227,7 @@ describe RealizesController do
|
|
227
227
|
describe "with valid params" do
|
228
228
|
it "assigns a newly created realize as @realize" do
|
229
229
|
post :create, :realize => @attrs
|
230
|
-
expect(assigns(:realize)).to
|
230
|
+
expect(assigns(:realize)).to be_nil
|
231
231
|
end
|
232
232
|
|
233
233
|
it "should be forbidden" do
|
@@ -239,7 +239,7 @@ describe RealizesController do
|
|
239
239
|
describe "with invalid params" do
|
240
240
|
it "assigns a newly created but unsaved realize as @realize" do
|
241
241
|
post :create, :realize => @invalid_attrs
|
242
|
-
expect(assigns(:realize)).
|
242
|
+
expect(assigns(:realize)).to be_nil
|
243
243
|
end
|
244
244
|
|
245
245
|
it "should be forbidden" do
|
@@ -253,7 +253,7 @@ describe RealizesController do
|
|
253
253
|
describe "with valid params" do
|
254
254
|
it "assigns a newly created realize as @realize" do
|
255
255
|
post :create, :realize => @attrs
|
256
|
-
expect(assigns(:realize)).to
|
256
|
+
expect(assigns(:realize)).to be_nil
|
257
257
|
end
|
258
258
|
|
259
259
|
it "should redirect to new_user_session_url" do
|
@@ -265,7 +265,7 @@ describe RealizesController do
|
|
265
265
|
describe "with invalid params" do
|
266
266
|
it "assigns a newly created but unsaved realize as @realize" do
|
267
267
|
post :create, :realize => @invalid_attrs
|
268
|
-
expect(assigns(:realize)).
|
268
|
+
expect(assigns(:realize)).to be_nil
|
269
269
|
end
|
270
270
|
|
271
271
|
it "should redirect to new_user_session_url" do
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rails_helper'
|
2
2
|
|
3
3
|
describe ResourceExportFilesController do
|
4
4
|
fixtures :all
|
@@ -27,7 +27,7 @@ describe ResourceExportFilesController do
|
|
27
27
|
|
28
28
|
it "assigns empty as @resource_export_files" do
|
29
29
|
get :index
|
30
|
-
expect(assigns(:resource_export_files)).to
|
30
|
+
expect(assigns(:resource_export_files)).to be_nil
|
31
31
|
expect(response).to be_forbidden
|
32
32
|
end
|
33
33
|
end
|
@@ -35,7 +35,7 @@ describe ResourceExportFilesController do
|
|
35
35
|
describe "When not logged in" do
|
36
36
|
it "assigns empty as @resource_export_files" do
|
37
37
|
get :index
|
38
|
-
expect(assigns(:resource_export_files)).to
|
38
|
+
expect(assigns(:resource_export_files)).to be_nil
|
39
39
|
expect(response).to redirect_to(new_user_session_url)
|
40
40
|
end
|
41
41
|
end
|
@@ -107,7 +107,7 @@ describe ResourceExportFilesController do
|
|
107
107
|
|
108
108
|
it "should not assign the requested resource_export_file as @resource_export_file" do
|
109
109
|
get :new
|
110
|
-
expect(assigns(:resource_export_file)).
|
110
|
+
expect(assigns(:resource_export_file)).to be_nil
|
111
111
|
expect(response).to be_forbidden
|
112
112
|
end
|
113
113
|
end
|
@@ -115,7 +115,7 @@ describe ResourceExportFilesController do
|
|
115
115
|
describe "When not logged in" do
|
116
116
|
it "should not assign the requested resource_export_file as @resource_export_file" do
|
117
117
|
get :new
|
118
|
-
expect(assigns(:resource_export_file)).
|
118
|
+
expect(assigns(:resource_export_file)).to be_nil
|
119
119
|
expect(response).to redirect_to(new_user_session_url)
|
120
120
|
end
|
121
121
|
end
|
@@ -123,10 +123,7 @@ describe ResourceExportFilesController do
|
|
123
123
|
|
124
124
|
describe "POST create" do
|
125
125
|
describe "When logged in as Librarian" do
|
126
|
-
|
127
|
-
@user = FactoryGirl.create(:librarian)
|
128
|
-
sign_in @user
|
129
|
-
end
|
126
|
+
login_fixture_librarian
|
130
127
|
|
131
128
|
it "should create agent_export_file" do
|
132
129
|
post :create, resource_export_file: {mode: 'export'}
|
@@ -137,14 +134,11 @@ describe ResourceExportFilesController do
|
|
137
134
|
end
|
138
135
|
|
139
136
|
describe "When logged in as User" do
|
140
|
-
|
141
|
-
@user = FactoryGirl.create(:user)
|
142
|
-
sign_in @user
|
143
|
-
end
|
137
|
+
login_fixture_user
|
144
138
|
|
145
139
|
it "should be forbidden" do
|
146
140
|
post :create, resource_export_file: {mode: 'export'}
|
147
|
-
assigns(:resource_export_file).
|
141
|
+
assigns(:resource_export_file).should be_nil
|
148
142
|
expect(response).to be_forbidden
|
149
143
|
end
|
150
144
|
end
|
@@ -152,7 +146,7 @@ describe ResourceExportFilesController do
|
|
152
146
|
describe "When not logged in" do
|
153
147
|
it "should be redirected to new session url" do
|
154
148
|
post :create, resource_export_file: {mode: 'export'}
|
155
|
-
assigns(:resource_export_file).
|
149
|
+
assigns(:resource_export_file).should be_nil
|
156
150
|
expect(response).to redirect_to new_user_session_url
|
157
151
|
end
|
158
152
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'rails_helper'
|
2
2
|
|
3
3
|
describe ResourceImportFilesController do
|
4
4
|
fixtures :all
|
@@ -27,7 +27,7 @@ describe ResourceImportFilesController do
|
|
27
27
|
|
28
28
|
it "assigns empty as @resource_import_files" do
|
29
29
|
get :index
|
30
|
-
expect(assigns(:resource_import_files)).to
|
30
|
+
expect(assigns(:resource_import_files)).to be_nil
|
31
31
|
expect(response).to be_forbidden
|
32
32
|
end
|
33
33
|
end
|
@@ -35,7 +35,7 @@ describe ResourceImportFilesController do
|
|
35
35
|
describe "When not logged in" do
|
36
36
|
it "assigns empty as @resource_import_files" do
|
37
37
|
get :index
|
38
|
-
expect(assigns(:resource_import_files)).to
|
38
|
+
expect(assigns(:resource_import_files)).to be_nil
|
39
39
|
expect(response).to redirect_to(new_user_session_url)
|
40
40
|
end
|
41
41
|
end
|
@@ -107,7 +107,7 @@ describe ResourceImportFilesController do
|
|
107
107
|
|
108
108
|
it "should not assign the requested resource_import_file as @resource_import_file" do
|
109
109
|
get :new
|
110
|
-
expect(assigns(:resource_import_file)).
|
110
|
+
expect(assigns(:resource_import_file)).to be_nil
|
111
111
|
expect(response).to be_forbidden
|
112
112
|
end
|
113
113
|
end
|
@@ -115,7 +115,7 @@ describe ResourceImportFilesController do
|
|
115
115
|
describe "When not logged in" do
|
116
116
|
it "should not assign the requested resource_import_file as @resource_import_file" do
|
117
117
|
get :new
|
118
|
-
expect(assigns(:resource_import_file)).
|
118
|
+
expect(assigns(:resource_import_file)).to be_nil
|
119
119
|
expect(response).to redirect_to(new_user_session_url)
|
120
120
|
end
|
121
121
|
end
|
@@ -151,7 +151,7 @@ describe ResourceImportFilesController do
|
|
151
151
|
|
152
152
|
it "should be forbidden" do
|
153
153
|
post :create, :resource_import_file => {:resource_import => fixture_file_upload("/../../examples/resource_import_file_sample1.tsv", 'text/csv') }
|
154
|
-
assigns(:resource_import_file).
|
154
|
+
assigns(:resource_import_file).should be_nil
|
155
155
|
expect(response).to be_forbidden
|
156
156
|
end
|
157
157
|
end
|
@@ -159,7 +159,7 @@ describe ResourceImportFilesController do
|
|
159
159
|
describe "When not logged in" do
|
160
160
|
it "should be redirected to new session url" do
|
161
161
|
post :create, :resource_import_file => {:resource_import => fixture_file_upload("/../../examples/resource_import_file_sample1.tsv", 'text/csv') }
|
162
|
-
assigns(:resource_import_file).
|
162
|
+
assigns(:resource_import_file).should be_nil
|
163
163
|
expect(response).to redirect_to new_user_session_url
|
164
164
|
end
|
165
165
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
require '
|
2
|
+
require 'rails_helper'
|
3
3
|
|
4
4
|
describe ResourceImportResultsController do
|
5
5
|
fixtures :all
|
@@ -28,7 +28,7 @@ describe ResourceImportResultsController do
|
|
28
28
|
|
29
29
|
it "assigns empty as @resource_import_results" do
|
30
30
|
get :index
|
31
|
-
expect(assigns(:resource_import_results)).to
|
31
|
+
expect(assigns(:resource_import_results)).to be_nil
|
32
32
|
expect(response).to be_forbidden
|
33
33
|
end
|
34
34
|
end
|
@@ -36,7 +36,7 @@ describe ResourceImportResultsController do
|
|
36
36
|
describe "When not logged in" do
|
37
37
|
it "assigns empty as @resource_import_results" do
|
38
38
|
get :index
|
39
|
-
expect(assigns(:resource_import_results)).to
|
39
|
+
expect(assigns(:resource_import_results)).to be_nil
|
40
40
|
expect(response).to redirect_to(new_user_session_url)
|
41
41
|
end
|
42
42
|
end
|