enju_biblio 0.1.0.pre56 → 0.1.0.pre57

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/agent_import_files_controller.rb +1 -1
  3. data/app/controllers/agent_import_results_controller.rb +30 -6
  4. data/app/controllers/agent_relationship_types_controller.rb +74 -4
  5. data/app/controllers/agent_relationships_controller.rb +92 -10
  6. data/app/controllers/agent_types_controller.rb +74 -3
  7. data/app/controllers/carrier_types_controller.rb +1 -1
  8. data/app/controllers/content_types_controller.rb +74 -4
  9. data/app/controllers/countries_controller.rb +66 -4
  10. data/app/controllers/create_types_controller.rb +74 -3
  11. data/app/controllers/extents_controller.rb +74 -4
  12. data/app/controllers/form_of_works_controller.rb +74 -4
  13. data/app/controllers/frequencies_controller.rb +74 -4
  14. data/app/controllers/identifier_types_controller.rb +4 -5
  15. data/app/controllers/import_requests_controller.rb +1 -1
  16. data/app/controllers/languages_controller.rb +66 -4
  17. data/app/controllers/licenses_controller.rb +74 -3
  18. data/app/controllers/manifestation_relationship_types_controller.rb +74 -3
  19. data/app/controllers/manifestation_relationships_controller.rb +92 -9
  20. data/app/controllers/medium_of_performances_controller.rb +74 -3
  21. data/app/controllers/picture_files_controller.rb +34 -10
  22. data/app/controllers/produce_types_controller.rb +74 -3
  23. data/app/controllers/realize_types_controller.rb +74 -3
  24. data/app/controllers/resource_import_files_controller.rb +2 -1
  25. data/app/controllers/resource_import_results_controller.rb +31 -11
  26. data/app/models/agent_import_file.rb +1 -1
  27. data/app/models/agent_import_result.rb +0 -2
  28. data/app/models/carrier_type.rb +1 -1
  29. data/app/models/identifier.rb +5 -0
  30. data/app/models/item.rb +1 -1
  31. data/app/models/manifestation.rb +13 -8
  32. data/app/models/resource_import_file.rb +73 -79
  33. data/app/views/agent_import_files/index.html.erb +1 -0
  34. data/app/views/agent_relationship_types/index.html.erb +5 -4
  35. data/app/views/agent_types/index.html.erb +5 -4
  36. data/app/views/carrier_types/index.html.erb +2 -1
  37. data/app/views/content_types/index.html.erb +1 -0
  38. data/app/views/countries/show.html.erb +5 -0
  39. data/app/views/create_types/index.html.erb +5 -4
  40. data/app/views/extents/index.html.erb +2 -1
  41. data/app/views/form_of_works/index.html.erb +2 -1
  42. data/app/views/frequencies/index.html.erb +2 -1
  43. data/app/views/identifier_types/index.html.erb +12 -5
  44. data/app/views/import_requests/index.html.erb +1 -0
  45. data/app/views/items/show.html.erb +3 -7
  46. data/app/views/languages/_form.html.erb +19 -4
  47. data/app/views/languages/index.html.erb +6 -5
  48. data/app/views/languages/show.html.erb +19 -4
  49. data/app/views/layouts/manifestations.html.erb +2 -1
  50. data/app/views/licenses/index.html.erb +2 -1
  51. data/app/views/manifestation_relationship_types/index.html.erb +5 -4
  52. data/app/views/manifestations/_call_number.html.erb +1 -1
  53. data/app/views/manifestations/_edit_detail.html.erb +4 -1
  54. data/app/views/manifestations/_form.html.erb +5 -5
  55. data/app/views/manifestations/_show_detail_librarian.html.erb +8 -3
  56. data/app/views/manifestations/_show_detail_user.html.erb +8 -3
  57. data/app/views/medium_of_performances/index.html.erb +2 -1
  58. data/app/views/notifier/manifestation_info.en.text.erb +1 -1
  59. data/app/views/notifier/manifestation_info.ja.text.erb +1 -1
  60. data/app/views/picture_files/_index.html.erb +1 -0
  61. data/app/views/picture_files/_index_agent.html.erb +1 -0
  62. data/app/views/picture_files/_index_manifestation.html.erb +1 -0
  63. data/app/views/picture_files/show.html.erb +15 -7
  64. data/app/views/produce_types/index.html.erb +5 -4
  65. data/app/views/realize_types/index.html.erb +5 -4
  66. data/app/views/resource_import_files/index.html.erb +1 -0
  67. data/app/views/series_statements/_index.html.erb +1 -0
  68. data/app/views/series_statements/_index_series_statement_merge_list.html.erb +1 -0
  69. data/config/locales/translation_en.yml +70 -1
  70. data/config/locales/translation_ja.yml +77 -8
  71. data/db/migrate/20140817155043_add_extent_of_text_to_manifestation.rb +5 -0
  72. data/lib/enju_biblio/biblio_helper.rb +13 -0
  73. data/lib/enju_biblio/engine.rb +0 -2
  74. data/lib/enju_biblio/version.rb +1 -1
  75. data/lib/generators/enju_biblio/setup/templates/db/fixtures/content_types.yml +1 -1
  76. data/lib/generators/enju_biblio/setup/templates/db/fixtures/identifier_types.yml +24 -3
  77. data/lib/tasks/enju_biblio_tasks.rake +2 -0
  78. data/lib/tasks/identifier_type.rb +12 -0
  79. data/lib/tasks/item.rb +1 -1
  80. 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 +433 -0
  81. data/spec/controllers/agent_import_files_controller_spec.rb +35 -35
  82. data/spec/controllers/agent_import_results_controller_spec.rb +11 -11
  83. data/spec/controllers/agent_relationship_types_controller_spec.rb +51 -51
  84. data/spec/controllers/agent_relationships_controller_spec.rb +53 -53
  85. data/spec/controllers/agent_types_controller_spec.rb +15 -15
  86. data/spec/controllers/agents_controller_spec.rb +96 -96
  87. data/spec/controllers/carrier_types_controller_spec.rb +15 -15
  88. data/spec/controllers/content_types_controller_spec.rb +15 -15
  89. data/spec/controllers/countries_controller_spec.rb +25 -25
  90. data/spec/controllers/create_types_controller_spec.rb +15 -15
  91. data/spec/controllers/creates_controller_spec.rb +50 -50
  92. data/spec/controllers/donates_controller_spec.rb +49 -49
  93. data/spec/controllers/extents_controller_spec.rb +15 -15
  94. data/spec/controllers/form_of_works_controller_spec.rb +15 -15
  95. data/spec/controllers/frequencies_controller_spec.rb +6 -6
  96. data/spec/controllers/identifier_types_controller_spec.rb +15 -15
  97. data/spec/controllers/import_requests_controller_spec.rb +50 -50
  98. data/spec/controllers/items_controller_spec.rb +72 -72
  99. data/spec/controllers/languages_controller_spec.rb +18 -18
  100. data/spec/controllers/licenses_controller_spec.rb +15 -15
  101. data/spec/controllers/manifestation_relationship_types_controller_spec.rb +51 -51
  102. data/spec/controllers/manifestation_relationships_controller_spec.rb +53 -53
  103. data/spec/controllers/manifestations_controller_spec.rb +108 -108
  104. data/spec/controllers/medium_of_performances_controller_spec.rb +15 -15
  105. data/spec/controllers/owns_controller_spec.rb +52 -52
  106. data/spec/controllers/picture_files_controller_spec.rb +52 -52
  107. data/spec/controllers/produce_types_controller_spec.rb +15 -15
  108. data/spec/controllers/produces_controller_spec.rb +50 -50
  109. data/spec/controllers/realize_types_controller_spec.rb +15 -15
  110. data/spec/controllers/realizes_controller_spec.rb +51 -51
  111. data/spec/controllers/resource_export_files_controller_spec.rb +38 -38
  112. data/spec/controllers/resource_import_files_controller_spec.rb +38 -38
  113. data/spec/controllers/resource_import_results_controller_spec.rb +15 -15
  114. data/spec/controllers/series_statements_controller_spec.rb +54 -54
  115. data/spec/dummy/db/development.sqlite3 +0 -0
  116. data/spec/dummy/db/schema.rb +2 -3
  117. data/spec/dummy/db/test.sqlite3 +0 -0
  118. data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/resource_import_file_sample1.tsv +19 -19
  119. data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/resource_import_file_sample2.tsv +19 -19
  120. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-53863-1jz1wlr.txt +147 -0
  121. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-55246-1rvhs1s.txt +147 -0
  122. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-60268-1psjqua.txt +147 -0
  123. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-60996-1cy28m2.txt +147 -0
  124. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-67507-19qjhj3.txt +147 -0
  125. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-69234-1cllrec.txt +147 -0
  126. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-76875-1os6joy.txt +147 -0
  127. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-1148-136brhb.txt +147 -0
  128. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-473-1c326dm.txt +147 -0
  129. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-93795-1x882ik.txt +147 -0
  130. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-94274-1xr9d9e.txt +147 -0
  131. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-94643-1fjcept.txt +147 -0
  132. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-97947-mfqh5b.txt +147 -0
  133. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-98488-126cvb4.txt +147 -0
  134. data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-98849-1lg47mm.txt +147 -0
  135. data/spec/dummy/solr/test/data/index/segments.gen +0 -0
  136. data/spec/dummy/solr/test/data/index/segments_5ur +0 -0
  137. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007580 +0 -0
  138. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007581 +0 -0
  139. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007582 +0 -0
  140. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007583 +0 -0
  141. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007584 +0 -0
  142. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007585 +0 -0
  143. data/spec/dummy/tmp/cache/ACB/B20/manifestation_search_total +0 -0
  144. data/spec/dummy/tmp/cache/stdout +2554 -0
  145. data/spec/dummy/tmp/pids/redis-test.pid +1 -1
  146. data/spec/fixtures/agent_import_results.yml +0 -3
  147. data/spec/fixtures/carrier_types.yml +16 -16
  148. data/spec/fixtures/content_types.yml +78 -29
  149. data/spec/fixtures/frequencies.yml +32 -62
  150. data/spec/fixtures/manifestations.yml +1 -1
  151. data/spec/models/agent_import_result_spec.rb +0 -2
  152. data/spec/models/manifestation_spec.rb +1 -1
  153. data/spec/models/resource_import_file_spec.rb +30 -3
  154. data/spec/views/manifestations/show.html.erb_spec.rb +1 -1
  155. metadata +68 -103
  156. data/app/views/picture_files/_index_event.html.erb +0 -53
  157. data/app/views/picture_files/_index_shelf.html.erb +0 -53
  158. data/db/migrate/20121116033446_add_doi_to_manifestation.rb +0 -6
  159. data/spec/dummy/solr/test/data/index/_20i.fdt +0 -0
  160. data/spec/dummy/solr/test/data/index/_20i.fdx +0 -0
  161. data/spec/dummy/solr/test/data/index/_20i.fnm +0 -0
  162. data/spec/dummy/solr/test/data/index/_20i.nvd +0 -0
  163. data/spec/dummy/solr/test/data/index/_20i.nvm +0 -0
  164. data/spec/dummy/solr/test/data/index/_20i.si +0 -0
  165. data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.doc +0 -0
  166. data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.pos +0 -0
  167. data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.tim +0 -0
  168. data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.tip +0 -0
  169. data/spec/dummy/solr/test/data/index/_20j.fdt +0 -0
  170. data/spec/dummy/solr/test/data/index/_20j.fdx +0 -0
  171. data/spec/dummy/solr/test/data/index/_20j.fnm +0 -0
  172. data/spec/dummy/solr/test/data/index/_20j.nvd +0 -0
  173. data/spec/dummy/solr/test/data/index/_20j.nvm +0 -0
  174. data/spec/dummy/solr/test/data/index/_20j.si +0 -0
  175. data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.doc +0 -0
  176. data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.pos +0 -0
  177. data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.tim +0 -0
  178. data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.tip +0 -0
  179. data/spec/dummy/solr/test/data/index/_20k.fdt +0 -0
  180. data/spec/dummy/solr/test/data/index/_20k.fdx +0 -0
  181. data/spec/dummy/solr/test/data/index/_20k.fnm +0 -0
  182. data/spec/dummy/solr/test/data/index/_20k.nvd +0 -0
  183. data/spec/dummy/solr/test/data/index/_20k.nvm +0 -0
  184. data/spec/dummy/solr/test/data/index/_20k.si +0 -0
  185. data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.doc +0 -0
  186. data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.pos +0 -0
  187. data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.tim +0 -0
  188. data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.tip +0 -0
  189. data/spec/dummy/solr/test/data/index/segments_2uc +0 -0
  190. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000003680 +0 -0
  191. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000003681 +0 -0
  192. data/spec/dummy/solr/test/data/tlog/tlog.0000000000000003682 +0 -0
@@ -18,7 +18,7 @@ describe ItemsController do
18
18
 
19
19
  it "assigns all items as @items" do
20
20
  get :index
21
- assigns(:items).should_not be_nil
21
+ expect(assigns(:items)).to_not be_nil
22
22
  end
23
23
  end
24
24
 
@@ -27,14 +27,14 @@ describe ItemsController do
27
27
 
28
28
  it "assigns all items as @items" do
29
29
  get :index
30
- assigns(:items).should_not be_nil
30
+ expect(assigns(:items)).to_not be_nil
31
31
  end
32
32
 
33
33
  it "should not get index with inventory_file_id" do
34
34
  get :index, :inventory_file_id => 1
35
- response.should be_success
35
+ expect(response).to be_success
36
36
  assigns(:inventory_file).should eq InventoryFile.find(1)
37
- assigns(:items).should eq Item.inventory_items(assigns(:inventory_file), 'not_on_shelf').order('items.id').page(1)
37
+ expect(assigns(:items)).to eq Item.inventory_items(assigns(:inventory_file), 'not_on_shelf').order('items.id').page(1)
38
38
  end
39
39
  end
40
40
 
@@ -43,45 +43,45 @@ describe ItemsController do
43
43
 
44
44
  it "assigns all items as @items" do
45
45
  get :index
46
- assigns(:items).should_not be_nil
46
+ expect(assigns(:items)).to_not be_nil
47
47
  end
48
48
 
49
49
  it "should not get index with inventory_file_id" do
50
50
  get :index, :inventory_file_id => 1
51
- response.should be_forbidden
51
+ expect(response).to be_forbidden
52
52
  end
53
53
  end
54
54
 
55
55
  describe "When not logged in" do
56
56
  it "assigns all items as @items" do
57
57
  get :index
58
- assigns(:items).should_not be_nil
58
+ expect(assigns(:items)).to_not be_nil
59
59
  end
60
60
 
61
61
  it "should get index with agent_id" do
62
62
  get :index, :agent_id => 1
63
- response.should be_success
63
+ expect(response).to be_success
64
64
  assigns(:agent).should eq Agent.find(1)
65
- assigns(:items).should eq assigns(:agent).items.order('created_at DESC').page(1)
65
+ expect(assigns(:items)).to eq assigns(:agent).items.order('created_at DESC').page(1)
66
66
  end
67
67
 
68
68
  it "should get index with manifestation_id" do
69
69
  get :index, :manifestation_id => 1
70
- response.should be_success
70
+ expect(response).to be_success
71
71
  assigns(:manifestation).should eq Manifestation.find(1)
72
72
  assigns(:items).collect(&:id).should eq assigns(:manifestation).items.order('items.created_at DESC').page(1).collect(&:id)
73
73
  end
74
74
 
75
75
  it "should get index with shelf_id" do
76
76
  get :index, :shelf_id => 1
77
- response.should be_success
77
+ expect(response).to be_success
78
78
  assigns(:shelf).should eq Shelf.find(1)
79
- assigns(:items).should eq assigns(:shelf).items.order('created_at DESC').page(1)
79
+ expect(assigns(:items)).to eq assigns(:shelf).items.order('created_at DESC').page(1)
80
80
  end
81
81
 
82
82
  it "should not get index with inventory_file_id" do
83
83
  get :index, :inventory_file_id => 1
84
- response.should redirect_to new_user_session_url
84
+ expect(response).to redirect_to new_user_session_url
85
85
  assigns(:inventory_file).should_not be_nil
86
86
  end
87
87
  end
@@ -97,14 +97,14 @@ describe ItemsController do
97
97
 
98
98
  it "assigns the requested item as @item" do
99
99
  get :show, :id => @item.id
100
- assigns(:item).should eq(@item)
100
+ expect(assigns(:item)).to eq(@item)
101
101
  end
102
102
 
103
103
  it "should not show missing item" do
104
104
  lambda{
105
105
  get :show, :id => 'missing'
106
106
  }.should raise_error(ActiveRecord::RecordNotFound)
107
- #response.should be_missing
107
+ #expect(response).to be_missing
108
108
  end
109
109
  end
110
110
 
@@ -113,7 +113,7 @@ describe ItemsController do
113
113
 
114
114
  it "assigns the requested item as @item" do
115
115
  get :show, :id => @item.id
116
- assigns(:item).should eq(@item)
116
+ expect(assigns(:item)).to eq(@item)
117
117
  end
118
118
  end
119
119
 
@@ -122,14 +122,14 @@ describe ItemsController do
122
122
 
123
123
  it "assigns the requested item as @item" do
124
124
  get :show, :id => @item.id
125
- assigns(:item).should eq(@item)
125
+ expect(assigns(:item)).to eq(@item)
126
126
  end
127
127
  end
128
128
 
129
129
  describe "When not logged in" do
130
130
  it "assigns the requested item as @item" do
131
131
  get :show, :id => @item.id
132
- assigns(:item).should eq(@item)
132
+ expect(assigns(:item)).to eq(@item)
133
133
  end
134
134
  end
135
135
  end
@@ -144,13 +144,13 @@ describe ItemsController do
144
144
 
145
145
  it "assigns the requested item as @item" do
146
146
  get :new, :manifestation_id => @manifestation.id
147
- assigns(:item).should be_valid
148
- response.should be_success
147
+ expect(assigns(:item)).to be_valid
148
+ expect(response).to be_success
149
149
  end
150
150
 
151
151
  it "should not get new without manifestation_id" do
152
152
  get :new
153
- response.should redirect_to(manifestations_url)
153
+ expect(response).to redirect_to(manifestations_url)
154
154
  end
155
155
  end
156
156
 
@@ -159,8 +159,8 @@ describe ItemsController do
159
159
 
160
160
  it "assigns the requested item as @item" do
161
161
  get :new, :manifestation_id => @manifestation.id
162
- assigns(:item).should be_valid
163
- response.should be_success
162
+ expect(assigns(:item)).to be_valid
163
+ expect(response).to be_success
164
164
  end
165
165
  end
166
166
 
@@ -169,16 +169,16 @@ describe ItemsController do
169
169
 
170
170
  it "should not assign the requested item as @item" do
171
171
  get :new, :manifestation_id => @manifestation.id
172
- assigns(:item).should_not be_valid
173
- response.should be_forbidden
172
+ expect(assigns(:item)).to_not be_valid
173
+ expect(response).to be_forbidden
174
174
  end
175
175
  end
176
176
 
177
177
  describe "When not logged in" do
178
178
  it "should not assign the requested item as @item" do
179
179
  get :new, :manifestation_id => @manifestation.id
180
- assigns(:item).should_not be_valid
181
- response.should redirect_to(new_user_session_url)
180
+ expect(assigns(:item)).to_not be_valid
181
+ expect(response).to redirect_to(new_user_session_url)
182
182
  end
183
183
  end
184
184
  end
@@ -190,14 +190,14 @@ describe ItemsController do
190
190
  it "assigns the requested item as @item" do
191
191
  item = FactoryGirl.create(:item)
192
192
  get :edit, :id => item.id
193
- assigns(:item).should eq(item)
193
+ expect(assigns(:item)).to eq(item)
194
194
  end
195
195
 
196
196
  it "should not edit missing item" do
197
197
  lambda{
198
198
  get :edit, :id => 'missing'
199
199
  }.should raise_error(ActiveRecord::RecordNotFound)
200
- #response.should be_missing
200
+ #expect(response).to be_missing
201
201
  end
202
202
  end
203
203
 
@@ -207,7 +207,7 @@ describe ItemsController do
207
207
  it "assigns the requested item as @item" do
208
208
  item = FactoryGirl.create(:item)
209
209
  get :edit, :id => item.id
210
- assigns(:item).should eq(item)
210
+ expect(assigns(:item)).to eq(item)
211
211
  end
212
212
  end
213
213
 
@@ -217,7 +217,7 @@ describe ItemsController do
217
217
  it "assigns the requested item as @item" do
218
218
  item = FactoryGirl.create(:item)
219
219
  get :edit, :id => item.id
220
- response.should be_forbidden
220
+ expect(response).to be_forbidden
221
221
  end
222
222
  end
223
223
 
@@ -225,7 +225,7 @@ describe ItemsController do
225
225
  it "should not assign the requested item as @item" do
226
226
  item = FactoryGirl.create(:item)
227
227
  get :edit, :id => item.id
228
- response.should redirect_to(new_user_session_url)
228
+ expect(response).to redirect_to(new_user_session_url)
229
229
  end
230
230
  end
231
231
  end
@@ -243,13 +243,13 @@ describe ItemsController do
243
243
  describe "with valid params" do
244
244
  it "assigns a newly created item as @item" do
245
245
  post :create, :item => @attrs
246
- assigns(:item).should be_valid
246
+ expect(assigns(:item)).to be_valid
247
247
  end
248
248
 
249
249
  it "redirects to the created item" do
250
250
  post :create, :item => @attrs
251
251
  assigns(:item).manifestation.should_not be_nil
252
- response.should redirect_to(item_url(assigns(:item)))
252
+ expect(response).to redirect_to(item_url(assigns(:item)))
253
253
  end
254
254
 
255
255
  it "should create a lending policy" do
@@ -262,12 +262,12 @@ describe ItemsController do
262
262
  describe "with invalid params" do
263
263
  it "assigns a newly created but unsaved item as @item" do
264
264
  post :create, :item => @invalid_attrs
265
- assigns(:item).should_not be_valid
265
+ expect(assigns(:item)).to_not be_valid
266
266
  end
267
267
 
268
268
  it "re-renders the 'new' template" do
269
269
  post :create, :item => @invalid_attrs
270
- response.should render_template("new")
270
+ expect(response).to render_template("new")
271
271
  end
272
272
  end
273
273
 
@@ -275,14 +275,14 @@ describe ItemsController do
275
275
  lambda{
276
276
  post :create, :item => { :circulation_status_id => 1 }
277
277
  }.should raise_error(ActiveRecord::RecordNotFound)
278
- assigns(:item).should_not be_valid
279
- #response.should be_missing
278
+ expect(assigns(:item)).to_not be_valid
279
+ #expect(response).to be_missing
280
280
  end
281
281
 
282
282
  it "should not create item already created" do
283
283
  post :create, :item => { :circulation_status_id => 1, :item_identifier => "00001", :manifestation_id => 1}
284
- assigns(:item).should_not be_valid
285
- response.should be_success
284
+ expect(assigns(:item)).to_not be_valid
285
+ expect(response).to be_success
286
286
  end
287
287
  end
288
288
 
@@ -292,32 +292,32 @@ describe ItemsController do
292
292
  describe "with valid params" do
293
293
  it "assigns a newly created item as @item" do
294
294
  post :create, :item => @attrs
295
- assigns(:item).should be_valid
295
+ expect(assigns(:item)).to be_valid
296
296
  end
297
297
 
298
298
  it "redirects to the created item" do
299
299
  post :create, :item => @attrs
300
- response.should redirect_to(item_url(assigns(:item)))
300
+ expect(response).to redirect_to(item_url(assigns(:item)))
301
301
  end
302
302
  end
303
303
 
304
304
  describe "with invalid params" do
305
305
  it "assigns a newly created but unsaved item as @item" do
306
306
  post :create, :item => @invalid_attrs
307
- assigns(:item).should_not be_valid
307
+ expect(assigns(:item)).to_not be_valid
308
308
  end
309
309
 
310
310
  it "re-renders the 'new' template" do
311
311
  post :create, :item => @invalid_attrs
312
- response.should render_template("new")
312
+ expect(response).to render_template("new")
313
313
  end
314
314
  end
315
315
 
316
316
  it "should create reserved item" do
317
317
  post :create, :item => { :circulation_status_id => 1, :manifestation_id => 2}
318
- assigns(:item).should be_valid
318
+ expect(assigns(:item)).to be_valid
319
319
 
320
- response.should redirect_to item_url(assigns(:item))
320
+ expect(response).to redirect_to item_url(assigns(:item))
321
321
  flash[:message].should eq I18n.t('item.this_item_is_reserved')
322
322
  assigns(:item).manifestation.should eq Manifestation.find(2)
323
323
  assigns(:item).manifestation.next_reservation.current_state.should eq 'retained'
@@ -330,24 +330,24 @@ describe ItemsController do
330
330
  describe "with valid params" do
331
331
  it "assigns a newly created item as @item" do
332
332
  post :create, :item => @attrs
333
- assigns(:item).should be_valid
333
+ expect(assigns(:item)).to be_valid
334
334
  end
335
335
 
336
336
  it "should be forbidden" do
337
337
  post :create, :item => @attrs
338
- response.should be_forbidden
338
+ expect(response).to be_forbidden
339
339
  end
340
340
  end
341
341
 
342
342
  describe "with invalid params" do
343
343
  it "assigns a newly created but unsaved item as @item" do
344
344
  post :create, :item => @invalid_attrs
345
- assigns(:item).should_not be_valid
345
+ expect(assigns(:item)).to_not be_valid
346
346
  end
347
347
 
348
348
  it "should be forbidden" do
349
349
  post :create, :item => @invalid_attrs
350
- response.should be_forbidden
350
+ expect(response).to be_forbidden
351
351
  end
352
352
  end
353
353
  end
@@ -356,24 +356,24 @@ describe ItemsController do
356
356
  describe "with valid params" do
357
357
  it "assigns a newly created item as @item" do
358
358
  post :create, :item => @attrs
359
- assigns(:item).should be_valid
359
+ expect(assigns(:item)).to be_valid
360
360
  end
361
361
 
362
362
  it "should be forbidden" do
363
363
  post :create, :item => @attrs
364
- response.should redirect_to(new_user_session_url)
364
+ expect(response).to redirect_to(new_user_session_url)
365
365
  end
366
366
  end
367
367
 
368
368
  describe "with invalid params" do
369
369
  it "assigns a newly created but unsaved item as @item" do
370
370
  post :create, :item => @invalid_attrs
371
- assigns(:item).should_not be_valid
371
+ expect(assigns(:item)).to_not be_valid
372
372
  end
373
373
 
374
374
  it "should be forbidden" do
375
375
  post :create, :item => @invalid_attrs
376
- response.should redirect_to(new_user_session_url)
376
+ expect(response).to redirect_to(new_user_session_url)
377
377
  end
378
378
  end
379
379
  end
@@ -396,7 +396,7 @@ describe ItemsController do
396
396
 
397
397
  it "assigns the requested item as @item" do
398
398
  put :update, :id => @item.id, :item => @attrs
399
- assigns(:item).should eq(@item)
399
+ expect(assigns(:item)).to eq(@item)
400
400
  end
401
401
  end
402
402
 
@@ -407,7 +407,7 @@ describe ItemsController do
407
407
 
408
408
  it "re-renders the 'edit' template" do
409
409
  put :update, :id => @item, :item => @invalid_attrs
410
- response.should render_template("edit")
410
+ expect(response).to render_template("edit")
411
411
  end
412
412
  end
413
413
  end
@@ -422,20 +422,20 @@ describe ItemsController do
422
422
 
423
423
  it "assigns the requested item as @item" do
424
424
  put :update, :id => @item.id, :item => @attrs
425
- assigns(:item).should eq(@item)
426
- response.should redirect_to(@item)
425
+ expect(assigns(:item)).to eq(@item)
426
+ expect(response).to redirect_to(@item)
427
427
  end
428
428
  end
429
429
 
430
430
  describe "with invalid params" do
431
431
  it "assigns the item as @item" do
432
432
  put :update, :id => @item, :item => @invalid_attrs
433
- assigns(:item).should_not be_valid
433
+ expect(assigns(:item)).to_not be_valid
434
434
  end
435
435
 
436
436
  it "re-renders the 'edit' template" do
437
437
  put :update, :id => @item, :item => @invalid_attrs
438
- response.should render_template("edit")
438
+ expect(response).to render_template("edit")
439
439
  end
440
440
  end
441
441
  end
@@ -450,15 +450,15 @@ describe ItemsController do
450
450
 
451
451
  it "assigns the requested item as @item" do
452
452
  put :update, :id => @item.id, :item => @attrs
453
- assigns(:item).should eq(@item)
454
- response.should be_forbidden
453
+ expect(assigns(:item)).to eq(@item)
454
+ expect(response).to be_forbidden
455
455
  end
456
456
  end
457
457
 
458
458
  describe "with invalid params" do
459
459
  it "assigns the requested item as @item" do
460
460
  put :update, :id => @item.id, :item => @invalid_attrs
461
- response.should be_forbidden
461
+ expect(response).to be_forbidden
462
462
  end
463
463
  end
464
464
  end
@@ -471,14 +471,14 @@ describe ItemsController do
471
471
 
472
472
  it "should be forbidden" do
473
473
  put :update, :id => @item.id, :item => @attrs
474
- response.should redirect_to(new_user_session_url)
474
+ expect(response).to redirect_to(new_user_session_url)
475
475
  end
476
476
  end
477
477
 
478
478
  describe "with invalid params" do
479
479
  it "assigns the requested item as @item" do
480
480
  put :update, :id => @item.id, :item => @invalid_attrs
481
- response.should redirect_to(new_user_session_url)
481
+ expect(response).to redirect_to(new_user_session_url)
482
482
  end
483
483
  end
484
484
  end
@@ -499,24 +499,24 @@ describe ItemsController do
499
499
  it "redirects to the items list" do
500
500
  manifestation = @item.manifestation
501
501
  delete :destroy, :id => @item.id
502
- response.should redirect_to(items_url(manifestation_id: manifestation.id))
502
+ expect(response).to redirect_to(items_url(manifestation_id: manifestation.id))
503
503
  end
504
504
 
505
505
  it "should not destroy missing item" do
506
506
  lambda{
507
507
  delete :destroy, :id => 'missing'
508
508
  }.should raise_error(ActiveRecord::RecordNotFound)
509
- #response.should be_missing
509
+ #expect(response).to be_missing
510
510
  end
511
511
 
512
512
  it "should not destroy item if not checked in" do
513
513
  delete :destroy, :id => 1
514
- response.should be_forbidden
514
+ expect(response).to be_forbidden
515
515
  end
516
516
 
517
517
  it "should not destroy a removed item" do
518
518
  delete :destroy, :id => 23
519
- response.should be_forbidden
519
+ expect(response).to be_forbidden
520
520
  end
521
521
  end
522
522
 
@@ -530,7 +530,7 @@ describe ItemsController do
530
530
  it "redirects to the items list" do
531
531
  manifestation = @item.manifestation
532
532
  delete :destroy, :id => @item.id
533
- response.should redirect_to(items_url(manifestation_id: manifestation.id))
533
+ expect(response).to redirect_to(items_url(manifestation_id: manifestation.id))
534
534
  end
535
535
  end
536
536
 
@@ -543,7 +543,7 @@ describe ItemsController do
543
543
 
544
544
  it "should be forbidden" do
545
545
  delete :destroy, :id => @item.id
546
- response.should be_forbidden
546
+ expect(response).to be_forbidden
547
547
  end
548
548
  end
549
549
 
@@ -554,7 +554,7 @@ describe ItemsController do
554
554
 
555
555
  it "should be forbidden" do
556
556
  delete :destroy, :id => @item.id
557
- response.should redirect_to(new_user_session_url)
557
+ expect(response).to redirect_to(new_user_session_url)
558
558
  end
559
559
  end
560
560
  end
@@ -19,7 +19,7 @@ describe LanguagesController do
19
19
 
20
20
  it "assigns all languages as @languages" do
21
21
  get :index
22
- assigns(:languages).should eq(Language.page(1))
22
+ expect(assigns(:languages)).to eq(Language.page(1))
23
23
  end
24
24
  end
25
25
 
@@ -28,7 +28,7 @@ describe LanguagesController do
28
28
 
29
29
  it "assigns all languages as @languages" do
30
30
  get :index
31
- assigns(:languages).should eq(Language.page(1))
31
+ expect(assigns(:languages)).to eq(Language.page(1))
32
32
  end
33
33
  end
34
34
 
@@ -37,14 +37,14 @@ describe LanguagesController do
37
37
 
38
38
  it "assigns all languages as @languages" do
39
39
  get :index
40
- assigns(:languages).should eq(Language.page(1))
40
+ expect(assigns(:languages)).to eq(Language.page(1))
41
41
  end
42
42
  end
43
43
 
44
44
  describe "When not logged in" do
45
45
  it "assigns all languages as @languages" do
46
46
  get :index
47
- assigns(:languages).should eq(Language.page(1))
47
+ expect(assigns(:languages)).to eq(Language.page(1))
48
48
  end
49
49
  end
50
50
  end
@@ -59,14 +59,14 @@ describe LanguagesController do
59
59
 
60
60
  it "assigns the requested language as @language" do
61
61
  get :show, :id => @language.id
62
- assigns(:language).should eq(@language)
62
+ expect(assigns(:language)).to eq(@language)
63
63
  end
64
64
  end
65
65
 
66
66
  describe "When not logged in" do
67
67
  it "assigns the requested language as @language" do
68
68
  get :show, :id => @language.id
69
- assigns(:language).should eq(@language)
69
+ expect(assigns(:language)).to eq(@language)
70
70
  end
71
71
  end
72
72
  end
@@ -77,14 +77,14 @@ describe LanguagesController do
77
77
 
78
78
  it "assigns the requested language as @language" do
79
79
  get :new
80
- assigns(:language).should_not be_valid
80
+ expect(assigns(:language)).to_not be_valid
81
81
  end
82
82
  end
83
83
 
84
84
  describe "When not logged in" do
85
85
  it "should not assign the requested language as @language" do
86
86
  get :new
87
- assigns(:language).should_not be_valid
87
+ expect(assigns(:language)).to_not be_valid
88
88
  response.should redirect_to(new_user_session_url)
89
89
  end
90
90
  end
@@ -100,7 +100,7 @@ describe LanguagesController do
100
100
 
101
101
  it "assigns the requested language as @language" do
102
102
  get :edit, :id => @language.id
103
- assigns(:language).should eq(@language)
103
+ expect(assigns(:language)).to eq(@language)
104
104
  end
105
105
  end
106
106
 
@@ -124,7 +124,7 @@ describe LanguagesController do
124
124
  describe "with valid params" do
125
125
  it "assigns a newly created language as @language" do
126
126
  post :create, :language => @attrs
127
- assigns(:language).should be_valid
127
+ expect(assigns(:language)).to be_valid
128
128
  end
129
129
 
130
130
  it "redirects to the created language" do
@@ -136,7 +136,7 @@ describe LanguagesController do
136
136
  describe "with invalid params" do
137
137
  it "assigns a newly created but unsaved language as @language" do
138
138
  post :create, :language => @invalid_attrs
139
- assigns(:language).should_not be_valid
139
+ expect(assigns(:language)).to_not be_valid
140
140
  end
141
141
 
142
142
  it "re-renders the 'new' template" do
@@ -152,7 +152,7 @@ describe LanguagesController do
152
152
  describe "with valid params" do
153
153
  it "assigns a newly created language as @language" do
154
154
  post :create, :language => @attrs
155
- assigns(:language).should be_valid
155
+ expect(assigns(:language)).to be_valid
156
156
  end
157
157
 
158
158
  it "should be forbidden" do
@@ -164,7 +164,7 @@ describe LanguagesController do
164
164
  describe "with invalid params" do
165
165
  it "assigns a newly created but unsaved language as @language" do
166
166
  post :create, :language => @invalid_attrs
167
- assigns(:language).should_not be_valid
167
+ expect(assigns(:language)).to_not be_valid
168
168
  end
169
169
 
170
170
  it "should be forbidden" do
@@ -180,7 +180,7 @@ describe LanguagesController do
180
180
  describe "with valid params" do
181
181
  it "assigns a newly created language as @language" do
182
182
  post :create, :language => @attrs
183
- assigns(:language).should be_valid
183
+ expect(assigns(:language)).to be_valid
184
184
  end
185
185
 
186
186
  it "should be forbidden" do
@@ -192,7 +192,7 @@ describe LanguagesController do
192
192
  describe "with invalid params" do
193
193
  it "assigns a newly created but unsaved language as @language" do
194
194
  post :create, :language => @invalid_attrs
195
- assigns(:language).should_not be_valid
195
+ expect(assigns(:language)).to_not be_valid
196
196
  end
197
197
 
198
198
  it "should be forbidden" do
@@ -206,7 +206,7 @@ describe LanguagesController do
206
206
  describe "with valid params" do
207
207
  it "assigns a newly created language as @language" do
208
208
  post :create, :language => @attrs
209
- assigns(:language).should be_valid
209
+ expect(assigns(:language)).to be_valid
210
210
  end
211
211
 
212
212
  it "should be forbidden" do
@@ -218,7 +218,7 @@ describe LanguagesController do
218
218
  describe "with invalid params" do
219
219
  it "assigns a newly created but unsaved language as @language" do
220
220
  post :create, :language => @invalid_attrs
221
- assigns(:language).should_not be_valid
221
+ expect(assigns(:language)).to_not be_valid
222
222
  end
223
223
 
224
224
  it "should be forbidden" do
@@ -246,7 +246,7 @@ describe LanguagesController do
246
246
 
247
247
  it "assigns the requested language as @language" do
248
248
  put :update, :id => @language.id, :language => @attrs
249
- assigns(:language).should eq(@language)
249
+ expect(assigns(:language)).to eq(@language)
250
250
  end
251
251
 
252
252
  it "moves its position when specified" do