enju_biblio 0.1.0.pre42 → 0.1.0.pre43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/creates_controller.rb +11 -11
- data/app/controllers/items_controller.rb +3 -3
- data/app/controllers/manifestations_controller.rb +14 -14
- data/app/controllers/owns_controller.rb +10 -10
- data/app/controllers/patron_import_files_controller.rb +34 -34
- data/app/controllers/patron_import_results_controller.rb +5 -5
- data/app/controllers/patron_relationship_types_controller.rb +3 -3
- data/app/controllers/patron_relationships_controller.rb +7 -7
- data/app/controllers/patron_types_controller.rb +3 -3
- data/app/controllers/patrons_controller.rb +61 -61
- data/app/controllers/picture_files_controller.rb +4 -4
- data/app/controllers/produces_controller.rb +11 -11
- data/app/controllers/realizes_controller.rb +11 -11
- data/app/helpers/{patrons_helper.rb → agents_helper.rb} +5 -5
- data/app/models/{patron.rb → agent.rb} +36 -36
- data/app/models/{patron_import_file.rb → agent_import_file.rb} +77 -77
- data/app/models/agent_import_result.rb +26 -0
- data/app/models/{patron_relationship.rb → agent_relationship.rb} +7 -7
- data/app/models/{patron_relationship_type.rb → agent_relationship_type.rb} +4 -4
- data/app/models/{patron_sweeper.rb → agent_sweeper.rb} +6 -6
- data/app/models/{patron_type.rb → agent_type.rb} +4 -4
- data/app/models/country.rb +1 -1
- data/app/models/create.rb +7 -7
- data/app/models/donate.rb +5 -5
- data/app/models/enju_biblio/ability.rb +24 -24
- data/app/models/item.rb +5 -5
- data/app/models/item_sweeper.rb +2 -2
- data/app/models/manifestation.rb +24 -20
- data/app/models/own.rb +7 -7
- data/app/models/page_sweeper.rb +4 -4
- data/app/models/picture_file.rb +1 -1
- data/app/models/produce.rb +7 -7
- data/app/models/realize.rb +7 -7
- data/app/models/resource_import_file.rb +19 -19
- data/app/views/{patron_import_files → agent_import_files}/edit.html.erb +6 -6
- data/app/views/agent_import_files/index.html.erb +40 -0
- data/app/views/{patron_import_files → agent_import_files}/new.html.erb +3 -3
- data/app/views/agent_import_files/show.html.erb +69 -0
- data/app/views/agent_import_results/index.csv.erb +3 -0
- data/app/views/agent_import_results/index.html.erb +52 -0
- data/app/views/agent_import_results/show.html.erb +38 -0
- data/app/views/{patron_relationship_types → agent_relationship_types}/_form.html.erb +1 -1
- data/app/views/{patron_relationship_types → agent_relationship_types}/edit.html.erb +3 -3
- data/app/views/agent_relationship_types/index.html.erb +43 -0
- data/app/views/{patron_relationship_types → agent_relationship_types}/new.html.erb +2 -2
- data/app/views/agent_relationship_types/show.html.erb +29 -0
- data/app/views/{patron_relationships → agent_relationships}/_form.html.erb +7 -7
- data/app/views/{patron_relationships → agent_relationships}/edit.html.erb +3 -3
- data/app/views/agent_relationships/index.html.erb +34 -0
- data/app/views/{patron_relationships → agent_relationships}/new.html.erb +2 -2
- data/app/views/agent_relationships/show.html.erb +24 -0
- data/app/views/{patron_types → agent_types}/_form.html.erb +1 -1
- data/app/views/{patron_types → agent_types}/edit.html.erb +3 -3
- data/app/views/agent_types/index.html.erb +43 -0
- data/app/views/{patron_types → agent_types}/new.html.erb +2 -2
- data/app/views/agent_types/show.html.erb +29 -0
- data/app/views/{patrons → agents}/_expression_list.html.erb +3 -3
- data/app/views/{patrons → agents}/_form.html.erb +9 -9
- data/app/views/{patrons → agents}/_form_family_name_first.html.erb +0 -0
- data/app/views/{patrons → agents}/_form_family_name_last.html.erb +0 -0
- data/app/views/{patrons → agents}/_history_list.html.erb +2 -2
- data/app/views/{patrons → agents}/_index.html.erb +9 -9
- data/app/views/{patrons → agents}/_index_expression.html.erb +15 -15
- data/app/views/{patrons → agents}/_index_manifestation.html.erb +16 -16
- data/app/views/agents/_index_patron.html.erb +71 -0
- data/app/views/agents/_index_patron_merge_list.html.erb +53 -0
- data/app/views/{patrons → agents}/_index_work.html.erb +17 -17
- data/app/views/{patrons → agents}/_manifestation_list.html.erb +3 -3
- data/app/views/agents/_patron.html.erb +13 -0
- data/app/views/agents/_patron_list.html.erb +18 -0
- data/app/views/{patrons → agents}/_work_list.html.erb +1 -1
- data/app/views/agents/edit.html.erb +16 -0
- data/app/views/agents/index.atom.builder +10 -0
- data/app/views/{patrons → agents}/index.html.erb +4 -4
- data/app/views/{patrons → agents}/index.mobile.erb +5 -5
- data/app/views/{patrons → agents}/index.rss.builder +11 -11
- data/app/views/{patrons → agents}/new.html.erb +2 -2
- data/app/views/agents/show.html.erb +152 -0
- data/app/views/{patrons → agents}/show.js.erb +0 -0
- data/app/views/agents/show.mobile.erb +69 -0
- data/app/views/creates/_form.html.erb +5 -5
- data/app/views/creates/_index.html.erb +2 -2
- data/app/views/creates/_index_patron.html.erb +6 -6
- data/app/views/creates/_index_work.html.erb +2 -2
- data/app/views/creates/index.html.erb +2 -2
- data/app/views/creates/new.html.erb +3 -3
- data/app/views/creates/show.html.erb +4 -4
- data/app/views/donates/edit.html.erb +2 -2
- data/app/views/donates/index.html.erb +2 -2
- data/app/views/donates/new.html.erb +2 -2
- data/app/views/donates/show.html.erb +2 -2
- data/app/views/items/index.html.erb +1 -1
- data/app/views/languages/index.html.erb +1 -1
- data/app/views/layouts/patrons.html.erb +2 -2
- data/app/views/manifestations/_index_form_contributor.html.erb +1 -1
- data/app/views/manifestations/_index_form_creator.html.erb +1 -1
- data/app/views/manifestations/_index_form_publisher.html.erb +1 -1
- data/app/views/manifestations/_manifestation_list.html.erb +6 -6
- data/app/views/manifestations/_show.mods.builder +4 -4
- data/app/views/manifestations/_show.rdf.builder +4 -4
- data/app/views/manifestations/_show_creators.html.erb +4 -4
- data/app/views/manifestations/_show_creators.mobile.erb +4 -4
- data/app/views/manifestations/_title.html.erb +3 -3
- data/app/views/manifestations/_title.mobile.erb +3 -3
- data/app/views/manifestations/edit.html.erb +2 -2
- data/app/views/manifestations/index.atom.builder +2 -2
- data/app/views/manifestations/index.html.erb +3 -3
- data/app/views/manifestations/index.opds.builder +2 -2
- data/app/views/manifestations/index.sru.builder +6 -6
- data/app/views/manifestations/new.html.erb +2 -2
- data/app/views/notifier/manifestation_info.en.text.erb +1 -1
- data/app/views/notifier/manifestation_info.ja.text.erb +1 -1
- data/app/views/owns/_form.html.erb +1 -1
- data/app/views/owns/index.html.erb +2 -2
- data/app/views/owns/show.html.erb +4 -4
- data/app/views/picture_files/_index.html.erb +1 -1
- data/app/views/picture_files/_index_patron.html.erb +2 -2
- data/app/views/picture_files/index.html.erb +2 -2
- data/app/views/picture_files/show.html.erb +2 -2
- data/app/views/produces/_form.html.erb +5 -5
- data/app/views/produces/_index.html.erb +2 -2
- data/app/views/produces/_index_manifestation.html.erb +3 -3
- data/app/views/produces/_index_patron.html.erb +3 -3
- data/app/views/produces/index.html.erb +2 -2
- data/app/views/produces/new.html.erb +3 -3
- data/app/views/produces/show.html.erb +4 -4
- data/app/views/realizes/_form.html.erb +5 -5
- data/app/views/realizes/_index.html.erb +2 -2
- data/app/views/realizes/_index_expression.html.erb +3 -3
- data/app/views/realizes/_index_patron.html.erb +3 -3
- data/app/views/realizes/index.html.erb +2 -2
- data/app/views/realizes/new.html.erb +3 -3
- data/app/views/realizes/show.html.erb +4 -4
- data/app/views/resource_import_results/show.html.erb +1 -1
- data/config/routes.rb +16 -16
- data/db/migrate/{001_create_patrons.rb → 001_create_agents.rb} +8 -8
- data/db/migrate/012_create_owns.rb +2 -2
- data/db/migrate/015_create_creates.rb +2 -2
- data/db/migrate/047_create_produces.rb +2 -2
- data/db/migrate/125_create_donates.rb +2 -2
- data/db/migrate/20080830154109_create_realizes.rb +2 -2
- data/db/migrate/{20080905191442_create_patron_types.rb → 20080905191442_create_agent_types.rb} +2 -2
- data/db/migrate/20081028083142_create_agent_import_files.rb +22 -0
- data/db/migrate/{20090812151902_create_patron_relationship_types.rb → 20090812151902_create_agent_relationship_types.rb} +2 -2
- data/db/migrate/20091012101112_add_dcndl_schema.rb +2 -2
- data/db/migrate/20100606073747_create_agent_relationships.rb +13 -0
- data/db/migrate/20100814091104_add_position_to_agent_relationship.rb +11 -0
- data/db/migrate/20100925074559_create_agent_import_results.rb +12 -0
- data/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +11 -0
- data/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +5 -0
- data/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +5 -0
- data/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +6 -0
- data/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +5 -0
- data/lib/enju_biblio/biblio_helper.rb +8 -8
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/enju_biblio.rb +3 -3
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/patron_relationship_types.yml +3 -3
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/patron_types.yml +2 -2
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/patrons.yml +4 -4
- data/spec/controllers/agent_import_files_controller_spec.rb +321 -0
- data/spec/controllers/{patron_import_results_controller_spec.rb → agent_import_results_controller_spec.rb} +17 -17
- data/spec/controllers/agent_relationship_types_controller_spec.rb +445 -0
- data/spec/controllers/agent_relationships_controller_spec.rb +446 -0
- data/spec/controllers/agent_types_controller_spec.rb +447 -0
- data/spec/controllers/agents_controller_spec.rb +644 -0
- data/spec/controllers/countries_controller_spec.rb +1 -1
- data/spec/controllers/items_controller_spec.rb +4 -4
- data/spec/controllers/manifestation_relationship_types_controller_spec.rb +1 -1
- data/spec/controllers/manifestations_controller_spec.rb +4 -4
- data/spec/controllers/owns_controller_spec.rb +2 -2
- data/spec/controllers/resource_import_files_controller_spec.rb +1 -1
- data/spec/dummy/app/helpers/application_helper.rb +5 -222
- data/spec/dummy/app/models/ability.rb +31 -31
- data/spec/dummy/app/models/{local_patron.rb → local_agent.rb} +1 -1
- data/spec/dummy/app/models/user.rb +3 -3
- data/spec/dummy/config/application.rb +0 -1
- data/spec/dummy/config/environments/test.rb +1 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/035_create_reserves.rb +1 -1
- data/spec/dummy/db/migrate/20090519203307_create_participates.rb +2 -2
- data/spec/dummy/db/schema.rb +132 -132
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_delete_file.tsv +8 -0
- data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_import_file_sample1.tsv +5 -0
- data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_import_file_sample2.tsv +8 -0
- data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_import_file_sample3.tsv +5 -0
- data/spec/dummy/private/system/agent_import_files/agent_imports/000/000/004/original/agent_update_file.tsv +3 -0
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/segments_q76 +0 -0
- data/spec/factories/{patron.rb → agent.rb} +3 -3
- data/spec/factories/create.rb +1 -1
- data/spec/factories/donate.rb +1 -1
- data/spec/factories/own.rb +1 -1
- data/spec/factories/patron_relationship.rb +3 -3
- data/spec/factories/patron_relationship_type.rb +2 -2
- data/spec/factories/patron_type.rb +2 -2
- data/spec/factories/produce.rb +1 -1
- data/spec/factories/realize.rb +1 -1
- data/spec/fixtures/{patron_import_files.yml → agent_import_files.yml} +18 -18
- data/spec/fixtures/{patron_import_results.yml → agent_import_results.yml} +7 -7
- data/spec/fixtures/{patron_relationship_types.yml → agent_relationship_types.yml} +4 -4
- data/spec/fixtures/{patron_relationships.yml → agent_relationships.yml} +4 -4
- data/spec/fixtures/{patron_types.yml → agent_types.yml} +4 -4
- data/spec/fixtures/{patrons.yml → agents.yml} +47 -47
- data/spec/fixtures/creates.yml +8 -8
- data/spec/fixtures/donates.yml +4 -4
- data/spec/fixtures/owns.yml +3 -3
- data/spec/fixtures/picture_files.yml +1 -1
- data/spec/fixtures/produces.yml +20 -20
- data/spec/fixtures/realizes.yml +11 -11
- data/spec/fixtures/reserves.yml +1 -1
- data/spec/models/agent_import_file_spec.rb +96 -0
- data/spec/models/{patron_import_result_spec.rb → agent_import_result_spec.rb} +4 -4
- data/spec/models/{patron_relationship_spec.rb → agent_relationship_spec.rb} +3 -3
- data/spec/models/{patron_relationship_type_spec.rb → agent_relationship_type_spec.rb} +2 -2
- data/spec/models/{patron_spec.rb → agent_spec.rb} +16 -16
- data/spec/models/{patron_type_spec.rb → agent_type_spec.rb} +2 -2
- data/spec/models/create_spec.rb +1 -1
- data/spec/models/donate_spec.rb +1 -1
- data/spec/models/manifestation_spec.rb +1 -1
- data/spec/models/own_spec.rb +1 -1
- data/spec/models/produce_spec.rb +1 -1
- data/spec/models/realize_spec.rb +1 -1
- data/spec/models/resource_import_file_spec.rb +8 -8
- data/spec/requests/agents_spec.rb +9 -0
- data/spec/routing/agent_relationship_types_routing_spec.rb +35 -0
- data/spec/routing/agent_relationships_routing_spec.rb +35 -0
- data/spec/routing/agents_routing_spec.rb +35 -0
- data/spec/views/creates/edit.html.erb_spec.rb +1 -1
- data/spec/views/creates/index.html.erb_spec.rb +2 -2
- data/spec/views/creates/new.html.erb_spec.rb +1 -1
- data/spec/views/creates/show.html.erb_spec.rb +1 -1
- data/spec/views/owns/edit.html.erb_spec.rb +1 -1
- data/spec/views/owns/index.html.erb_spec.rb +2 -2
- data/spec/views/owns/new.html.erb_spec.rb +1 -1
- data/spec/views/owns/show.html.erb_spec.rb +1 -1
- data/spec/views/produces/edit.html.erb_spec.rb +2 -2
- data/spec/views/produces/index.html.erb_spec.rb +2 -2
- data/spec/views/produces/new.html.erb_spec.rb +2 -2
- data/spec/views/produces/show.html.erb_spec.rb +1 -1
- data/spec/views/realizes/edit.html.erb_spec.rb +2 -2
- data/spec/views/realizes/index.html.erb_spec.rb +2 -2
- data/spec/views/realizes/new.html.erb_spec.rb +2 -2
- data/spec/views/realizes/show.html.erb_spec.rb +1 -1
- metadata +131 -187
- data/app/models/patron_import_result.rb +0 -26
- data/app/views/patron_import_files/index.html.erb +0 -40
- data/app/views/patron_import_files/show.html.erb +0 -69
- data/app/views/patron_import_results/index.csv.erb +0 -3
- data/app/views/patron_import_results/index.html.erb +0 -52
- data/app/views/patron_import_results/show.html.erb +0 -38
- data/app/views/patron_relationship_types/index.html.erb +0 -43
- data/app/views/patron_relationship_types/show.html.erb +0 -29
- data/app/views/patron_relationships/index.html.erb +0 -34
- data/app/views/patron_relationships/show.html.erb +0 -24
- data/app/views/patron_types/index.html.erb +0 -43
- data/app/views/patron_types/show.html.erb +0 -29
- data/app/views/patrons/_index_patron.html.erb +0 -71
- data/app/views/patrons/_index_patron_merge_list.html.erb +0 -53
- data/app/views/patrons/_patron.html.erb +0 -13
- data/app/views/patrons/_patron_list.html.erb +0 -18
- data/app/views/patrons/edit.html.erb +0 -16
- data/app/views/patrons/index.atom.builder +0 -10
- data/app/views/patrons/show.html.erb +0 -152
- data/app/views/patrons/show.mobile.erb +0 -69
- data/db/migrate/20081028083142_create_patron_import_files.rb +0 -22
- data/db/migrate/20100606073747_create_patron_relationships.rb +0 -13
- data/db/migrate/20100814091104_add_position_to_patron_relationship.rb +0 -11
- data/db/migrate/20100925074559_create_patron_import_results.rb +0 -12
- data/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +0 -11
- data/db/migrate/20120413161403_add_fingerprint_to_patron_import_file.rb +0 -5
- data/db/migrate/20120413170720_add_error_message_to_patron_import_file.rb +0 -5
- data/db/migrate/20120511072422_add_patron_identifier_to_patron.rb +0 -6
- data/db/migrate/20120602141129_add_edit_mode_to_patron_import_file.rb +0 -5
- data/spec/controllers/patron_import_files_controller_spec.rb +0 -321
- data/spec/controllers/patron_relationship_types_controller_spec.rb +0 -445
- data/spec/controllers/patron_relationships_controller_spec.rb +0 -446
- data/spec/controllers/patron_types_controller_spec.rb +0 -447
- data/spec/controllers/patrons_controller_spec.rb +0 -644
- data/spec/dummy/app/mailers/notifier.rb +0 -40
- data/spec/dummy/lib/plugins/ext/event-calendar.rb +0 -38
- data/spec/dummy/lib/plugins/ext/sunspot/abstract_search.rb +0 -12
- data/spec/dummy/lib/plugins/ext/sunspot/dismax.rb +0 -41
- data/spec/dummy/lib/plugins/ext/sunspot/start_record.rb +0 -55
- data/spec/dummy/lib/plugins/ext/sunspot.rb +0 -3
- data/spec/dummy/lib/plugins/ext.rb +0 -1
- data/spec/dummy/lib/plugins.rb +0 -2
- data/spec/dummy/solr/data/test/index/_goc.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_goc.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_goc.fnm +0 -7
- data/spec/dummy/solr/data/test/index/_goc.frq +0 -0
- data/spec/dummy/solr/data/test/index/_goc.nrm +0 -1
- data/spec/dummy/solr/data/test/index/_goc.prx +0 -0
- data/spec/dummy/solr/data/test/index/_goc.tii +0 -0
- data/spec/dummy/solr/data/test/index/_goc.tis +0 -0
- data/spec/dummy/solr/data/test/index/_god.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_god.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_god.fnm +0 -7
- data/spec/dummy/solr/data/test/index/_god.frq +0 -0
- data/spec/dummy/solr/data/test/index/_god.nrm +0 -1
- data/spec/dummy/solr/data/test/index/_god.prx +0 -0
- data/spec/dummy/solr/data/test/index/_god.tii +0 -0
- data/spec/dummy/solr/data/test/index/_god.tis +0 -0
- data/spec/dummy/solr/data/test/index/_goe.fdt +0 -0
- data/spec/dummy/solr/data/test/index/_goe.fdx +0 -0
- data/spec/dummy/solr/data/test/index/_goe.fnm +0 -8
- data/spec/dummy/solr/data/test/index/_goe.frq +0 -0
- data/spec/dummy/solr/data/test/index/_goe.nrm +0 -1
- data/spec/dummy/solr/data/test/index/_goe.prx +0 -0
- data/spec/dummy/solr/data/test/index/_goe.tii +0 -0
- data/spec/dummy/solr/data/test/index/_goe.tis +0 -0
- data/spec/dummy/solr/data/test/index/segments_otc +0 -0
- data/spec/dummy/tmp/cache/4AD/470/country_all +0 -0
- data/spec/models/patron_import_file_spec.rb +0 -96
- data/spec/requests/patrons_spec.rb +0 -9
- data/spec/routing/patron_relationship_types_routing_spec.rb +0 -35
- data/spec/routing/patron_relationships_routing_spec.rb +0 -35
- data/spec/routing/patrons_routing_spec.rb +0 -35
@@ -1,152 +0,0 @@
|
|
1
|
-
<div id="content_detail" class="ui-corner-all">
|
2
|
-
<h1 class="title"><%= t('page.showing', :model => t('activerecord.models.patron')) -%></h1>
|
3
|
-
<div id="content_list">
|
4
|
-
<p id="notice"><%= notice %></p>
|
5
|
-
|
6
|
-
<h2 class="resource_title">
|
7
|
-
[P]
|
8
|
-
<%= @patron.full_name -%>
|
9
|
-
</h2>
|
10
|
-
|
11
|
-
<%- if @version -%>
|
12
|
-
<p>(<%= l(@patron.versions.find(@version).created_at) -%>)</p>
|
13
|
-
<%- end -%>
|
14
|
-
<p>
|
15
|
-
(<%= link_to_wikipedia(@patron.full_name_without_space) -%>)
|
16
|
-
</p>
|
17
|
-
|
18
|
-
<div id="tabs">
|
19
|
-
<ul>
|
20
|
-
<li title="active" class="selected"><a href="#detail"><em><%= t('page.detail') -%></em></a></li>
|
21
|
-
<%- if @patron.derived_patrons.exists? or @patron.original_patrons.exists? -%>
|
22
|
-
<li><a href="#related"><em><%= t('page.related') -%></em></a></li>
|
23
|
-
<%- end -%>
|
24
|
-
<%- if @patron.works.exists? -%>
|
25
|
-
<li><a href="#work"><em><%= t('activerecord.models.work') -%></em></a></li>
|
26
|
-
<%- end -%>
|
27
|
-
<%- if @patron.expressions.exists? -%>
|
28
|
-
<li><a href="#expression"><em><%= t('activerecord.models.expression') -%></em></a></li>
|
29
|
-
<%- end -%>
|
30
|
-
<%- if @patron.manifestations.exists? -%>
|
31
|
-
<li><a href="#manifestation"><em><%= t('activerecord.models.manifestation') -%></em></a></li>
|
32
|
-
<%- end -%>
|
33
|
-
<li><a href="#history"><em><%= t('page.history') -%></em></a></li>
|
34
|
-
</ul>
|
35
|
-
<div id="detail">
|
36
|
-
<table class="table table-striped index vcard">
|
37
|
-
<tr>
|
38
|
-
<td><strong><%= t('activerecord.attributes.patron.full_name') -%>:</strong></td>
|
39
|
-
<td>
|
40
|
-
<span class="fn"><%= @patron.full_name -%></span>
|
41
|
-
</td>
|
42
|
-
</tr>
|
43
|
-
<tr>
|
44
|
-
<td><strong><%= t('activerecord.attributes.patron.full_name_transcription') -%>:</strong></td>
|
45
|
-
<td><%= @patron.full_name_transcription -%></td>
|
46
|
-
</tr>
|
47
|
-
<%- if @patron.user -%>
|
48
|
-
<tr>
|
49
|
-
<td><strong><%= t('activerecord.attributes.user.username') -%>:</strong></td>
|
50
|
-
<td><%= link_to @patron.user.username, @patron.user -%></td>
|
51
|
-
</tr>
|
52
|
-
<%- end -%>
|
53
|
-
<tr>
|
54
|
-
<td><strong><%= t('activerecord.models.patron_type') -%>:</strong></td>
|
55
|
-
<td><%= @patron.patron_type.display_name.localize -%></td>
|
56
|
-
</tr>
|
57
|
-
<tr>
|
58
|
-
<td><strong><%= t('activerecord.attributes.patron.email') -%>:</strong></td>
|
59
|
-
<td>
|
60
|
-
<%= mail_to @patron.email, nil, :class => 'email' -%>
|
61
|
-
</td>
|
62
|
-
</tr>
|
63
|
-
<tr>
|
64
|
-
<td><strong><%= t('activerecord.attributes.patron.url') -%>:</strong></td>
|
65
|
-
<td>
|
66
|
-
<%= link_to @patron.url, @patron.url, :class => 'url' if @patron.url? -%>
|
67
|
-
</td>
|
68
|
-
</tr>
|
69
|
-
<tr>
|
70
|
-
<td><strong><%= t('activerecord.attributes.patron.other_designation') -%>:</strong></td>
|
71
|
-
<td><%= @patron.other_designation -%></td>
|
72
|
-
</tr>
|
73
|
-
<tr>
|
74
|
-
<td><strong><%= t('activerecord.attributes.patron.place') -%>:</strong></td>
|
75
|
-
<td><%= @patron.place -%></td>
|
76
|
-
</tr>
|
77
|
-
<tr>
|
78
|
-
<td><strong><%= t('activerecord.models.language') -%>:</strong></td>
|
79
|
-
<td><%= @patron.language.display_name.localize -%></td>
|
80
|
-
</tr>
|
81
|
-
<tr>
|
82
|
-
<td><strong><%= t('activerecord.attributes.patron.note') -%>:</strong></td>
|
83
|
-
<td><%= @patron.note -%></td>
|
84
|
-
</tr>
|
85
|
-
<tr>
|
86
|
-
<td><strong><%= t('page.created_at') -%>:</strong></td>
|
87
|
-
<td><%= l(@patron.created_at) -%></td>
|
88
|
-
</tr>
|
89
|
-
<tr>
|
90
|
-
<td><strong><%= t('page.updated_at') -%>:</strong></td>
|
91
|
-
<td><%= l(@patron.updated_at) -%></td>
|
92
|
-
</tr>
|
93
|
-
</table>
|
94
|
-
</div>
|
95
|
-
<%- unless @patron.derived_patrons.empty? and @patron.original_patrons.empty? -%>
|
96
|
-
<%= render 'patrons/patron_list' -%>
|
97
|
-
<%- end -%>
|
98
|
-
<%- unless @works.blank? -%>
|
99
|
-
<%= render 'patrons/work_list' -%>
|
100
|
-
<%- end -%>
|
101
|
-
<%- unless @expressions.blank? -%>
|
102
|
-
<%= render 'patrons/expression_list' -%>
|
103
|
-
<%- end -%>
|
104
|
-
<%- unless @manifestations.blank? -%>
|
105
|
-
<%= render 'patrons/manifestation_list' -%>
|
106
|
-
<%- end -%>
|
107
|
-
<%= render 'history_list' -%>
|
108
|
-
</div>
|
109
|
-
</div>
|
110
|
-
</div>
|
111
|
-
|
112
|
-
<div id="submenu" class="ui-corner-all">
|
113
|
-
<div id="manifestation_book_jacket">
|
114
|
-
<%= patron_custom_book_jacket(@patron) -%>
|
115
|
-
</div>
|
116
|
-
<ul>
|
117
|
-
<%- if @patron.picture_files.exists? -%>
|
118
|
-
<li><%= t('page.total') %>: <%= @patron.picture_files.count %> <%= t('page.number_of_pictures', :count => @patron.picture_files.count) %></li>
|
119
|
-
<li><%= link_to t('page.listing', :model => t('activerecord.models.picture_file')), patron_picture_files_path(@patron) -%></li>
|
120
|
-
<script type="text/javascript">
|
121
|
-
$(document).ready(function(){
|
122
|
-
$("a[rel='patron_<%= @patron.id -%>']").colorbox({transition:"none", photo:true});
|
123
|
-
$("a[rel='patron_<%= @patron.id -%>_other']").colorbox({transition:"none", photo:true});
|
124
|
-
})
|
125
|
-
</script>
|
126
|
-
<% end %>
|
127
|
-
<%- if can? :create, PictureFile -%>
|
128
|
-
<li><%= link_to t('page.new', :model => t('activerecord.models.picture_file')), new_patron_picture_file_path(@patron) -%></li>
|
129
|
-
<%- end -%>
|
130
|
-
</ul>
|
131
|
-
<ul>
|
132
|
-
<li><%= back_to_index(flash[:page_info]) -%></li>
|
133
|
-
<%- if can? :create, User -%>
|
134
|
-
<%- if @patron.user.blank? -%>
|
135
|
-
<li><%= link_to t('patron.activate_as_user'), new_user_path(:patron_id => @patron.id) -%></li>
|
136
|
-
<%- else -%>
|
137
|
-
<li><%= link_to t('page.editing', :model => t('activerecord.models.user')), edit_user_path(@patron.user) -%></li>
|
138
|
-
<%- end -%>
|
139
|
-
<li><%= link_to t('page.edit'), edit_patron_path(@patron) -%></li>
|
140
|
-
<li><%= link_to t('patron.add_derivation'), patron_patrons_path(@patron, :mode => 'add') -%></li>
|
141
|
-
<%- end -%>
|
142
|
-
<%- if can? :delete, @patron -%>
|
143
|
-
<li><%= link_to t('page.new', :model => t('activerecord.models.patron')), new_patron_path -%></li>
|
144
|
-
<li><%= link_to t('page.destroy'), @patron, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%></li>
|
145
|
-
<%- end -%>
|
146
|
-
</ul>
|
147
|
-
<ul>
|
148
|
-
<li><%= link_to t('page.listing', :model => t('activerecord.models.work')), creator_manifestations_path(@patron) -%></li>
|
149
|
-
<li><%= link_to t('page.listing', :model => t('activerecord.models.expression')), contributor_manifestations_path(@patron) -%></li>
|
150
|
-
<li><%= link_to t('page.listing', :model => t('activerecord.models.manifestation')), publisher_manifestations_path(@patron) -%></li>
|
151
|
-
</ul>
|
152
|
-
</div>
|
@@ -1,69 +0,0 @@
|
|
1
|
-
<div data-role="header">
|
2
|
-
<h1 class="title"><%= t('page.showing', :model => t('activerecord.models.patron')) -%></h1>
|
3
|
-
</div>
|
4
|
-
<div data-role="content">
|
5
|
-
<h2 class="resource_title">
|
6
|
-
[P]
|
7
|
-
<%= @patron.full_name -%>
|
8
|
-
</h2>
|
9
|
-
<div id="detail">
|
10
|
-
<table class="table table-striped index vcard">
|
11
|
-
<tr>
|
12
|
-
<td><strong><%= t('activerecord.attributes.patron.full_name') -%>:</strong></td>
|
13
|
-
<td>
|
14
|
-
<span class="fn"><%= @patron.full_name -%></span>
|
15
|
-
</td>
|
16
|
-
</tr>
|
17
|
-
<tr>
|
18
|
-
<td><strong><%= t('activerecord.attributes.patron.full_name_transcription') -%>:</strong></td>
|
19
|
-
<td><%= @patron.full_name_transcription -%></td>
|
20
|
-
</tr>
|
21
|
-
<%- if @patron.user -%>
|
22
|
-
<tr>
|
23
|
-
<td><strong><%= t('activerecord.attributes.user.username') -%>:</strong></td>
|
24
|
-
<td><%= link_to @patron.user.username, @patron.user -%></td>
|
25
|
-
</tr>
|
26
|
-
<%- end -%>
|
27
|
-
<tr>
|
28
|
-
<td><strong><%= t('activerecord.models.patron_type') -%>:</strong></td>
|
29
|
-
<td><%= @patron.patron_type.display_name.localize -%></td>
|
30
|
-
</tr>
|
31
|
-
<tr>
|
32
|
-
<td><strong><%= t('activerecord.attributes.patron.email') -%>:</strong></td>
|
33
|
-
<td>
|
34
|
-
<%= mail_to @patron.email, nil, :class => 'email' -%>
|
35
|
-
</td>
|
36
|
-
</tr>
|
37
|
-
<tr>
|
38
|
-
<td><strong><%= t('activerecord.attributes.patron.url') -%>:</strong></td>
|
39
|
-
<td>
|
40
|
-
<%= link_to @patron.url, @patron.url, :class => 'url' if @patron.url? -%>
|
41
|
-
</td>
|
42
|
-
</tr>
|
43
|
-
<tr>
|
44
|
-
<td><strong><%= t('activerecord.attributes.patron.other_designation') -%>:</strong></td>
|
45
|
-
<td><%= @patron.other_designation -%></td>
|
46
|
-
</tr>
|
47
|
-
<tr>
|
48
|
-
<td><strong><%= t('activerecord.attributes.patron.place') -%>:</strong></td>
|
49
|
-
<td><%= @patron.place -%></td>
|
50
|
-
</tr>
|
51
|
-
<tr>
|
52
|
-
<td><strong><%= t('activerecord.models.language') -%>:</strong></td>
|
53
|
-
<td><%= @patron.language.display_name.localize -%></td>
|
54
|
-
</tr>
|
55
|
-
<tr>
|
56
|
-
<td><strong><%= t('activerecord.attributes.patron.note') -%>:</strong></td>
|
57
|
-
<td><%= @patron.note -%></td>
|
58
|
-
</tr>
|
59
|
-
<tr>
|
60
|
-
<td><strong><%= t('page.created_at') -%>:</strong></td>
|
61
|
-
<td><%= l(@patron.created_at) -%></td>
|
62
|
-
</tr>
|
63
|
-
<tr>
|
64
|
-
<td><strong><%= t('page.updated_at') -%>:</strong></td>
|
65
|
-
<td><%= l(@patron.updated_at) -%></td>
|
66
|
-
</tr>
|
67
|
-
</table>
|
68
|
-
</div>
|
69
|
-
</div>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
class CreatePatronImportFiles < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table :patron_import_files do |t|
|
4
|
-
t.integer :parent_id
|
5
|
-
t.string :content_type
|
6
|
-
t.integer :size
|
7
|
-
t.integer :user_id
|
8
|
-
t.text :note
|
9
|
-
t.datetime :executed_at
|
10
|
-
t.string :state
|
11
|
-
t.string :patron_import_file_name
|
12
|
-
t.string :patron_import_content_type
|
13
|
-
t.integer :patron_import_file_size
|
14
|
-
t.datetime :patron_import_updated_at
|
15
|
-
|
16
|
-
t.timestamps
|
17
|
-
end
|
18
|
-
add_index :patron_import_files, :parent_id
|
19
|
-
add_index :patron_import_files, :user_id
|
20
|
-
add_index :patron_import_files, :state
|
21
|
-
end
|
22
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
class CreatePatronRelationships < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table :patron_relationships do |t|
|
4
|
-
t.integer :parent_id
|
5
|
-
t.integer :child_id
|
6
|
-
t.integer :patron_relationship_type_id
|
7
|
-
|
8
|
-
t.timestamps
|
9
|
-
end
|
10
|
-
add_index :patron_relationships, :parent_id
|
11
|
-
add_index :patron_relationships, :child_id
|
12
|
-
end
|
13
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
class AddPositionToPatronRelationship < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
add_column :manifestation_relationships, :position, :integer
|
4
|
-
add_column :patron_relationships, :position, :integer
|
5
|
-
end
|
6
|
-
|
7
|
-
def self.down
|
8
|
-
remove_column :patron_relationships, :position
|
9
|
-
remove_column :manifestation_relationships, :position
|
10
|
-
end
|
11
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
class AddBirthDateAndDeathDateToPatron < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
add_column :patrons, :birth_date, :string
|
4
|
-
add_column :patrons, :death_date, :string
|
5
|
-
end
|
6
|
-
|
7
|
-
def self.down
|
8
|
-
remove_column :patrons, :death_date
|
9
|
-
remove_column :patrons, :birth_date
|
10
|
-
end
|
11
|
-
end
|
@@ -1,321 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
describe PatronImportFilesController do
|
5
|
-
fixtures :all
|
6
|
-
|
7
|
-
describe "GET index" do
|
8
|
-
describe "When logged in as Administrator" do
|
9
|
-
before(:each) do
|
10
|
-
sign_in FactoryGirl.create(:admin)
|
11
|
-
end
|
12
|
-
|
13
|
-
it "assigns all patron_import_files as @patron_import_files" do
|
14
|
-
get :index
|
15
|
-
assigns(:patron_import_files).should eq(PatronImportFile.page(1))
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
describe "When logged in as Librarian" do
|
20
|
-
before(:each) do
|
21
|
-
sign_in FactoryGirl.create(:librarian)
|
22
|
-
end
|
23
|
-
|
24
|
-
it "assigns all patron_import_files as @patron_import_files" do
|
25
|
-
get :index
|
26
|
-
assigns(:patron_import_files).should eq(PatronImportFile.page(1))
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
describe "When logged in as User" do
|
31
|
-
before(:each) do
|
32
|
-
sign_in FactoryGirl.create(:user)
|
33
|
-
end
|
34
|
-
|
35
|
-
it "assigns empty as @patron_import_files" do
|
36
|
-
get :index
|
37
|
-
assigns(:patron_import_files).should be_empty
|
38
|
-
response.should be_forbidden
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
describe "When not logged in" do
|
43
|
-
it "assigns empty as @patron_import_files" do
|
44
|
-
get :index
|
45
|
-
assigns(:patron_import_files).should be_empty
|
46
|
-
response.should redirect_to(new_user_session_url)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
describe "GET show" do
|
52
|
-
describe "When logged in as Administrator" do
|
53
|
-
before(:each) do
|
54
|
-
sign_in FactoryGirl.create(:admin)
|
55
|
-
end
|
56
|
-
|
57
|
-
it "assigns the requested patron_import_file as @patron_import_file" do
|
58
|
-
get :show, :id => 1
|
59
|
-
assigns(:patron_import_file).should eq(PatronImportFile.find(1))
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
describe "When logged in as Librarian" do
|
64
|
-
before(:each) do
|
65
|
-
sign_in FactoryGirl.create(:librarian)
|
66
|
-
end
|
67
|
-
|
68
|
-
it "assigns the requested patron_import_file as @patron_import_file" do
|
69
|
-
get :show, :id => 1
|
70
|
-
assigns(:patron_import_file).should eq(PatronImportFile.find(1))
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
describe "When logged in as User" do
|
75
|
-
before(:each) do
|
76
|
-
sign_in FactoryGirl.create(:user)
|
77
|
-
end
|
78
|
-
|
79
|
-
it "assigns the requested patron_import_file as @patron_import_file" do
|
80
|
-
get :show, :id => 1
|
81
|
-
assigns(:patron_import_file).should eq(PatronImportFile.find(1))
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
describe "When not logged in" do
|
86
|
-
it "assigns the requested patron_import_file as @patron_import_file" do
|
87
|
-
get :show, :id => 1
|
88
|
-
assigns(:patron_import_file).should eq(PatronImportFile.find(1))
|
89
|
-
response.should redirect_to(new_user_session_url)
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
describe "GET new" do
|
95
|
-
describe "When logged in as Administrator" do
|
96
|
-
before(:each) do
|
97
|
-
sign_in FactoryGirl.create(:admin)
|
98
|
-
end
|
99
|
-
|
100
|
-
it "assigns the requested patron_import_file as @patron_import_file" do
|
101
|
-
get :new
|
102
|
-
assigns(:patron_import_file).should_not be_valid
|
103
|
-
response.should be_success
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
describe "When logged in as Librarian" do
|
108
|
-
before(:each) do
|
109
|
-
sign_in FactoryGirl.create(:librarian)
|
110
|
-
end
|
111
|
-
|
112
|
-
it "should not assign the requested patron_import_file as @patron_import_file" do
|
113
|
-
get :new
|
114
|
-
assigns(:patron_import_file).should_not be_valid
|
115
|
-
response.should be_success
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
describe "When logged in as User" do
|
120
|
-
before(:each) do
|
121
|
-
sign_in FactoryGirl.create(:user)
|
122
|
-
end
|
123
|
-
|
124
|
-
it "should not assign the requested patron_import_file as @patron_import_file" do
|
125
|
-
get :new
|
126
|
-
assigns(:patron_import_file).should_not be_valid
|
127
|
-
response.should be_forbidden
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
|
-
describe "When not logged in" do
|
132
|
-
it "should not assign the requested patron_import_file as @patron_import_file" do
|
133
|
-
get :new
|
134
|
-
assigns(:patron_import_file).should_not be_valid
|
135
|
-
response.should redirect_to(new_user_session_url)
|
136
|
-
end
|
137
|
-
end
|
138
|
-
end
|
139
|
-
|
140
|
-
describe "POST create" do
|
141
|
-
describe "When logged in as Librarian" do
|
142
|
-
before(:each) do
|
143
|
-
@user = FactoryGirl.create(:librarian)
|
144
|
-
sign_in @user
|
145
|
-
end
|
146
|
-
|
147
|
-
it "should create patron_import_file" do
|
148
|
-
post :create, :patron_import_file => {:patron_import => fixture_file_upload("/../../examples/patron_import_file_sample1.tsv", 'text/csv') }
|
149
|
-
assigns(:patron_import_file).should be_valid
|
150
|
-
assigns(:patron_import_file).user.username.should eq @user.username
|
151
|
-
response.should redirect_to patron_import_file_url(assigns(:patron_import_file))
|
152
|
-
end
|
153
|
-
|
154
|
-
it "should import user" do
|
155
|
-
old_patrons_count = Patron.count
|
156
|
-
post :create, :patron_import_file => {:patron_import => fixture_file_upload("/../../examples/patron_import_file_sample2.tsv", 'text/csv') }
|
157
|
-
assigns(:patron_import_file).import_start
|
158
|
-
Patron.count.should eq old_patrons_count + 7
|
159
|
-
response.should redirect_to patron_import_file_url(assigns(:patron_import_file))
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
|
-
describe "When logged in as User" do
|
164
|
-
before(:each) do
|
165
|
-
@user = FactoryGirl.create(:user)
|
166
|
-
sign_in @user
|
167
|
-
end
|
168
|
-
|
169
|
-
it "should be forbidden" do
|
170
|
-
post :create, :patron_import_file => {:patron_import => fixture_file_upload("/../..//examples/patron_import_file_sample1.tsv", 'text/csv') }
|
171
|
-
response.should be_forbidden
|
172
|
-
end
|
173
|
-
end
|
174
|
-
|
175
|
-
describe "When not logged in" do
|
176
|
-
it "should be redirect to new session url" do
|
177
|
-
post :create, :patron_import_file => {:patron_import => fixture_file_upload("/../../examples/patron_import_file_sample1.tsv", 'text/csv') }
|
178
|
-
response.should redirect_to new_user_session_url
|
179
|
-
end
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
describe "GET edit" do
|
184
|
-
describe "When logged in as Administrator" do
|
185
|
-
before(:each) do
|
186
|
-
sign_in FactoryGirl.create(:admin)
|
187
|
-
end
|
188
|
-
|
189
|
-
it "assigns the requested patron_import_file as @patron_import_file" do
|
190
|
-
patron_import_file = patron_import_files(:patron_import_file_00001)
|
191
|
-
get :edit, :id => patron_import_file.id
|
192
|
-
assigns(:patron_import_file).should eq(patron_import_file)
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
|
-
describe "When logged in as Librarian" do
|
197
|
-
before(:each) do
|
198
|
-
sign_in FactoryGirl.create(:librarian)
|
199
|
-
end
|
200
|
-
|
201
|
-
it "assigns the requested patron_import_file as @patron_import_file" do
|
202
|
-
patron_import_file = patron_import_files(:patron_import_file_00001)
|
203
|
-
get :edit, :id => patron_import_file.id
|
204
|
-
assigns(:patron_import_file).should eq(patron_import_file)
|
205
|
-
end
|
206
|
-
end
|
207
|
-
|
208
|
-
describe "When logged in as User" do
|
209
|
-
before(:each) do
|
210
|
-
sign_in FactoryGirl.create(:user)
|
211
|
-
end
|
212
|
-
|
213
|
-
it "assigns the requested patron_import_file as @patron_import_file" do
|
214
|
-
patron_import_file = patron_import_files(:patron_import_file_00001)
|
215
|
-
get :edit, :id => patron_import_file.id
|
216
|
-
response.should be_forbidden
|
217
|
-
end
|
218
|
-
end
|
219
|
-
|
220
|
-
describe "When not logged in" do
|
221
|
-
it "should not assign the requested patron_import_file as @patron_import_file" do
|
222
|
-
patron_import_file = patron_import_files(:patron_import_file_00001)
|
223
|
-
get :edit, :id => patron_import_file.id
|
224
|
-
response.should redirect_to(new_user_session_url)
|
225
|
-
end
|
226
|
-
end
|
227
|
-
end
|
228
|
-
|
229
|
-
describe "PUT update" do
|
230
|
-
describe "When logged in as Librarian" do
|
231
|
-
before(:each) do
|
232
|
-
sign_in FactoryGirl.create(:librarian)
|
233
|
-
end
|
234
|
-
|
235
|
-
it "should update patron_import_file" do
|
236
|
-
put :update, :id => patron_import_files(:patron_import_file_00003).id, :patron_import_file => { }
|
237
|
-
response.should redirect_to patron_import_file_url(assigns(:patron_import_file))
|
238
|
-
end
|
239
|
-
end
|
240
|
-
|
241
|
-
describe "When logged in as User" do
|
242
|
-
before(:each) do
|
243
|
-
sign_in FactoryGirl.create(:user)
|
244
|
-
end
|
245
|
-
|
246
|
-
it "should not update patron_import_file" do
|
247
|
-
put :update, :id => patron_import_files(:patron_import_file_00003).id, :patron_import_file => { }
|
248
|
-
response.should be_forbidden
|
249
|
-
end
|
250
|
-
end
|
251
|
-
|
252
|
-
describe "When not logged in" do
|
253
|
-
it "should not update patron_import_file" do
|
254
|
-
put :update, :id => patron_import_files(:patron_import_file_00003).id, :patron_import_file => { }
|
255
|
-
response.should redirect_to new_user_session_url
|
256
|
-
end
|
257
|
-
end
|
258
|
-
end
|
259
|
-
|
260
|
-
describe "DELETE destroy" do
|
261
|
-
before(:each) do
|
262
|
-
@patron_import_file = patron_import_files(:patron_import_file_00001)
|
263
|
-
end
|
264
|
-
|
265
|
-
describe "When logged in as Administrator" do
|
266
|
-
before(:each) do
|
267
|
-
sign_in FactoryGirl.create(:admin)
|
268
|
-
end
|
269
|
-
|
270
|
-
it "destroys the requested patron_import_file" do
|
271
|
-
delete :destroy, :id => @patron_import_file.id
|
272
|
-
end
|
273
|
-
|
274
|
-
it "redirects to the patron_import_files list" do
|
275
|
-
delete :destroy, :id => @patron_import_file.id
|
276
|
-
response.should redirect_to(patron_import_files_url)
|
277
|
-
end
|
278
|
-
end
|
279
|
-
|
280
|
-
describe "When logged in as Librarian" do
|
281
|
-
before(:each) do
|
282
|
-
sign_in FactoryGirl.create(:librarian)
|
283
|
-
end
|
284
|
-
|
285
|
-
it "destroys the requested patron_import_file" do
|
286
|
-
delete :destroy, :id => @patron_import_file.id
|
287
|
-
end
|
288
|
-
|
289
|
-
it "redirects to the patron_import_files list" do
|
290
|
-
delete :destroy, :id => @patron_import_file.id
|
291
|
-
response.should redirect_to(patron_import_files_url)
|
292
|
-
end
|
293
|
-
end
|
294
|
-
|
295
|
-
describe "When logged in as User" do
|
296
|
-
before(:each) do
|
297
|
-
sign_in FactoryGirl.create(:user)
|
298
|
-
end
|
299
|
-
|
300
|
-
it "destroys the requested patron_import_file" do
|
301
|
-
delete :destroy, :id => @patron_import_file.id
|
302
|
-
end
|
303
|
-
|
304
|
-
it "should be forbidden" do
|
305
|
-
delete :destroy, :id => @patron_import_file.id
|
306
|
-
response.should be_forbidden
|
307
|
-
end
|
308
|
-
end
|
309
|
-
|
310
|
-
describe "When not logged in" do
|
311
|
-
it "destroys the requested patron_import_file" do
|
312
|
-
delete :destroy, :id => @patron_import_file.id
|
313
|
-
end
|
314
|
-
|
315
|
-
it "should be forbidden" do
|
316
|
-
delete :destroy, :id => @patron_import_file.id
|
317
|
-
response.should redirect_to(new_user_session_url)
|
318
|
-
end
|
319
|
-
end
|
320
|
-
end
|
321
|
-
end
|