enju_inventory 0.1.11.pre9 → 0.1.11.pre10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/inventories_controller.rb +73 -3
  3. data/app/views/inventories/edit.html.erb +2 -2
  4. data/app/views/inventories/index.html.erb +2 -2
  5. data/app/views/inventories/new.html.erb +2 -2
  6. data/app/views/inventories/show.html.erb +2 -2
  7. data/app/views/inventory_files/edit.html.erb +2 -2
  8. data/app/views/inventory_files/index.html.erb +3 -3
  9. data/app/views/inventory_files/new.html.erb +2 -2
  10. data/app/views/inventory_files/show.html.erb +3 -3
  11. data/lib/enju_inventory/engine.rb +1 -2
  12. data/lib/enju_inventory/version.rb +1 -1
  13. data/spec/controllers/inventories_controller_spec.rb +40 -37
  14. data/spec/controllers/inventory_files_controller_spec.rb +56 -62
  15. data/spec/dummy/app/models/user.rb +5 -25
  16. data/spec/dummy/db/development.sqlite3 +0 -0
  17. data/spec/dummy/db/migrate/001_create_agents.rb +50 -0
  18. data/spec/dummy/db/migrate/002_devise_create_users.rb +46 -0
  19. data/spec/dummy/db/migrate/005_create_manifestations.rb +44 -0
  20. data/spec/dummy/db/migrate/006_create_items.rb +1 -12
  21. data/spec/dummy/db/migrate/012_create_owns.rb +12 -0
  22. data/spec/dummy/db/migrate/015_create_creates.rb +12 -0
  23. data/spec/dummy/db/migrate/041_create_roles.rb +13 -0
  24. data/spec/dummy/db/migrate/047_create_produces.rb +12 -0
  25. data/spec/dummy/db/migrate/059_create_libraries.rb +28 -0
  26. data/spec/dummy/db/migrate/069_create_shelves.rb +15 -0
  27. data/spec/dummy/db/migrate/073_create_carrier_types.rb +11 -0
  28. data/spec/dummy/db/migrate/077_create_user_groups.rb +12 -0
  29. data/spec/dummy/db/migrate/080_create_library_groups.rb +0 -1
  30. data/spec/dummy/db/migrate/112_create_frequencies.rb +12 -0
  31. data/spec/dummy/db/migrate/117_create_form_of_works.rb +12 -0
  32. data/spec/dummy/db/migrate/120_create_baskets.rb +12 -0
  33. data/spec/dummy/db/migrate/124_create_bookstores.rb +17 -0
  34. data/spec/dummy/db/migrate/125_create_donates.rb +12 -0
  35. data/spec/dummy/db/migrate/130_create_request_status_types.rb +12 -0
  36. data/spec/dummy/db/migrate/131_create_request_types.rb +12 -0
  37. data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +13 -0
  38. data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +13 -0
  39. data/spec/dummy/db/migrate/20080905191442_create_agent_types.rb +12 -0
  40. data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +17 -0
  41. data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +14 -0
  42. data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +17 -0
  43. data/spec/dummy/db/migrate/20081025083323_create_countries.rb +28 -0
  44. data/spec/dummy/db/migrate/20081025083905_create_languages.rb +23 -0
  45. data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +15 -0
  46. data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +20 -0
  47. data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +20 -0
  48. data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +15 -0
  49. data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +15 -0
  50. data/spec/dummy/db/migrate/20090719201843_create_extents.rb +12 -0
  51. data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +12 -0
  52. data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +12 -0
  53. data/spec/dummy/db/migrate/20090812151902_create_agent_relationship_types.rb +12 -0
  54. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +27 -0
  55. data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +12 -0
  56. data/spec/dummy/db/migrate/20091202124834_create_versions.rb +18 -0
  57. data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +13 -0
  58. data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +14 -0
  59. data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +13 -0
  60. data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +9 -0
  61. data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +10 -0
  62. data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +13 -0
  63. data/spec/dummy/db/migrate/{20111201163718_create_user_has_roles.rb → 20100606065209_create_user_has_roles.rb} +2 -0
  64. data/spec/dummy/db/migrate/20100606073747_create_agent_relationships.rb +13 -0
  65. data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +12 -0
  66. data/spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb +11 -0
  67. data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +15 -0
  68. data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +11 -0
  69. data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +9 -0
  70. data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +9 -0
  71. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +11 -0
  72. data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +11 -0
  73. data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +9 -0
  74. data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +9 -0
  75. data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +11 -0
  76. data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +9 -0
  77. data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +12 -0
  78. data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +13 -0
  79. data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +10 -0
  80. data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +9 -0
  81. data/spec/dummy/db/migrate/{20111201121844_create_roles.rb → 20111124110059_create_create_types.rb} +2 -2
  82. data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +12 -0
  83. data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +12 -0
  84. data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +7 -0
  85. data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +5 -0
  86. data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +6 -0
  87. data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +12 -0
  88. data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +6 -0
  89. data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +6 -0
  90. data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +14 -0
  91. data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +5 -0
  92. data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +5 -0
  93. data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +5 -0
  94. data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +5 -0
  95. data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +5 -0
  96. data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +5 -0
  97. data/spec/dummy/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +5 -0
  98. data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +5 -0
  99. data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +5 -0
  100. data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +5 -0
  101. data/spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +6 -0
  102. data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +5 -0
  103. data/spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb +5 -0
  104. data/spec/dummy/db/migrate/20121116033446_add_doi_to_manifestation.rb +6 -0
  105. data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +16 -0
  106. data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +6 -0
  107. data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +5 -0
  108. data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +7 -0
  109. data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +5 -0
  110. data/spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +6 -0
  111. data/spec/dummy/db/migrate/20130506175303_create_identifier_types.rb +12 -0
  112. data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +15 -0
  113. data/spec/dummy/db/migrate/20130509185724_add_statement_of_responsibility_to_manifestation.rb +5 -0
  114. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +18 -0
  115. data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +11 -0
  116. data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +20 -0
  117. data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +14 -0
  118. data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +14 -0
  119. data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +14 -0
  120. data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +14 -0
  121. data/spec/dummy/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +11 -0
  122. data/spec/dummy/db/migrate/20140614065404_create_resource_export_files.rb +11 -0
  123. data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +14 -0
  124. data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +5 -0
  125. data/spec/dummy/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +5 -0
  126. data/spec/dummy/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +5 -0
  127. data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +11 -0
  128. data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +14 -0
  129. data/spec/dummy/db/migrate/20140720140916_add_binding_item_identifier_to_item.rb +8 -0
  130. data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +5 -0
  131. data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +5 -0
  132. data/spec/dummy/db/migrate/20140721151416_add_default_shelf_id_to_resource_import_file.rb +5 -0
  133. data/spec/dummy/db/migrate/20140802082007_add_manifestation_id_to_item.rb +6 -0
  134. data/spec/dummy/db/migrate/20140811031145_add_expired_at_to_profile.rb +5 -0
  135. data/spec/dummy/db/migrate/20140813182425_add_publication_place_to_manifestation.rb +5 -0
  136. data/spec/dummy/db/schema.rb +860 -28
  137. data/spec/dummy/db/test.sqlite3 +0 -0
  138. data/spec/dummy/private/system/inventory_files/inventories/000/000/001/original/inventory_file_sample.tsv +7 -0
  139. data/spec/factories/user.rb +6 -0
  140. data/spec/fixtures/libraries.yml +102 -0
  141. data/spec/fixtures/library_groups.yml +15 -18
  142. data/spec/fixtures/profiles.yml +98 -0
  143. data/spec/fixtures/users.yml +3 -21
  144. data/spec/models/inventory_file_spec.rb +1 -1
  145. data/spec/spec_helper.rb +5 -1
  146. metadata +297 -36
  147. data/app/models/setting.rb +0 -4
  148. data/spec/dummy/app/models/ability.rb +0 -20
  149. data/spec/dummy/app/views/page/403.html.erb +0 -9
  150. data/spec/dummy/app/views/page/403.mobile.erb +0 -5
  151. data/spec/dummy/app/views/page/403.xml.erb +0 -4
  152. data/spec/dummy/app/views/page/404.html.erb +0 -9
  153. data/spec/dummy/app/views/page/404.mobile.erb +0 -5
  154. data/spec/dummy/app/views/page/404.xml.erb +0 -4
  155. data/spec/dummy/db/migrate/20111201155456_create_users.rb +0 -13
  156. data/spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb +0 -52
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c171753db8ecb3be2c070658826980b66c0007f1
4
- data.tar.gz: 576651552771d8f1aede61f34a97557e9b13c458
3
+ metadata.gz: 85e9adb15d7c764bb35726ef2712ef5869b27e37
4
+ data.tar.gz: c548a5a5a8a447fab6fc84e9f9c806626dc3b971
5
5
  SHA512:
6
- metadata.gz: 05ba8f8a4403845bc912ec991c0bacbd9ed47391811d02fbde6a8454a7aad9f663da20a434c87b836e6eda66f486b23ada4a9f0839f2aecaf38a6f808d8317eb
7
- data.tar.gz: 78656c031e03d9883620bd4ec0d8087801e3cfcb4c130827e7d35383edb576202e84d54201cad577ceac901ff7ecdd221197d75440364dbbdaa6cd853681d81c
6
+ metadata.gz: 4e480c7b2328b63134bc3016bb531708c7fd220758102f9e4b85ee8c05e1bde0c2c0850e69e210731200562d8eacda5d6024413ebd7b88759827d6f9deb1ff89
7
+ data.tar.gz: 94e5b5da6211659c6c8eeafc45202a7aa4499803122b5bedc704712b293629ff2cd6c7efadfafa73b16b00a4e68c045ef1b23ccfc692d7bdb6747288079c740e
@@ -1,8 +1,78 @@
1
- class InventoriesController < InheritedResources::Base
2
- respond_to :html, :json
1
+ class InventoriesController < ApplicationController
3
2
  load_and_authorize_resource
4
-
3
+ # GET /inventories
4
+ # GET /inventories.json
5
5
  def index
6
6
  @inventories = Inventory.page(params[:page])
7
+
8
+ respond_to do |format|
9
+ format.html # index.html.erb
10
+ format.json { render json: @inventories }
11
+ end
12
+ end
13
+
14
+ # GET /inventories/1
15
+ # GET /inventories/1.json
16
+ def show
17
+ respond_to do |format|
18
+ format.html # show.html.erb
19
+ format.json { render json: @inventory }
20
+ end
21
+ end
22
+
23
+ # GET /inventories/new
24
+ # GET /inventories/new.json
25
+ def new
26
+ @inventory = Inventory.new
27
+
28
+ respond_to do |format|
29
+ format.html # new.html.erb
30
+ format.json { render json: @inventory }
31
+ end
32
+ end
33
+
34
+ # GET /inventories/1/edit
35
+ def edit
36
+ end
37
+
38
+ # POST /inventories
39
+ # POST /inventories.json
40
+ def create
41
+ @inventory = Inventory.new(params[:inventory])
42
+
43
+ respond_to do |format|
44
+ if @inventory.save
45
+ format.html { redirect_to @inventory, notice: t('controller.successfully_created', model: t('activerecord.models.inventory')) }
46
+ format.json { render json: @inventory, status: :created, location: @inventory }
47
+ else
48
+ format.html { render action: "new" }
49
+ format.json { render json: @inventory.errors, status: :unprocessable_entity }
50
+ end
51
+ end
52
+ end
53
+
54
+ # PUT /inventories/1
55
+ # PUT /inventories/1.json
56
+ def update
57
+ respond_to do |format|
58
+ if @inventory.update_attributes(params[:inventory])
59
+ format.html { redirect_to @inventory, notice: t('controller.successfully_updated', model: t('activerecord.models.inventory')) }
60
+ format.json { head :no_content }
61
+ else
62
+ format.html { render action: "edit" }
63
+ format.json { render json: @inventory.errors, status: :unprocessable_entity }
64
+ end
65
+ end
66
+ end
67
+
68
+ # DELETE /inventories/1
69
+ # DELETE /inventories/1.json
70
+ def destroy
71
+ @inventory.destroy
72
+
73
+ respond_to do |format|
74
+ format.html { redirect_to inventories_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.inventory')) }
75
+ format.json { head :no_content }
76
+ end
7
77
  end
8
78
  end
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.editing', :model => t('activerecord.models.inventory')) -%> </h1>
3
3
  <div id="content_list">
4
4
 
@@ -25,7 +25,7 @@
25
25
  </div>
26
26
  </div>
27
27
 
28
- <div id="submenu" class="ui-corner-all">
28
+ <div id="submenu" class="ui-corner-all ui-widget-content">
29
29
  <ul>
30
30
  <li><%= link_to t('page.show'), @inventory -%></li>
31
31
  <li><%= link_to t('page.back'), inventories_path -%></li>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.inventory')) -%></h1>
3
3
  <div id="content_list">
4
4
 
@@ -27,7 +27,7 @@
27
27
  </div>
28
28
  </div>
29
29
 
30
- <div id="submenu" class="ui-corner-all">
30
+ <div id="submenu" class="ui-corner-all ui-widget-content">
31
31
  <ul>
32
32
  <li><%= link_to t('page.new', :model => t('activerecord.models.inventory')), new_inventory_path -%></li>
33
33
  </ul>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.new', :model => t('activerecord.models.inventory')) -%> </h1>
3
3
  <div id="content_list">
4
4
 
@@ -25,7 +25,7 @@
25
25
  </div>
26
26
  </div>
27
27
 
28
- <div id="submenu" class="ui-corner-all">
28
+ <div id="submenu" class="ui-corner-all ui-widget-content">
29
29
  <ul>
30
30
  <li><%= link_to t('page.back'), inventories_path -%></li>
31
31
  </ul>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.showing', :model => t('activerecord.models.inventory')) -%> </h1>
3
3
  <div id="content_list">
4
4
  <p id="notice"><%= notice %></p>
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
  </div>
23
23
 
24
- <div id="submenu" class="ui-corner-all">
24
+ <div id="submenu" class="ui-corner-all ui-widget-content">
25
25
  <ul>
26
26
  <li><%= link_to t('page.edit'), edit_inventory_path(@inventory) -%></li>
27
27
  <li><%= back_to_index(flash[:page_info]) -%></li>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.editing', :model => t('activerecord.models.inventory_file')) -%></h1>
3
3
  <div id="content_list">
4
4
 
@@ -37,7 +37,7 @@
37
37
  </div>
38
38
  </div>
39
39
 
40
- <div id="submenu" class="ui-corner-all">
40
+ <div id="submenu" class="ui-corner-all ui-widget-content">
41
41
  <ul>
42
42
  <li><%= link_to t('page.show'), @inventory_file -%></li>
43
43
  <li><%= link_to t('page.back'), inventory_files_path -%></li>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.listing', :model => t('activerecord.models.inventory_file')) -%></h1>
3
3
  <div id="content_list">
4
4
 
@@ -22,7 +22,7 @@
22
22
  <td><%= inventory_file.inventory_content_type -%> </td>
23
23
  <td><%= inventory_file.inventory_file_size -%> </td>
24
24
  <td><%= inventory_file.inventory_fingerprint -%> </td>
25
- <td><%= link_to inventory_file.user.username, inventory_file.user -%> </td>
25
+ <td><%= link_to inventory_file.user.username, inventory_file.user.profile if inventory_file.user.try(:profile) -%> </td>
26
26
  <td>
27
27
  <%= link_to t('page.edit'), edit_inventory_file_path(inventory_file) -%>
28
28
  <%= link_to t('page.destroy'), inventory_file, :data => {:confirm => t('page.are_you_sure')}, :method => :delete -%>
@@ -35,7 +35,7 @@
35
35
  </div>
36
36
  </div>
37
37
 
38
- <div id="submenu" class="ui-corner-all">
38
+ <div id="submenu" class="ui-corner-all ui-widget-content">
39
39
  <ul>
40
40
  <li><%= link_to t('page.new', :model => t('activerecord.models.inventory_file')), new_inventory_file_path -%></li>
41
41
  </ul>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.new', :model => t('activerecord.models.inventory_file')) -%> </h1>
3
3
  <div id="content_list">
4
4
 
@@ -18,7 +18,7 @@
18
18
  </div>
19
19
  </div>
20
20
 
21
- <div id="submenu" class="ui-corner-all">
21
+ <div id="submenu" class="ui-corner-all ui-widget-content">
22
22
  <ul>
23
23
  <li><%= link_to t('page.back'), inventory_files_path -%> </li>
24
24
  </ul>
@@ -1,4 +1,4 @@
1
- <div id="content_detail" class="ui-corner-all">
1
+ <div id="content_detail" class="ui-corner-all ui-widget-content">
2
2
  <h1 class="title"><%= t('page.showing', :model => t('activerecord.models.inventory_file')) -%></h1>
3
3
  <div id="content_list">
4
4
  <p id="notice"><%= notice %></p>
@@ -25,7 +25,7 @@
25
25
 
26
26
  <p>
27
27
  <strong><%= t('activerecord.models.user') -%> :</strong>
28
- <%= link_to @inventory_file.user.username, @inventory_file.user -%>
28
+ <%= link_to @inventory_file.user.username, @inventory_file.user.profile if @inventory_file.user.try(:profile) -%>
29
29
  </p>
30
30
 
31
31
  <p>
@@ -36,7 +36,7 @@
36
36
  </div>
37
37
  </div>
38
38
 
39
- <div id="submenu" class="ui-corner-all">
39
+ <div id="submenu" class="ui-corner-all ui-widget-content">
40
40
  <ul>
41
41
  <li><%= link_to t('page.edit'), edit_inventory_file_path(@inventory_file) -%> </li>
42
42
  <li><%= back_to_index(flash[:page_info]) -%> </li>
@@ -1,6 +1,5 @@
1
- require 'enju_seed'
1
+ require 'enju_library'
2
2
  require 'paperclip'
3
- require 'inherited_resources'
4
3
 
5
4
  module EnjuInventory
6
5
  class Engine < ::Rails::Engine
@@ -1,3 +1,3 @@
1
1
  module EnjuInventory
2
- VERSION = "0.1.11.pre9"
2
+ VERSION = "0.1.11.pre10"
3
3
  end
@@ -5,149 +5,152 @@ describe InventoriesController do
5
5
 
6
6
  describe "GET index" do
7
7
  describe "When logged in as Administrator" do
8
- login_admin
8
+ login_fixture_admin
9
9
 
10
10
  it "assigns all inventories as @inventories" do
11
11
  get :index
12
- assigns(:inventories).should eq(Inventory.page(1))
13
- response.should be_success
12
+ expect(assigns(:inventories)).to eq(Inventory.page(1))
13
+ expect(response).to be_success
14
14
  end
15
15
  end
16
16
 
17
17
  describe "When logged in as Librarian" do
18
- login_librarian
18
+ login_fixture_librarian
19
19
 
20
20
  it "assigns all inventories as @inventories" do
21
21
  get :index
22
- assigns(:inventories).should eq(Inventory.page(1))
23
- response.should be_success
22
+ expect(assigns(:inventories)).to eq(Inventory.page(1))
23
+ expect(response).to be_success
24
24
  end
25
25
  end
26
26
 
27
27
  describe "When logged in as User" do
28
- login_user
28
+ login_fixture_user
29
29
 
30
30
  it "assigns all empty as @inventories" do
31
31
  get :index
32
- assigns(:inventories).should be_empty
33
- response.should be_forbidden
32
+ expect(assigns(:inventories)).to be_empty
33
+ expect(response).to be_forbidden
34
34
  end
35
35
  end
36
36
 
37
37
  describe "When not logged in" do
38
38
  it "assigns all inventories as @inventories" do
39
39
  get :index
40
- assigns(:inventories).should be_empty
41
- response.should redirect_to(new_user_session_url)
40
+ expect(assigns(:inventories)).to be_empty
41
+ expect(response).to redirect_to(new_user_session_url)
42
42
  end
43
43
  end
44
44
  end
45
45
 
46
46
  describe "GET show" do
47
47
  describe "When logged in as Administrator" do
48
- login_admin
48
+ login_fixture_admin
49
49
 
50
50
  it "assigns the requested inventory as @inventory" do
51
51
  get :show, :id => 1
52
- assigns(:inventory).should eq(Inventory.find(1))
52
+ expect(assigns(:inventory)).to eq(Inventory.find(1))
53
+ expect(response).to be_success
53
54
  end
54
55
  end
55
56
 
56
57
  describe "When logged in as Librarian" do
57
- login_librarian
58
+ login_fixture_librarian
58
59
 
59
60
  it "assigns the requested inventory as @inventory" do
60
61
  get :show, :id => 1
61
- assigns(:inventory).should eq(Inventory.find(1))
62
+ expect(assigns(:inventory)).to eq(Inventory.find(1))
63
+ expect(response).to be_success
62
64
  end
63
65
  end
64
66
 
65
67
  describe "When logged in as User" do
66
- login_user
68
+ login_fixture_user
67
69
 
68
70
  it "assigns the requested inventory as @inventory" do
69
71
  get :show, :id => 1
70
- assigns(:inventory).should eq(Inventory.find(1))
72
+ expect(assigns(:inventory)).to eq(Inventory.find(1))
73
+ expect(response).to be_forbidden
71
74
  end
72
75
  end
73
76
 
74
77
  describe "When not logged in" do
75
78
  it "assigns the requested inventory as @inventory" do
76
79
  get :show, :id => 1
77
- assigns(:inventory).should eq(Inventory.find(1))
78
- response.should redirect_to(new_user_session_url)
80
+ expect(assigns(:inventory)).to eq(Inventory.find(1))
81
+ expect(response).to redirect_to(new_user_session_url)
79
82
  end
80
83
  end
81
84
  end
82
85
 
83
86
  describe "GET new" do
84
87
  describe "When logged in as Administrator" do
85
- login_admin
88
+ login_fixture_admin
86
89
 
87
90
  it "assigns the requested inventory as @inventory" do
88
91
  get :new
89
- assigns(:inventory).should_not be_valid
90
- response.should be_success
92
+ expect(assigns(:inventory)).not_to be_valid
93
+ expect(response).to be_success
91
94
  end
92
95
  end
93
96
 
94
97
  describe "When logged in as Librarian" do
95
- login_librarian
98
+ login_fixture_librarian
96
99
 
97
100
  it "should not assign the requested inventory as @inventory" do
98
101
  get :new
99
- assigns(:inventory).should_not be_valid
100
- response.should be_success
102
+ expect(assigns(:inventory)).not_to be_valid
103
+ expect(response).to be_success
101
104
  end
102
105
  end
103
106
 
104
107
  describe "When logged in as User" do
105
- login_user
108
+ login_fixture_user
106
109
 
107
110
  it "should not assign the requested inventory as @inventory" do
108
111
  get :new
109
- assigns(:inventory).should_not be_valid
110
- response.should be_forbidden
112
+ expect(assigns(:inventory)).not_to be_valid
113
+ expect(response).to be_forbidden
111
114
  end
112
115
  end
113
116
 
114
117
  describe "When not logged in" do
115
118
  it "should not assign the requested inventory as @inventory" do
116
119
  get :new
117
- assigns(:inventory).should_not be_valid
118
- response.should redirect_to(new_user_session_url)
120
+ expect(assigns(:inventory)).not_to be_valid
121
+ expect(response).to redirect_to(new_user_session_url)
119
122
  end
120
123
  end
121
124
  end
122
125
 
123
126
  describe "GET edit" do
124
127
  describe "When logged in as Administrator" do
125
- login_admin
128
+ login_fixture_admin
126
129
 
127
130
  it "assigns the requested inventory as @inventory" do
128
131
  inventory = inventories(:inventory_00001)
129
132
  get :edit, :id => inventory.id
130
- assigns(:inventory).should eq(inventory)
133
+ expect(assigns(:inventory)).to eq(inventory)
131
134
  end
132
135
  end
133
136
 
134
137
  describe "When logged in as Librarian" do
135
- login_librarian
138
+ login_fixture_librarian
136
139
 
137
140
  it "assigns the requested inventory as @inventory" do
138
141
  inventory = inventories(:inventory_00001)
139
142
  get :edit, :id => inventory.id
140
- assigns(:inventory).should eq(inventory)
143
+ expect(assigns(:inventory)).to eq(inventory)
141
144
  end
142
145
  end
143
146
 
144
147
  describe "When logged in as User" do
145
- login_user
148
+ login_fixture_user
146
149
 
147
150
  it "assigns the requested inventory as @inventory" do
148
151
  inventory = inventories(:inventory_00001)
149
152
  get :edit, :id => inventory.id
150
- response.should be_forbidden
153
+ expect(response).to be_forbidden
151
154
  end
152
155
  end
153
156
 
@@ -155,7 +158,7 @@ describe InventoriesController do
155
158
  it "should not assign the requested inventory as @inventory" do
156
159
  inventory = inventories(:inventory_00001)
157
160
  get :edit, :id => inventory.id
158
- response.should redirect_to(new_user_session_url)
161
+ expect(response).to redirect_to(new_user_session_url)
159
162
  end
160
163
  end
161
164
  end