enju_biblio 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/picture_files_controller.rb +1 -1
  3. data/app/models/item.rb +1 -1
  4. data/app/models/manifestation.rb +22 -2
  5. data/app/models/resource_import_file.rb +4 -4
  6. data/db/migrate/20171119051258_set_not_null_to_manifestation_id_on_items.rb +5 -0
  7. data/lib/enju_biblio/version.rb +1 -1
  8. data/spec/cassette_library/ImportRequest/import/should_import_bibliographic_record.yml +38 -655
  9. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/should_import_without_errors.yml +43 -191
  10. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_isbn_which_is_already_imported/redirects_to_the_created_import_request.yml +40 -592
  11. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/assigns_a_newly_created_import_request_as_import_request.yml +37 -589
  12. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/redirects_to_the_created_import_request.yml +41 -593
  13. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/assigns_a_newly_created_import_request_as_import_request.yml +39 -591
  14. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/redirects_to_the_created_import_request.yml +39 -591
  15. data/spec/cassette_library/ResourceImportFile/should_import_in_background.yml +40 -425
  16. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/ISBN_import/with_record_not_found/should_record_an_error_message.yml +39 -75
  17. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_has_only_isbn/should_be_imported.yml +39 -705
  18. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_shift_jis/should_be_imported.yml +39 -424
  19. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_be_imported.yml +37 -422
  20. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_be_searchable_right_after_the_import.yml +41 -426
  21. 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 +39 -424
  22. data/spec/controllers/agent_merge_lists_controller_spec.rb +9 -9
  23. data/spec/controllers/agent_merges_controller_spec.rb +13 -13
  24. data/spec/controllers/agent_relationship_types_controller_spec.rb +12 -12
  25. data/spec/controllers/agent_relationships_controller_spec.rb +12 -12
  26. data/spec/controllers/agent_types_controller_spec.rb +1 -1
  27. data/spec/controllers/agents_controller_spec.rb +6 -6
  28. data/spec/controllers/carrier_types_controller_spec.rb +1 -1
  29. data/spec/controllers/content_types_controller_spec.rb +3 -3
  30. data/spec/controllers/countries_controller_spec.rb +9 -9
  31. data/spec/controllers/create_types_controller_spec.rb +1 -1
  32. data/spec/controllers/creates_controller_spec.rb +11 -11
  33. data/spec/controllers/donates_controller_spec.rb +11 -11
  34. data/spec/controllers/form_of_works_controller_spec.rb +1 -1
  35. data/spec/controllers/frequencies_controller_spec.rb +3 -3
  36. data/spec/controllers/identifier_types_controller_spec.rb +1 -1
  37. data/spec/controllers/import_requests_controller_spec.rb +5 -5
  38. data/spec/controllers/items_controller_spec.rb +15 -15
  39. data/spec/controllers/languages_controller_spec.rb +6 -6
  40. data/spec/controllers/licenses_controller_spec.rb +1 -1
  41. data/spec/controllers/manifestation_relationship_types_controller_spec.rb +12 -12
  42. data/spec/controllers/manifestation_relationships_controller_spec.rb +12 -12
  43. data/spec/controllers/manifestations_controller_spec.rb +29 -29
  44. data/spec/controllers/medium_of_performances_controller_spec.rb +1 -1
  45. data/spec/controllers/owns_controller_spec.rb +12 -12
  46. data/spec/controllers/produce_types_controller_spec.rb +1 -1
  47. data/spec/controllers/produces_controller_spec.rb +10 -10
  48. data/spec/controllers/realize_types_controller_spec.rb +1 -1
  49. data/spec/controllers/realizes_controller_spec.rb +11 -11
  50. data/spec/controllers/series_statement_merge_lists_controller_spec.rb +12 -12
  51. data/spec/controllers/series_statement_merges_controller_spec.rb +12 -12
  52. data/spec/controllers/series_statements_controller_spec.rb +11 -11
  53. data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +5 -0
  54. data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +5 -0
  55. data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +5 -0
  56. data/spec/dummy/db/schema.rb +7 -3
  57. data/spec/factories/agent.rb +2 -2
  58. data/spec/factories/agent_merge.rb +3 -3
  59. data/spec/factories/agent_merge_list.rb +1 -1
  60. data/spec/factories/basket.rb +2 -2
  61. data/spec/factories/carrier_type.rb +1 -1
  62. data/spec/factories/checkout.rb +1 -1
  63. data/spec/factories/classification.rb +2 -2
  64. data/spec/factories/classification_type.rb +1 -1
  65. data/spec/factories/content_type.rb +1 -1
  66. data/spec/factories/country.rb +1 -1
  67. data/spec/factories/create.rb +3 -3
  68. data/spec/factories/create_types.rb +1 -1
  69. data/spec/factories/donate.rb +3 -3
  70. data/spec/factories/form_of_work.rb +1 -1
  71. data/spec/factories/frequency.rb +1 -1
  72. data/spec/factories/identifier.rb +2 -2
  73. data/spec/factories/identifier_type.rb +1 -1
  74. data/spec/factories/import_request.rb +1 -1
  75. data/spec/factories/item.rb +2 -2
  76. data/spec/factories/language.rb +1 -1
  77. data/spec/factories/library.rb +2 -2
  78. data/spec/factories/license.rb +1 -1
  79. data/spec/factories/manifestation.rb +2 -2
  80. data/spec/factories/manifestation_relationship.rb +3 -3
  81. data/spec/factories/manifestation_relationship_type.rb +1 -1
  82. data/spec/factories/medium_of_performance.rb +1 -1
  83. data/spec/factories/own.rb +3 -3
  84. data/spec/factories/patron_relationship.rb +3 -3
  85. data/spec/factories/patron_relationship_type.rb +1 -1
  86. data/spec/factories/patron_type.rb +1 -1
  87. data/spec/factories/produce.rb +3 -3
  88. data/spec/factories/produce_types.rb +1 -1
  89. data/spec/factories/profile.rb +2 -2
  90. data/spec/factories/realize.rb +3 -3
  91. data/spec/factories/realize_types.rb +1 -1
  92. data/spec/factories/reserve.rb +5 -5
  93. data/spec/factories/role.rb +1 -1
  94. data/spec/factories/series_has_manifestation.rb +3 -3
  95. data/spec/factories/series_statement.rb +2 -2
  96. data/spec/factories/series_statement_merge.rb +3 -3
  97. data/spec/factories/series_statement_merge_list.rb +1 -1
  98. data/spec/factories/series_statement_relationship.rb +3 -3
  99. data/spec/factories/shelf.rb +2 -2
  100. data/spec/factories/subject.rb +3 -3
  101. data/spec/factories/subject_heading_type.rb +1 -1
  102. data/spec/factories/subject_heading_type_has_subject.rb +3 -3
  103. data/spec/factories/subject_type.rb +1 -1
  104. data/spec/factories/user.rb +1 -1
  105. data/spec/fixtures/items.yml +1 -1
  106. data/spec/fixtures/library_groups.yml +1 -1
  107. data/spec/models/agent_spec.rb +4 -4
  108. data/spec/models/create_type_spec.rb +1 -1
  109. data/spec/models/item_spec.rb +1 -1
  110. data/spec/models/manifestation_spec.rb +30 -6
  111. data/spec/models/produce_type_spec.rb +1 -1
  112. data/spec/models/realize_type_spec.rb +1 -1
  113. data/spec/models/resource_export_file_spec.rb +7 -7
  114. data/spec/models/resource_import_file_spec.rb +19 -0
  115. data/spec/models/series_statement_spec.rb +1 -1
  116. data/spec/policies/manifestation_policy_spec.rb +5 -5
  117. data/spec/rails_helper.rb +3 -3
  118. data/spec/support/controller_macros.rb +3 -3
  119. data/spec/views/items/index.html.erb_spec.rb +2 -2
  120. data/spec/views/manifestations/index.html.erb_spec.rb +1 -1
  121. data/spec/views/manifestations/index.rdf.builder_spec.rb +1 -1
  122. data/spec/views/manifestations/index.txt.erb_spec.rb +2 -2
  123. data/spec/views/manifestations/show.html.erb_spec.rb +5 -5
  124. data/spec/views/manifestations/show.txt.erb_spec.rb +1 -1
  125. data/spec/views/series_statement_merges/show.html.erb_spec.rb +1 -1
  126. metadata +23 -16
@@ -26,7 +26,7 @@ describe FormOfWorksController do
26
26
  # FormOfWork. As you add validations to FormOfWork, be sure to
27
27
  # update the return value of this method accordingly.
28
28
  def valid_attributes
29
- FactoryGirl.attributes_for(:form_of_work)
29
+ FactoryBot.attributes_for(:form_of_work)
30
30
  end
31
31
 
32
32
  describe 'GET index' do
@@ -26,7 +26,7 @@ describe FrequenciesController do
26
26
  # Frequency. As you add validations to Frequency, be sure to
27
27
  # update the return value of this method accordingly.
28
28
  def valid_attributes
29
- FactoryGirl.attributes_for(:frequency)
29
+ FactoryBot.attributes_for(:frequency)
30
30
  end
31
31
 
32
32
  describe 'GET index' do
@@ -59,8 +59,8 @@ describe FrequenciesController do
59
59
  assigns(:frequency).should eq(frequency)
60
60
  end
61
61
  it 'assigns the frequency even if it associates manifestation(s)' do
62
- frequency = FactoryGirl.create(:frequency)
63
- manifestation = FactoryGirl.create(:manifestation, frequency_id: frequency.id)
62
+ frequency = FactoryBot.create(:frequency)
63
+ manifestation = FactoryBot.create(:manifestation, frequency_id: frequency.id)
64
64
  get :edit, id: frequency.id
65
65
  expect(assigns(:frequency)).to eq frequency
66
66
  expect(response).to be_success
@@ -26,7 +26,7 @@ describe IdentifierTypesController do
26
26
  # IdentifierType. As you add validations to IdentifierType, be sure to
27
27
  # update the return value of this method accordingly.
28
28
  def valid_attributes
29
- FactoryGirl.attributes_for(:identifier_type)
29
+ FactoryBot.attributes_for(:identifier_type)
30
30
  end
31
31
 
32
32
  describe 'GET index' do
@@ -124,7 +124,7 @@ describe ImportRequestsController do
124
124
  login_fixture_admin
125
125
 
126
126
  it 'assigns the requested import_request as @import_request' do
127
- import_request = FactoryGirl.create(:import_request, isbn: '9784797350999')
127
+ import_request = FactoryBot.create(:import_request, isbn: '9784797350999')
128
128
  get :edit, id: import_request.id
129
129
  expect(assigns(:import_request)).to eq(import_request)
130
130
  end
@@ -134,7 +134,7 @@ describe ImportRequestsController do
134
134
  login_fixture_librarian
135
135
 
136
136
  it 'assigns the requested import_request as @import_request' do
137
- import_request = FactoryGirl.create(:import_request, isbn: '9784797350999')
137
+ import_request = FactoryBot.create(:import_request, isbn: '9784797350999')
138
138
  get :edit, id: import_request.id
139
139
  expect(assigns(:import_request)).to eq(import_request)
140
140
  end
@@ -144,7 +144,7 @@ describe ImportRequestsController do
144
144
  login_fixture_user
145
145
 
146
146
  it 'assigns the requested import_request as @import_request' do
147
- import_request = FactoryGirl.create(:import_request, isbn: '9784797350999')
147
+ import_request = FactoryBot.create(:import_request, isbn: '9784797350999')
148
148
  get :edit, id: import_request.id
149
149
  expect(response).to be_forbidden
150
150
  end
@@ -152,7 +152,7 @@ describe ImportRequestsController do
152
152
 
153
153
  describe 'When not logged in' do
154
154
  it 'should not assign the requested import_request as @import_request' do
155
- import_request = FactoryGirl.create(:import_request, isbn: '9784797350999')
155
+ import_request = FactoryBot.create(:import_request, isbn: '9784797350999')
156
156
  get :edit, id: import_request.id
157
157
  expect(response).to redirect_to(new_user_session_url)
158
158
  end
@@ -192,7 +192,7 @@ describe ImportRequestsController do
192
192
  end
193
193
  end
194
194
 
195
- describe 'with isbn which is already imported' do
195
+ describe 'with isbn which is already imported', vcr: true do
196
196
  it 'assigns a newly created import_request as @import_request' do
197
197
  post :create, import_request: { isbn: manifestations(:manifestation_00001).identifier_contents(:isbn).first }
198
198
  expect(assigns(:import_request)).to be_valid
@@ -5,7 +5,7 @@ describe ItemsController do
5
5
  fixtures :all
6
6
 
7
7
  def valid_attributes
8
- FactoryGirl.attributes_for(:item)
8
+ FactoryBot.attributes_for(:item)
9
9
  end
10
10
 
11
11
  describe 'GET index', solr: true do
@@ -107,7 +107,7 @@ describe ItemsController do
107
107
 
108
108
  describe 'GET show' do
109
109
  before(:each) do
110
- @item = FactoryGirl.create(:item)
110
+ @item = FactoryBot.create(:item)
111
111
  end
112
112
 
113
113
  describe 'When logged in as Administrator' do
@@ -154,7 +154,7 @@ describe ItemsController do
154
154
 
155
155
  describe 'GET new' do
156
156
  before(:each) do
157
- @manifestation = FactoryGirl.create(:manifestation)
157
+ @manifestation = FactoryBot.create(:manifestation)
158
158
  end
159
159
 
160
160
  describe 'When logged in as Administrator' do
@@ -181,7 +181,7 @@ describe ItemsController do
181
181
  end
182
182
 
183
183
  it 'should not get new item for series_master' do
184
- manifestation_serial = FactoryGirl.create(:manifestation_serial)
184
+ manifestation_serial = FactoryBot.create(:manifestation_serial)
185
185
  get :new, manifestation_id: manifestation_serial.id
186
186
  expect(response).to redirect_to(manifestations_url(parent_id: manifestation_serial.id))
187
187
  end
@@ -221,7 +221,7 @@ describe ItemsController do
221
221
  login_fixture_admin
222
222
 
223
223
  it 'assigns the requested item as @item' do
224
- item = FactoryGirl.create(:item)
224
+ item = FactoryBot.create(:item)
225
225
  get :edit, id: item.id
226
226
  expect(assigns(:item)).to eq(item)
227
227
  end
@@ -238,7 +238,7 @@ describe ItemsController do
238
238
  login_fixture_librarian
239
239
 
240
240
  it 'assigns the requested item as @item' do
241
- item = FactoryGirl.create(:item)
241
+ item = FactoryBot.create(:item)
242
242
  get :edit, id: item.id
243
243
  expect(assigns(:item)).to eq(item)
244
244
  end
@@ -248,7 +248,7 @@ describe ItemsController do
248
248
  login_fixture_user
249
249
 
250
250
  it 'assigns the requested item as @item' do
251
- item = FactoryGirl.create(:item)
251
+ item = FactoryBot.create(:item)
252
252
  get :edit, id: item.id
253
253
  expect(response).to be_forbidden
254
254
  end
@@ -256,7 +256,7 @@ describe ItemsController do
256
256
 
257
257
  describe 'When not logged in' do
258
258
  it 'should not assign the requested item as @item' do
259
- item = FactoryGirl.create(:item)
259
+ item = FactoryBot.create(:item)
260
260
  get :edit, id: item.id
261
261
  expect(response).to redirect_to(new_user_session_url)
262
262
  end
@@ -265,8 +265,8 @@ describe ItemsController do
265
265
 
266
266
  describe 'POST create' do
267
267
  before(:each) do
268
- manifestation = FactoryGirl.create(:manifestation)
269
- @attrs = FactoryGirl.attributes_for(:item, manifestation_id: manifestation.id)
268
+ manifestation = FactoryBot.create(:manifestation)
269
+ @attrs = FactoryBot.attributes_for(:item, manifestation_id: manifestation.id)
270
270
  @invalid_attrs = { item_identifier: '無効なID', manifestation_id: manifestation.id }
271
271
  end
272
272
 
@@ -357,12 +357,12 @@ describe ItemsController do
357
357
  end
358
358
 
359
359
  it "should create another item with already retained" do
360
- reserve = FactoryGirl.create(:reserve)
360
+ reserve = FactoryBot.create(:reserve)
361
361
  reserve.transition_to!(:requested)
362
- post :create, :item => FactoryGirl.attributes_for(:item, manifestation_id: reserve.manifestation.id)
362
+ post :create, :item => FactoryBot.attributes_for(:item, manifestation_id: reserve.manifestation.id)
363
363
  expect(assigns(:item)).to be_valid
364
364
  expect(response).to redirect_to item_url(assigns(:item))
365
- post :create, :item => FactoryGirl.attributes_for(:item, manifestation_id: reserve.manifestation.id)
365
+ post :create, :item => FactoryBot.attributes_for(:item, manifestation_id: reserve.manifestation.id)
366
366
  expect(assigns(:item)).to be_valid
367
367
  expect(response).to redirect_to item_url(assigns(:item))
368
368
  end
@@ -425,8 +425,8 @@ describe ItemsController do
425
425
 
426
426
  describe 'PUT update' do
427
427
  before(:each) do
428
- @item = FactoryGirl.create(:item)
429
- @attrs = FactoryGirl.attributes_for(:item)
428
+ @item = FactoryBot.create(:item)
429
+ @attrs = FactoryBot.attributes_for(:item)
430
430
  @invalid_attrs = { item_identifier: '無効なID' }
431
431
  end
432
432
 
@@ -6,12 +6,12 @@ describe LanguagesController do
6
6
  fixtures :all
7
7
 
8
8
  def valid_attributes
9
- FactoryGirl.attributes_for(:language)
9
+ FactoryBot.attributes_for(:language)
10
10
  end
11
11
 
12
12
  describe 'GET index' do
13
13
  before(:each) do
14
- FactoryGirl.create(:language)
14
+ FactoryBot.create(:language)
15
15
  end
16
16
 
17
17
  describe 'When logged in as Administrator' do
@@ -51,7 +51,7 @@ describe LanguagesController do
51
51
 
52
52
  describe 'GET show' do
53
53
  before(:each) do
54
- @language = FactoryGirl.create(:language)
54
+ @language = FactoryBot.create(:language)
55
55
  end
56
56
 
57
57
  describe 'When logged in as Administrator' do
@@ -92,7 +92,7 @@ describe LanguagesController do
92
92
 
93
93
  describe 'GET edit' do
94
94
  before(:each) do
95
- @language = FactoryGirl.create(:language)
95
+ @language = FactoryBot.create(:language)
96
96
  end
97
97
 
98
98
  describe 'When logged in as Administrator' do
@@ -231,7 +231,7 @@ describe LanguagesController do
231
231
 
232
232
  describe 'PUT update' do
233
233
  before(:each) do
234
- @language = FactoryGirl.create(:language)
234
+ @language = FactoryBot.create(:language)
235
235
  @attrs = valid_attributes
236
236
  @invalid_attrs = { name: '' }
237
237
  end
@@ -286,7 +286,7 @@ describe LanguagesController do
286
286
 
287
287
  describe 'DELETE destroy' do
288
288
  before(:each) do
289
- @language = FactoryGirl.create(:language)
289
+ @language = FactoryBot.create(:language)
290
290
  end
291
291
 
292
292
  describe 'When logged in as Administrator' do
@@ -26,7 +26,7 @@ describe LicensesController do
26
26
  # License. As you add validations to License, be sure to
27
27
  # update the return value of this method accordingly.
28
28
  def valid_attributes
29
- FactoryGirl.attributes_for(:license)
29
+ FactoryBot.attributes_for(:license)
30
30
  end
31
31
 
32
32
  describe 'GET index' do
@@ -6,12 +6,12 @@ describe ManifestationRelationshipTypesController do
6
6
  disconnect_sunspot
7
7
 
8
8
  def valid_attributes
9
- FactoryGirl.attributes_for(:manifestation_relationship_type)
9
+ FactoryBot.attributes_for(:manifestation_relationship_type)
10
10
  end
11
11
 
12
12
  describe 'GET index' do
13
13
  before(:each) do
14
- FactoryGirl.create(:manifestation_relationship_type)
14
+ FactoryBot.create(:manifestation_relationship_type)
15
15
  end
16
16
 
17
17
  describe 'When logged in as Administrator' do
@@ -54,7 +54,7 @@ describe ManifestationRelationshipTypesController do
54
54
  login_fixture_admin
55
55
 
56
56
  it 'assigns the requested manifestation_relationship_type as @manifestation_relationship_type' do
57
- manifestation_relationship_type = FactoryGirl.create(:manifestation_relationship_type)
57
+ manifestation_relationship_type = FactoryBot.create(:manifestation_relationship_type)
58
58
  get :show, id: manifestation_relationship_type.id
59
59
  expect(assigns(:manifestation_relationship_type)).to eq(manifestation_relationship_type)
60
60
  end
@@ -64,7 +64,7 @@ describe ManifestationRelationshipTypesController do
64
64
  login_fixture_librarian
65
65
 
66
66
  it 'assigns the requested manifestation_relationship_type as @manifestation_relationship_type' do
67
- manifestation_relationship_type = FactoryGirl.create(:manifestation_relationship_type)
67
+ manifestation_relationship_type = FactoryBot.create(:manifestation_relationship_type)
68
68
  get :show, id: manifestation_relationship_type.id
69
69
  expect(assigns(:manifestation_relationship_type)).to eq(manifestation_relationship_type)
70
70
  end
@@ -74,7 +74,7 @@ describe ManifestationRelationshipTypesController do
74
74
  login_fixture_user
75
75
 
76
76
  it 'assigns the requested manifestation_relationship_type as @manifestation_relationship_type' do
77
- manifestation_relationship_type = FactoryGirl.create(:manifestation_relationship_type)
77
+ manifestation_relationship_type = FactoryBot.create(:manifestation_relationship_type)
78
78
  get :show, id: manifestation_relationship_type.id
79
79
  expect(assigns(:manifestation_relationship_type)).to eq(manifestation_relationship_type)
80
80
  end
@@ -82,7 +82,7 @@ describe ManifestationRelationshipTypesController do
82
82
 
83
83
  describe 'When not logged in' do
84
84
  it 'assigns the requested manifestation_relationship_type as @manifestation_relationship_type' do
85
- manifestation_relationship_type = FactoryGirl.create(:manifestation_relationship_type)
85
+ manifestation_relationship_type = FactoryBot.create(:manifestation_relationship_type)
86
86
  get :show, id: manifestation_relationship_type.id
87
87
  expect(assigns(:manifestation_relationship_type)).to eq(manifestation_relationship_type)
88
88
  end
@@ -134,7 +134,7 @@ describe ManifestationRelationshipTypesController do
134
134
  login_fixture_admin
135
135
 
136
136
  it 'assigns the requested manifestation_relationship_type as @manifestation_relationship_type' do
137
- manifestation_relationship_type = FactoryGirl.create(:manifestation_relationship_type)
137
+ manifestation_relationship_type = FactoryBot.create(:manifestation_relationship_type)
138
138
  get :edit, id: manifestation_relationship_type.id
139
139
  expect(assigns(:manifestation_relationship_type)).to eq(manifestation_relationship_type)
140
140
  end
@@ -144,7 +144,7 @@ describe ManifestationRelationshipTypesController do
144
144
  login_fixture_librarian
145
145
 
146
146
  it 'assigns the requested manifestation_relationship_type as @manifestation_relationship_type' do
147
- manifestation_relationship_type = FactoryGirl.create(:manifestation_relationship_type)
147
+ manifestation_relationship_type = FactoryBot.create(:manifestation_relationship_type)
148
148
  get :edit, id: manifestation_relationship_type.id
149
149
  expect(response).to be_forbidden
150
150
  end
@@ -154,7 +154,7 @@ describe ManifestationRelationshipTypesController do
154
154
  login_fixture_user
155
155
 
156
156
  it 'assigns the requested manifestation_relationship_type as @manifestation_relationship_type' do
157
- manifestation_relationship_type = FactoryGirl.create(:manifestation_relationship_type)
157
+ manifestation_relationship_type = FactoryBot.create(:manifestation_relationship_type)
158
158
  get :edit, id: manifestation_relationship_type.id
159
159
  expect(response).to be_forbidden
160
160
  end
@@ -162,7 +162,7 @@ describe ManifestationRelationshipTypesController do
162
162
 
163
163
  describe 'When not logged in' do
164
164
  it 'should not assign the requested manifestation_relationship_type as @manifestation_relationship_type' do
165
- manifestation_relationship_type = FactoryGirl.create(:manifestation_relationship_type)
165
+ manifestation_relationship_type = FactoryBot.create(:manifestation_relationship_type)
166
166
  get :edit, id: manifestation_relationship_type.id
167
167
  expect(response).to redirect_to(new_user_session_url)
168
168
  end
@@ -288,7 +288,7 @@ describe ManifestationRelationshipTypesController do
288
288
 
289
289
  describe 'PUT update' do
290
290
  before(:each) do
291
- @manifestation_relationship_type = FactoryGirl.create(:manifestation_relationship_type)
291
+ @manifestation_relationship_type = FactoryBot.create(:manifestation_relationship_type)
292
292
  @attrs = valid_attributes
293
293
  @invalid_attrs = { name: '' }
294
294
  end
@@ -389,7 +389,7 @@ describe ManifestationRelationshipTypesController do
389
389
 
390
390
  describe 'DELETE destroy' do
391
391
  before(:each) do
392
- @manifestation_relationship_type = FactoryGirl.create(:manifestation_relationship_type)
392
+ @manifestation_relationship_type = FactoryBot.create(:manifestation_relationship_type)
393
393
  end
394
394
 
395
395
  describe 'When logged in as Administrator' do
@@ -6,12 +6,12 @@ describe ManifestationRelationshipsController do
6
6
  disconnect_sunspot
7
7
 
8
8
  def valid_attributes
9
- @attrs = FactoryGirl.attributes_for(:manifestation_relationship)
9
+ @attrs = FactoryBot.attributes_for(:manifestation_relationship)
10
10
  end
11
11
 
12
12
  describe 'GET index' do
13
13
  before(:each) do
14
- FactoryGirl.create(:manifestation_relationship)
14
+ FactoryBot.create(:manifestation_relationship)
15
15
  end
16
16
 
17
17
  describe 'When logged in as Administrator' do
@@ -54,7 +54,7 @@ describe ManifestationRelationshipsController do
54
54
  login_fixture_admin
55
55
 
56
56
  it 'assigns the requested manifestation_relationship as @manifestation_relationship' do
57
- manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
57
+ manifestation_relationship = FactoryBot.create(:manifestation_relationship)
58
58
  get :show, id: manifestation_relationship.id
59
59
  expect(assigns(:manifestation_relationship)).to eq(manifestation_relationship)
60
60
  end
@@ -64,7 +64,7 @@ describe ManifestationRelationshipsController do
64
64
  login_fixture_librarian
65
65
 
66
66
  it 'assigns the requested manifestation_relationship as @manifestation_relationship' do
67
- manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
67
+ manifestation_relationship = FactoryBot.create(:manifestation_relationship)
68
68
  get :show, id: manifestation_relationship.id
69
69
  expect(assigns(:manifestation_relationship)).to eq(manifestation_relationship)
70
70
  end
@@ -74,7 +74,7 @@ describe ManifestationRelationshipsController do
74
74
  login_fixture_user
75
75
 
76
76
  it 'assigns the requested manifestation_relationship as @manifestation_relationship' do
77
- manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
77
+ manifestation_relationship = FactoryBot.create(:manifestation_relationship)
78
78
  get :show, id: manifestation_relationship.id
79
79
  expect(assigns(:manifestation_relationship)).to eq(manifestation_relationship)
80
80
  end
@@ -82,7 +82,7 @@ describe ManifestationRelationshipsController do
82
82
 
83
83
  describe 'When not logged in' do
84
84
  it 'assigns the requested manifestation_relationship as @manifestation_relationship' do
85
- manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
85
+ manifestation_relationship = FactoryBot.create(:manifestation_relationship)
86
86
  get :show, id: manifestation_relationship.id
87
87
  expect(assigns(:manifestation_relationship)).to eq(manifestation_relationship)
88
88
  end
@@ -134,7 +134,7 @@ describe ManifestationRelationshipsController do
134
134
  login_fixture_admin
135
135
 
136
136
  it 'assigns the requested manifestation_relationship as @manifestation_relationship' do
137
- manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
137
+ manifestation_relationship = FactoryBot.create(:manifestation_relationship)
138
138
  get :edit, id: manifestation_relationship.id
139
139
  expect(assigns(:manifestation_relationship)).to eq(manifestation_relationship)
140
140
  end
@@ -144,7 +144,7 @@ describe ManifestationRelationshipsController do
144
144
  login_fixture_librarian
145
145
 
146
146
  it 'assigns the requested manifestation_relationship as @manifestation_relationship' do
147
- manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
147
+ manifestation_relationship = FactoryBot.create(:manifestation_relationship)
148
148
  get :edit, id: manifestation_relationship.id
149
149
  expect(assigns(:manifestation_relationship)).to eq(manifestation_relationship)
150
150
  end
@@ -154,7 +154,7 @@ describe ManifestationRelationshipsController do
154
154
  login_fixture_user
155
155
 
156
156
  it 'assigns the requested manifestation_relationship as @manifestation_relationship' do
157
- manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
157
+ manifestation_relationship = FactoryBot.create(:manifestation_relationship)
158
158
  get :edit, id: manifestation_relationship.id
159
159
  expect(response).to be_forbidden
160
160
  end
@@ -162,7 +162,7 @@ describe ManifestationRelationshipsController do
162
162
 
163
163
  describe 'When not logged in' do
164
164
  it 'should not assign the requested manifestation_relationship as @manifestation_relationship' do
165
- manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
165
+ manifestation_relationship = FactoryBot.create(:manifestation_relationship)
166
166
  get :edit, id: manifestation_relationship.id
167
167
  expect(response).to redirect_to(new_user_session_url)
168
168
  end
@@ -288,7 +288,7 @@ describe ManifestationRelationshipsController do
288
288
 
289
289
  describe 'PUT update' do
290
290
  before(:each) do
291
- @manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
291
+ @manifestation_relationship = FactoryBot.create(:manifestation_relationship)
292
292
  @attrs = valid_attributes
293
293
  @invalid_attrs = { parent_id: '' }
294
294
  end
@@ -390,7 +390,7 @@ describe ManifestationRelationshipsController do
390
390
 
391
391
  describe 'DELETE destroy' do
392
392
  before(:each) do
393
- @manifestation_relationship = FactoryGirl.create(:manifestation_relationship)
393
+ @manifestation_relationship = FactoryBot.create(:manifestation_relationship)
394
394
  end
395
395
 
396
396
  describe 'When logged in as Administrator' do
@@ -4,7 +4,7 @@ describe ManifestationsController do
4
4
  fixtures :all
5
5
 
6
6
  def valid_attributes
7
- FactoryGirl.attributes_for(:manifestation)
7
+ FactoryBot.attributes_for(:manifestation)
8
8
  end
9
9
 
10
10
  describe 'GET index', solr: true do
@@ -187,9 +187,9 @@ describe ManifestationsController do
187
187
  end
188
188
 
189
189
  it "should show manifestation with shelf", solr: true do
190
- shelf = FactoryGirl.create(:shelf)
190
+ shelf = FactoryBot.create(:shelf)
191
191
  library = shelf.library
192
- item = FactoryGirl.create(:item, shelf: shelf)
192
+ item = FactoryBot.create(:item, shelf: shelf)
193
193
  get :index, :"#{library.name}_shelf" => [shelf.name]
194
194
  expect(response).to be_success
195
195
  expect(assigns(:manifestations).size).to eq 1
@@ -203,7 +203,7 @@ describe ManifestationsController do
203
203
  end
204
204
 
205
205
  it 'should show manifestation with NDC', solr: true do
206
- classification = FactoryGirl.create(:classification, category: '007.3', classification_type_id: 1)
206
+ classification = FactoryBot.create(:classification, category: '007.3', classification_type_id: 1)
207
207
  Manifestation.first.classifications << classification
208
208
  get :index, classification: '007', classification_type: 1
209
209
  expect(response).to be_success
@@ -217,8 +217,8 @@ describe ManifestationsController do
217
217
  end
218
218
 
219
219
  it 'should show manifestation with subject', solr: true do
220
- subject = FactoryGirl.create(:subject, term: 'test_subject')
221
- manifestation = FactoryGirl.create(:manifestation)
220
+ subject = FactoryBot.create(:subject, term: 'test_subject')
221
+ manifestation = FactoryBot.create(:manifestation)
222
222
  manifestation.subjects << subject
223
223
  get :index, subject_text: 'test_subject'
224
224
  expect(response).to be_success
@@ -252,8 +252,8 @@ describe ManifestationsController do
252
252
  end
253
253
 
254
254
  it "should get manifestations with series for its children's information" do
255
- periodical = FactoryGirl.create(:manifestation_serial)
256
- manifestation = FactoryGirl.create(:manifestation, description: "foo")
255
+ periodical = FactoryBot.create(:manifestation_serial)
256
+ manifestation = FactoryBot.create(:manifestation, description: "foo")
257
257
  periodical.derived_manifestations << manifestation
258
258
  periodical.save!
259
259
  get :index, query: "foo"
@@ -303,7 +303,7 @@ describe ManifestationsController do
303
303
  end
304
304
 
305
305
  it 'should not show manifestation with required_role of admin' do
306
- manifestation = FactoryGirl.create(:manifestation, required_role_id: 4)
306
+ manifestation = FactoryBot.create(:manifestation, required_role_id: 4)
307
307
  get :show, id: manifestation.id
308
308
  expect(response).not_to be_success
309
309
  end
@@ -421,7 +421,7 @@ describe ManifestationsController do
421
421
  end
422
422
 
423
423
  it 'should get new template with parent_id' do
424
- serial = FactoryGirl.create(:manifestation_serial,
424
+ serial = FactoryBot.create(:manifestation_serial,
425
425
  statement_of_responsibility: 'statement_of_responsibility1',
426
426
  title_alternative: 'title_alternative1',
427
427
  publication_place: 'publication_place1',
@@ -430,14 +430,14 @@ describe ManifestationsController do
430
430
  depth: 123,
431
431
  price: 'price1',
432
432
  access_address: 'http://example.jp',
433
- language_id: FactoryGirl.create(:language).id,
434
- frequency_id: FactoryGirl.create(:frequency).id,
435
- required_role_id: FactoryGirl.create(:role).id)
436
- serial.creators << FactoryGirl.create(:agent)
437
- serial.contributors << FactoryGirl.create(:agent)
438
- serial.publishers << FactoryGirl.create(:agent)
439
- serial.subjects << FactoryGirl.create(:subject)
440
- serial.classifications << FactoryGirl.create(:classification)
433
+ language_id: FactoryBot.create(:language).id,
434
+ frequency_id: FactoryBot.create(:frequency).id,
435
+ required_role_id: FactoryBot.create(:role).id)
436
+ serial.creators << FactoryBot.create(:agent)
437
+ serial.contributors << FactoryBot.create(:agent)
438
+ serial.publishers << FactoryBot.create(:agent)
439
+ serial.subjects << FactoryBot.create(:subject)
440
+ serial.classifications << FactoryBot.create(:classification)
441
441
  serial.save!
442
442
  get :new, parent_id: serial.id
443
443
  expect(response).to be_success
@@ -488,7 +488,7 @@ describe ManifestationsController do
488
488
  login_fixture_admin
489
489
 
490
490
  it 'assigns the requested manifestation as @manifestation' do
491
- manifestation = FactoryGirl.create(:manifestation)
491
+ manifestation = FactoryBot.create(:manifestation)
492
492
  get :edit, id: manifestation.id
493
493
  expect(assigns(:manifestation)).to eq(manifestation)
494
494
  end
@@ -498,15 +498,15 @@ describe ManifestationsController do
498
498
  login_fixture_librarian
499
499
 
500
500
  it 'assigns the requested manifestation as @manifestation' do
501
- manifestation = FactoryGirl.create(:manifestation)
501
+ manifestation = FactoryBot.create(:manifestation)
502
502
  get :edit, id: manifestation.id
503
503
  expect(assigns(:manifestation)).to eq(manifestation)
504
504
  end
505
505
 
506
506
  render_views
507
507
  it 'assigns the identifiers to @manifestation' do
508
- manifestation = FactoryGirl.create(:manifestation)
509
- identifier = FactoryGirl.create(:identifier)
508
+ manifestation = FactoryBot.create(:manifestation)
509
+ identifier = FactoryBot.create(:identifier)
510
510
  manifestation.identifiers << identifier
511
511
  get :edit, id: manifestation.id
512
512
  expect(assigns(:manifestation)).to eq manifestation
@@ -519,7 +519,7 @@ describe ManifestationsController do
519
519
  login_fixture_user
520
520
 
521
521
  it 'assigns the requested manifestation as @manifestation' do
522
- manifestation = FactoryGirl.create(:manifestation)
522
+ manifestation = FactoryBot.create(:manifestation)
523
523
  get :edit, id: manifestation.id
524
524
  expect(response).to be_forbidden
525
525
  end
@@ -532,7 +532,7 @@ describe ManifestationsController do
532
532
 
533
533
  describe 'When not logged in' do
534
534
  it 'should not assign the requested manifestation as @manifestation' do
535
- manifestation = FactoryGirl.create(:manifestation)
535
+ manifestation = FactoryBot.create(:manifestation)
536
536
  get :edit, id: manifestation.id
537
537
  expect(response).to redirect_to(new_user_session_url)
538
538
  end
@@ -669,7 +669,7 @@ describe ManifestationsController do
669
669
 
670
670
  describe 'PUT update' do
671
671
  before(:each) do
672
- @manifestation = FactoryGirl.create(:manifestation)
672
+ @manifestation = FactoryBot.create(:manifestation)
673
673
  @manifestation.series_statements = [SeriesStatement.find(1)]
674
674
  @attrs = valid_attributes
675
675
  @invalid_attrs = { original_title: '' }
@@ -719,7 +719,7 @@ describe ManifestationsController do
719
719
 
720
720
  it 'assigns identifiers to @manifestation' do
721
721
  identifiers_attrs = {
722
- identifier_attributes: [FactoryGirl.create(:identifier)]
722
+ identifier_attributes: [FactoryBot.create(:identifier)]
723
723
  }
724
724
  put :update, id: @manifestation.id, manifestation: @attrs.merge(identifiers_attrs)
725
725
  expect(assigns(:manifestation)).to eq @manifestation
@@ -785,7 +785,7 @@ describe ManifestationsController do
785
785
 
786
786
  describe 'DELETE destroy' do
787
787
  before(:each) do
788
- @manifestation = FactoryGirl.create(:manifestation)
788
+ @manifestation = FactoryBot.create(:manifestation)
789
789
  end
790
790
 
791
791
  describe 'When logged in as Administrator' do
@@ -811,8 +811,8 @@ describe ManifestationsController do
811
811
  end
812
812
 
813
813
  it 'should not destroy manifestation of series master with children' do
814
- @manifestation = FactoryGirl.create(:manifestation_serial)
815
- child = FactoryGirl.create(:manifestation)
814
+ @manifestation = FactoryBot.create(:manifestation_serial)
815
+ child = FactoryBot.create(:manifestation)
816
816
  @manifestation.derived_manifestations << child
817
817
  delete :destroy, id: @manifestation.id
818
818
  expect(response).to be_forbidden
@@ -26,7 +26,7 @@ describe MediumOfPerformancesController do
26
26
  # MediumOfPerformance. As you add validations to MediumOfPerformance, be sure to
27
27
  # update the return value of this method accordingly.
28
28
  def valid_attributes
29
- FactoryGirl.attributes_for(:medium_of_performance)
29
+ FactoryBot.attributes_for(:medium_of_performance)
30
30
  end
31
31
 
32
32
  describe 'GET index' do