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.
- checksums.yaml +4 -4
- data/app/controllers/picture_files_controller.rb +1 -1
- data/app/models/item.rb +1 -1
- data/app/models/manifestation.rb +22 -2
- data/app/models/resource_import_file.rb +4 -4
- data/db/migrate/20171119051258_set_not_null_to_manifestation_id_on_items.rb +5 -0
- data/lib/enju_biblio/version.rb +1 -1
- data/spec/cassette_library/ImportRequest/import/should_import_bibliographic_record.yml +38 -655
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/should_import_without_errors.yml +43 -191
- 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
- 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
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_valid_params/redirects_to_the_created_import_request.yml +41 -593
- 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
- data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Librarian/with_valid_params/redirects_to_the_created_import_request.yml +39 -591
- data/spec/cassette_library/ResourceImportFile/should_import_in_background.yml +40 -425
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/ISBN_import/with_record_not_found/should_record_an_error_message.yml +39 -75
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_has_only_isbn/should_be_imported.yml +39 -705
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_shift_jis/should_be_imported.yml +39 -424
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_be_imported.yml +37 -422
- 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
- 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
- data/spec/controllers/agent_merge_lists_controller_spec.rb +9 -9
- data/spec/controllers/agent_merges_controller_spec.rb +13 -13
- data/spec/controllers/agent_relationship_types_controller_spec.rb +12 -12
- data/spec/controllers/agent_relationships_controller_spec.rb +12 -12
- data/spec/controllers/agent_types_controller_spec.rb +1 -1
- data/spec/controllers/agents_controller_spec.rb +6 -6
- data/spec/controllers/carrier_types_controller_spec.rb +1 -1
- data/spec/controllers/content_types_controller_spec.rb +3 -3
- data/spec/controllers/countries_controller_spec.rb +9 -9
- data/spec/controllers/create_types_controller_spec.rb +1 -1
- data/spec/controllers/creates_controller_spec.rb +11 -11
- data/spec/controllers/donates_controller_spec.rb +11 -11
- data/spec/controllers/form_of_works_controller_spec.rb +1 -1
- data/spec/controllers/frequencies_controller_spec.rb +3 -3
- data/spec/controllers/identifier_types_controller_spec.rb +1 -1
- data/spec/controllers/import_requests_controller_spec.rb +5 -5
- data/spec/controllers/items_controller_spec.rb +15 -15
- data/spec/controllers/languages_controller_spec.rb +6 -6
- data/spec/controllers/licenses_controller_spec.rb +1 -1
- data/spec/controllers/manifestation_relationship_types_controller_spec.rb +12 -12
- data/spec/controllers/manifestation_relationships_controller_spec.rb +12 -12
- data/spec/controllers/manifestations_controller_spec.rb +29 -29
- data/spec/controllers/medium_of_performances_controller_spec.rb +1 -1
- data/spec/controllers/owns_controller_spec.rb +12 -12
- data/spec/controllers/produce_types_controller_spec.rb +1 -1
- data/spec/controllers/produces_controller_spec.rb +10 -10
- data/spec/controllers/realize_types_controller_spec.rb +1 -1
- data/spec/controllers/realizes_controller_spec.rb +11 -11
- data/spec/controllers/series_statement_merge_lists_controller_spec.rb +12 -12
- data/spec/controllers/series_statement_merges_controller_spec.rb +12 -12
- data/spec/controllers/series_statements_controller_spec.rb +11 -11
- data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +5 -0
- data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +5 -0
- data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +5 -0
- data/spec/dummy/db/schema.rb +7 -3
- data/spec/factories/agent.rb +2 -2
- data/spec/factories/agent_merge.rb +3 -3
- data/spec/factories/agent_merge_list.rb +1 -1
- data/spec/factories/basket.rb +2 -2
- data/spec/factories/carrier_type.rb +1 -1
- data/spec/factories/checkout.rb +1 -1
- data/spec/factories/classification.rb +2 -2
- data/spec/factories/classification_type.rb +1 -1
- data/spec/factories/content_type.rb +1 -1
- data/spec/factories/country.rb +1 -1
- data/spec/factories/create.rb +3 -3
- data/spec/factories/create_types.rb +1 -1
- data/spec/factories/donate.rb +3 -3
- data/spec/factories/form_of_work.rb +1 -1
- data/spec/factories/frequency.rb +1 -1
- data/spec/factories/identifier.rb +2 -2
- data/spec/factories/identifier_type.rb +1 -1
- data/spec/factories/import_request.rb +1 -1
- data/spec/factories/item.rb +2 -2
- data/spec/factories/language.rb +1 -1
- data/spec/factories/library.rb +2 -2
- data/spec/factories/license.rb +1 -1
- data/spec/factories/manifestation.rb +2 -2
- data/spec/factories/manifestation_relationship.rb +3 -3
- data/spec/factories/manifestation_relationship_type.rb +1 -1
- data/spec/factories/medium_of_performance.rb +1 -1
- data/spec/factories/own.rb +3 -3
- data/spec/factories/patron_relationship.rb +3 -3
- data/spec/factories/patron_relationship_type.rb +1 -1
- data/spec/factories/patron_type.rb +1 -1
- data/spec/factories/produce.rb +3 -3
- data/spec/factories/produce_types.rb +1 -1
- data/spec/factories/profile.rb +2 -2
- data/spec/factories/realize.rb +3 -3
- data/spec/factories/realize_types.rb +1 -1
- data/spec/factories/reserve.rb +5 -5
- data/spec/factories/role.rb +1 -1
- data/spec/factories/series_has_manifestation.rb +3 -3
- data/spec/factories/series_statement.rb +2 -2
- data/spec/factories/series_statement_merge.rb +3 -3
- data/spec/factories/series_statement_merge_list.rb +1 -1
- data/spec/factories/series_statement_relationship.rb +3 -3
- data/spec/factories/shelf.rb +2 -2
- data/spec/factories/subject.rb +3 -3
- data/spec/factories/subject_heading_type.rb +1 -1
- data/spec/factories/subject_heading_type_has_subject.rb +3 -3
- data/spec/factories/subject_type.rb +1 -1
- data/spec/factories/user.rb +1 -1
- data/spec/fixtures/items.yml +1 -1
- data/spec/fixtures/library_groups.yml +1 -1
- data/spec/models/agent_spec.rb +4 -4
- data/spec/models/create_type_spec.rb +1 -1
- data/spec/models/item_spec.rb +1 -1
- data/spec/models/manifestation_spec.rb +30 -6
- data/spec/models/produce_type_spec.rb +1 -1
- data/spec/models/realize_type_spec.rb +1 -1
- data/spec/models/resource_export_file_spec.rb +7 -7
- data/spec/models/resource_import_file_spec.rb +19 -0
- data/spec/models/series_statement_spec.rb +1 -1
- data/spec/policies/manifestation_policy_spec.rb +5 -5
- data/spec/rails_helper.rb +3 -3
- data/spec/support/controller_macros.rb +3 -3
- data/spec/views/items/index.html.erb_spec.rb +2 -2
- data/spec/views/manifestations/index.html.erb_spec.rb +1 -1
- data/spec/views/manifestations/index.rdf.builder_spec.rb +1 -1
- data/spec/views/manifestations/index.txt.erb_spec.rb +2 -2
- data/spec/views/manifestations/show.html.erb_spec.rb +5 -5
- data/spec/views/manifestations/show.txt.erb_spec.rb +1 -1
- data/spec/views/series_statement_merges/show.html.erb_spec.rb +1 -1
- metadata +23 -16
@@ -5,7 +5,7 @@ describe AgentMergesController do
|
|
5
5
|
|
6
6
|
describe 'GET index' do
|
7
7
|
before(:each) do
|
8
|
-
|
8
|
+
FactoryBot.create(:agent_merge)
|
9
9
|
end
|
10
10
|
|
11
11
|
describe 'When logged in as Administrator' do
|
@@ -50,7 +50,7 @@ describe AgentMergesController do
|
|
50
50
|
login_admin
|
51
51
|
|
52
52
|
it 'assigns the requested agent_merge as @agent_merge' do
|
53
|
-
agent_merge =
|
53
|
+
agent_merge = FactoryBot.create(:agent_merge)
|
54
54
|
get :show, id: agent_merge.id
|
55
55
|
assigns(:agent_merge).should eq(agent_merge)
|
56
56
|
end
|
@@ -60,7 +60,7 @@ describe AgentMergesController do
|
|
60
60
|
login_librarian
|
61
61
|
|
62
62
|
it 'assigns the requested agent_merge as @agent_merge' do
|
63
|
-
agent_merge =
|
63
|
+
agent_merge = FactoryBot.create(:agent_merge)
|
64
64
|
get :show, id: agent_merge.id
|
65
65
|
assigns(:agent_merge).should eq(agent_merge)
|
66
66
|
end
|
@@ -70,7 +70,7 @@ describe AgentMergesController do
|
|
70
70
|
login_user
|
71
71
|
|
72
72
|
it 'assigns the requested agent_merge as @agent_merge' do
|
73
|
-
agent_merge =
|
73
|
+
agent_merge = FactoryBot.create(:agent_merge)
|
74
74
|
get :show, id: agent_merge.id
|
75
75
|
assigns(:agent_merge).should eq(agent_merge)
|
76
76
|
end
|
@@ -78,7 +78,7 @@ describe AgentMergesController do
|
|
78
78
|
|
79
79
|
describe 'When not logged in' do
|
80
80
|
it 'assigns the requested agent_merge as @agent_merge' do
|
81
|
-
agent_merge =
|
81
|
+
agent_merge = FactoryBot.create(:agent_merge)
|
82
82
|
get :show, id: agent_merge.id
|
83
83
|
assigns(:agent_merge).should eq(agent_merge)
|
84
84
|
end
|
@@ -130,7 +130,7 @@ describe AgentMergesController do
|
|
130
130
|
login_admin
|
131
131
|
|
132
132
|
it 'assigns the requested agent_merge as @agent_merge' do
|
133
|
-
agent_merge =
|
133
|
+
agent_merge = FactoryBot.create(:agent_merge)
|
134
134
|
get :edit, id: agent_merge.id
|
135
135
|
assigns(:agent_merge).should eq(agent_merge)
|
136
136
|
end
|
@@ -140,7 +140,7 @@ describe AgentMergesController do
|
|
140
140
|
login_librarian
|
141
141
|
|
142
142
|
it 'assigns the requested agent_merge as @agent_merge' do
|
143
|
-
agent_merge =
|
143
|
+
agent_merge = FactoryBot.create(:agent_merge)
|
144
144
|
get :edit, id: agent_merge.id
|
145
145
|
assigns(:agent_merge).should eq(agent_merge)
|
146
146
|
end
|
@@ -150,7 +150,7 @@ describe AgentMergesController do
|
|
150
150
|
login_user
|
151
151
|
|
152
152
|
it 'assigns the requested agent_merge as @agent_merge' do
|
153
|
-
agent_merge =
|
153
|
+
agent_merge = FactoryBot.create(:agent_merge)
|
154
154
|
get :edit, id: agent_merge.id
|
155
155
|
response.should be_forbidden
|
156
156
|
end
|
@@ -158,7 +158,7 @@ describe AgentMergesController do
|
|
158
158
|
|
159
159
|
describe 'When not logged in' do
|
160
160
|
it 'should not assign the requested agent_merge as @agent_merge' do
|
161
|
-
agent_merge =
|
161
|
+
agent_merge = FactoryBot.create(:agent_merge)
|
162
162
|
get :edit, id: agent_merge.id
|
163
163
|
response.should redirect_to(new_user_session_url)
|
164
164
|
end
|
@@ -167,7 +167,7 @@ describe AgentMergesController do
|
|
167
167
|
|
168
168
|
describe 'POST create' do
|
169
169
|
before(:each) do
|
170
|
-
@attrs =
|
170
|
+
@attrs = FactoryBot.attributes_for(:agent_merge)
|
171
171
|
@invalid_attrs = { agent_id: 'invalid', agent_merge_list_id: 'invalid' }
|
172
172
|
end
|
173
173
|
|
@@ -284,8 +284,8 @@ describe AgentMergesController do
|
|
284
284
|
|
285
285
|
describe 'PUT update' do
|
286
286
|
before(:each) do
|
287
|
-
@agent_merge =
|
288
|
-
@attrs =
|
287
|
+
@agent_merge = FactoryBot.create(:agent_merge)
|
288
|
+
@attrs = FactoryBot.attributes_for(:agent_merge)
|
289
289
|
@invalid_attrs = { agent_merge_list_id: '' }
|
290
290
|
end
|
291
291
|
|
@@ -381,7 +381,7 @@ describe AgentMergesController do
|
|
381
381
|
|
382
382
|
describe 'DELETE destroy' do
|
383
383
|
before(:each) do
|
384
|
-
@agent_merge =
|
384
|
+
@agent_merge = FactoryBot.create(:agent_merge)
|
385
385
|
end
|
386
386
|
|
387
387
|
describe 'When logged in as Administrator' do
|
@@ -6,12 +6,12 @@ describe AgentRelationshipTypesController do
|
|
6
6
|
disconnect_sunspot
|
7
7
|
|
8
8
|
def valid_attributes
|
9
|
-
|
9
|
+
FactoryBot.attributes_for(:agent_relationship_type)
|
10
10
|
end
|
11
11
|
|
12
12
|
describe 'GET index' do
|
13
13
|
before(:each) do
|
14
|
-
|
14
|
+
FactoryBot.create(:agent_relationship_type)
|
15
15
|
end
|
16
16
|
|
17
17
|
describe 'When logged in as Administrator' do
|
@@ -54,7 +54,7 @@ describe AgentRelationshipTypesController do
|
|
54
54
|
login_fixture_admin
|
55
55
|
|
56
56
|
it 'assigns the requested agent_relationship_type as @agent_relationship_type' do
|
57
|
-
agent_relationship_type =
|
57
|
+
agent_relationship_type = FactoryBot.create(:agent_relationship_type)
|
58
58
|
get :show, id: agent_relationship_type.id
|
59
59
|
expect(assigns(:agent_relationship_type)).to eq(agent_relationship_type)
|
60
60
|
end
|
@@ -64,7 +64,7 @@ describe AgentRelationshipTypesController do
|
|
64
64
|
login_fixture_librarian
|
65
65
|
|
66
66
|
it 'assigns the requested agent_relationship_type as @agent_relationship_type' do
|
67
|
-
agent_relationship_type =
|
67
|
+
agent_relationship_type = FactoryBot.create(:agent_relationship_type)
|
68
68
|
get :show, id: agent_relationship_type.id
|
69
69
|
expect(assigns(:agent_relationship_type)).to eq(agent_relationship_type)
|
70
70
|
end
|
@@ -74,7 +74,7 @@ describe AgentRelationshipTypesController do
|
|
74
74
|
login_fixture_user
|
75
75
|
|
76
76
|
it 'assigns the requested agent_relationship_type as @agent_relationship_type' do
|
77
|
-
agent_relationship_type =
|
77
|
+
agent_relationship_type = FactoryBot.create(:agent_relationship_type)
|
78
78
|
get :show, id: agent_relationship_type.id
|
79
79
|
expect(assigns(:agent_relationship_type)).to eq(agent_relationship_type)
|
80
80
|
end
|
@@ -82,7 +82,7 @@ describe AgentRelationshipTypesController do
|
|
82
82
|
|
83
83
|
describe 'When not logged in' do
|
84
84
|
it 'assigns the requested agent_relationship_type as @agent_relationship_type' do
|
85
|
-
agent_relationship_type =
|
85
|
+
agent_relationship_type = FactoryBot.create(:agent_relationship_type)
|
86
86
|
get :show, id: agent_relationship_type.id
|
87
87
|
expect(assigns(:agent_relationship_type)).to eq(agent_relationship_type)
|
88
88
|
end
|
@@ -134,7 +134,7 @@ describe AgentRelationshipTypesController do
|
|
134
134
|
login_fixture_admin
|
135
135
|
|
136
136
|
it 'assigns the requested agent_relationship_type as @agent_relationship_type' do
|
137
|
-
agent_relationship_type =
|
137
|
+
agent_relationship_type = FactoryBot.create(:agent_relationship_type)
|
138
138
|
get :edit, id: agent_relationship_type.id
|
139
139
|
expect(assigns(:agent_relationship_type)).to eq(agent_relationship_type)
|
140
140
|
end
|
@@ -144,7 +144,7 @@ describe AgentRelationshipTypesController do
|
|
144
144
|
login_fixture_librarian
|
145
145
|
|
146
146
|
it 'assigns the requested agent_relationship_type as @agent_relationship_type' do
|
147
|
-
agent_relationship_type =
|
147
|
+
agent_relationship_type = FactoryBot.create(:agent_relationship_type)
|
148
148
|
get :edit, id: agent_relationship_type.id
|
149
149
|
expect(response).to be_forbidden
|
150
150
|
end
|
@@ -154,7 +154,7 @@ describe AgentRelationshipTypesController do
|
|
154
154
|
login_fixture_user
|
155
155
|
|
156
156
|
it 'assigns the requested agent_relationship_type as @agent_relationship_type' do
|
157
|
-
agent_relationship_type =
|
157
|
+
agent_relationship_type = FactoryBot.create(:agent_relationship_type)
|
158
158
|
get :edit, id: agent_relationship_type.id
|
159
159
|
expect(response).to be_forbidden
|
160
160
|
end
|
@@ -162,7 +162,7 @@ describe AgentRelationshipTypesController do
|
|
162
162
|
|
163
163
|
describe 'When not logged in' do
|
164
164
|
it 'should not assign the requested agent_relationship_type as @agent_relationship_type' do
|
165
|
-
agent_relationship_type =
|
165
|
+
agent_relationship_type = FactoryBot.create(:agent_relationship_type)
|
166
166
|
get :edit, id: agent_relationship_type.id
|
167
167
|
expect(response).to redirect_to(new_user_session_url)
|
168
168
|
end
|
@@ -288,7 +288,7 @@ describe AgentRelationshipTypesController do
|
|
288
288
|
|
289
289
|
describe 'PUT update' do
|
290
290
|
before(:each) do
|
291
|
-
@agent_relationship_type =
|
291
|
+
@agent_relationship_type = FactoryBot.create(:agent_relationship_type)
|
292
292
|
@attrs = valid_attributes
|
293
293
|
@invalid_attrs = { name: '' }
|
294
294
|
end
|
@@ -389,7 +389,7 @@ describe AgentRelationshipTypesController do
|
|
389
389
|
|
390
390
|
describe 'DELETE destroy' do
|
391
391
|
before(:each) do
|
392
|
-
@agent_relationship_type =
|
392
|
+
@agent_relationship_type = FactoryBot.create(:agent_relationship_type)
|
393
393
|
end
|
394
394
|
|
395
395
|
describe 'When logged in as Administrator' do
|
@@ -6,12 +6,12 @@ describe AgentRelationshipsController do
|
|
6
6
|
disconnect_sunspot
|
7
7
|
|
8
8
|
def valid_attributes
|
9
|
-
@attrs =
|
9
|
+
@attrs = FactoryBot.attributes_for(:agent_relationship)
|
10
10
|
end
|
11
11
|
|
12
12
|
describe 'GET index' do
|
13
13
|
before(:each) do
|
14
|
-
|
14
|
+
FactoryBot.create(:agent_relationship)
|
15
15
|
end
|
16
16
|
|
17
17
|
describe 'When logged in as Administrator' do
|
@@ -54,7 +54,7 @@ describe AgentRelationshipsController do
|
|
54
54
|
login_fixture_admin
|
55
55
|
|
56
56
|
it 'assigns the requested agent_relationship as @agent_relationship' do
|
57
|
-
agent_relationship =
|
57
|
+
agent_relationship = FactoryBot.create(:agent_relationship)
|
58
58
|
get :show, id: agent_relationship.id
|
59
59
|
expect(assigns(:agent_relationship)).to eq(agent_relationship)
|
60
60
|
end
|
@@ -64,7 +64,7 @@ describe AgentRelationshipsController do
|
|
64
64
|
login_fixture_librarian
|
65
65
|
|
66
66
|
it 'assigns the requested agent_relationship as @agent_relationship' do
|
67
|
-
agent_relationship =
|
67
|
+
agent_relationship = FactoryBot.create(:agent_relationship)
|
68
68
|
get :show, id: agent_relationship.id
|
69
69
|
expect(assigns(:agent_relationship)).to eq(agent_relationship)
|
70
70
|
end
|
@@ -74,7 +74,7 @@ describe AgentRelationshipsController do
|
|
74
74
|
login_fixture_user
|
75
75
|
|
76
76
|
it 'assigns the requested agent_relationship as @agent_relationship' do
|
77
|
-
agent_relationship =
|
77
|
+
agent_relationship = FactoryBot.create(:agent_relationship)
|
78
78
|
get :show, id: agent_relationship.id
|
79
79
|
expect(assigns(:agent_relationship)).to eq(agent_relationship)
|
80
80
|
end
|
@@ -82,7 +82,7 @@ describe AgentRelationshipsController do
|
|
82
82
|
|
83
83
|
describe 'When not logged in' do
|
84
84
|
it 'assigns the requested agent_relationship as @agent_relationship' do
|
85
|
-
agent_relationship =
|
85
|
+
agent_relationship = FactoryBot.create(:agent_relationship)
|
86
86
|
get :show, id: agent_relationship.id
|
87
87
|
expect(assigns(:agent_relationship)).to eq(agent_relationship)
|
88
88
|
end
|
@@ -134,7 +134,7 @@ describe AgentRelationshipsController do
|
|
134
134
|
login_fixture_admin
|
135
135
|
|
136
136
|
it 'assigns the requested agent_relationship as @agent_relationship' do
|
137
|
-
agent_relationship =
|
137
|
+
agent_relationship = FactoryBot.create(:agent_relationship)
|
138
138
|
get :edit, id: agent_relationship.id
|
139
139
|
expect(assigns(:agent_relationship)).to eq(agent_relationship)
|
140
140
|
end
|
@@ -144,7 +144,7 @@ describe AgentRelationshipsController do
|
|
144
144
|
login_fixture_librarian
|
145
145
|
|
146
146
|
it 'assigns the requested agent_relationship as @agent_relationship' do
|
147
|
-
agent_relationship =
|
147
|
+
agent_relationship = FactoryBot.create(:agent_relationship)
|
148
148
|
get :edit, id: agent_relationship.id
|
149
149
|
expect(assigns(:agent_relationship)).to eq(agent_relationship)
|
150
150
|
end
|
@@ -154,7 +154,7 @@ describe AgentRelationshipsController do
|
|
154
154
|
login_fixture_user
|
155
155
|
|
156
156
|
it 'assigns the requested agent_relationship as @agent_relationship' do
|
157
|
-
agent_relationship =
|
157
|
+
agent_relationship = FactoryBot.create(:agent_relationship)
|
158
158
|
get :edit, id: agent_relationship.id
|
159
159
|
expect(response).to be_forbidden
|
160
160
|
end
|
@@ -162,7 +162,7 @@ describe AgentRelationshipsController do
|
|
162
162
|
|
163
163
|
describe 'When not logged in' do
|
164
164
|
it 'should not assign the requested agent_relationship as @agent_relationship' do
|
165
|
-
agent_relationship =
|
165
|
+
agent_relationship = FactoryBot.create(:agent_relationship)
|
166
166
|
get :edit, id: agent_relationship.id
|
167
167
|
expect(response).to redirect_to(new_user_session_url)
|
168
168
|
end
|
@@ -288,7 +288,7 @@ describe AgentRelationshipsController do
|
|
288
288
|
|
289
289
|
describe 'PUT update' do
|
290
290
|
before(:each) do
|
291
|
-
@agent_relationship =
|
291
|
+
@agent_relationship = FactoryBot.create(:agent_relationship)
|
292
292
|
@attrs = valid_attributes
|
293
293
|
@invalid_attrs = { parent_id: '' }
|
294
294
|
end
|
@@ -390,7 +390,7 @@ describe AgentRelationshipsController do
|
|
390
390
|
|
391
391
|
describe 'DELETE destroy' do
|
392
392
|
before(:each) do
|
393
|
-
@agent_relationship =
|
393
|
+
@agent_relationship = FactoryBot.create(:agent_relationship)
|
394
394
|
end
|
395
395
|
|
396
396
|
describe 'When logged in as Administrator' do
|
@@ -26,7 +26,7 @@ describe AgentTypesController do
|
|
26
26
|
# AgentType. As you add validations to AgentType, be sure to
|
27
27
|
# update the return value of this method accordingly.
|
28
28
|
def valid_attributes
|
29
|
-
|
29
|
+
FactoryBot.attributes_for(:agent_type)
|
30
30
|
end
|
31
31
|
|
32
32
|
describe 'GET index' do
|
@@ -4,7 +4,7 @@ describe AgentsController do
|
|
4
4
|
fixtures :all
|
5
5
|
|
6
6
|
def valid_attributes
|
7
|
-
|
7
|
+
FactoryBot.attributes_for(:agent)
|
8
8
|
end
|
9
9
|
|
10
10
|
describe 'GET index', solr: true do
|
@@ -91,7 +91,7 @@ describe AgentsController do
|
|
91
91
|
|
92
92
|
describe 'GET show' do
|
93
93
|
before(:each) do
|
94
|
-
@agent =
|
94
|
+
@agent = FactoryBot.create(:agent)
|
95
95
|
end
|
96
96
|
|
97
97
|
describe 'When logged in as Administrator' do
|
@@ -294,7 +294,7 @@ describe AgentsController do
|
|
294
294
|
describe 'POST create' do
|
295
295
|
before(:each) do
|
296
296
|
@attrs = valid_attributes
|
297
|
-
@invalid_attrs =
|
297
|
+
@invalid_attrs = FactoryBot.attributes_for(:agent, full_name: '')
|
298
298
|
end
|
299
299
|
|
300
300
|
describe 'When logged in as Administrator' do
|
@@ -445,9 +445,9 @@ describe AgentsController do
|
|
445
445
|
|
446
446
|
describe 'PUT update' do
|
447
447
|
before(:each) do
|
448
|
-
@agent =
|
448
|
+
@agent = FactoryBot.create(:agent)
|
449
449
|
@attrs = valid_attributes
|
450
|
-
@invalid_attrs =
|
450
|
+
@invalid_attrs = FactoryBot.attributes_for(:agent, full_name: '')
|
451
451
|
end
|
452
452
|
|
453
453
|
describe 'When logged in as Administrator' do
|
@@ -568,7 +568,7 @@ describe AgentsController do
|
|
568
568
|
|
569
569
|
describe 'DELETE destroy' do
|
570
570
|
before(:each) do
|
571
|
-
@agent =
|
571
|
+
@agent = FactoryBot.create(:agent)
|
572
572
|
end
|
573
573
|
|
574
574
|
describe 'When logged in as Administrator' do
|
@@ -25,7 +25,7 @@ describe CarrierTypesController do
|
|
25
25
|
# CarrierType. As you add validations to CarrierType, be sure to
|
26
26
|
# update the return value of this method accordingly.
|
27
27
|
def valid_attributes
|
28
|
-
|
28
|
+
FactoryBot.attributes_for(:carrier_type)
|
29
29
|
end
|
30
30
|
|
31
31
|
context 'When logged in as Administrator' do
|
@@ -26,7 +26,7 @@ describe ContentTypesController do
|
|
26
26
|
# ContentType. As you add validations to ContentType, be sure to
|
27
27
|
# update the return value of this method accordingly.
|
28
28
|
def valid_attributes
|
29
|
-
|
29
|
+
FactoryBot.attributes_for(:content_type)
|
30
30
|
end
|
31
31
|
|
32
32
|
describe 'GET index' do
|
@@ -59,8 +59,8 @@ describe ContentTypesController do
|
|
59
59
|
expect(assigns(:content_type)).to eq(content_type)
|
60
60
|
end
|
61
61
|
it 'assigns the content_type even if it associates manifestation(s)' do
|
62
|
-
content_type =
|
63
|
-
manifestation =
|
62
|
+
content_type = FactoryBot.create(:content_type)
|
63
|
+
manifestation = FactoryBot.create(:manifestation, content_type_id: content_type.id)
|
64
64
|
get :edit, id: content_type.id
|
65
65
|
expect(assigns(:content_type)).to eq content_type
|
66
66
|
expect(response).to be_success
|
@@ -6,12 +6,12 @@ describe CountriesController do
|
|
6
6
|
disconnect_sunspot
|
7
7
|
|
8
8
|
def valid_attributes
|
9
|
-
|
9
|
+
FactoryBot.attributes_for(:country)
|
10
10
|
end
|
11
11
|
|
12
12
|
describe 'GET index' do
|
13
13
|
before(:each) do
|
14
|
-
|
14
|
+
FactoryBot.create(:country)
|
15
15
|
end
|
16
16
|
|
17
17
|
describe 'When logged in as Administrator' do
|
@@ -51,7 +51,7 @@ describe CountriesController do
|
|
51
51
|
|
52
52
|
describe 'GET show' do
|
53
53
|
before(:each) do
|
54
|
-
@country =
|
54
|
+
@country = FactoryBot.create(:country)
|
55
55
|
end
|
56
56
|
|
57
57
|
describe 'When logged in as Administrator' do
|
@@ -134,7 +134,7 @@ describe CountriesController do
|
|
134
134
|
login_fixture_admin
|
135
135
|
|
136
136
|
it 'assigns the requested country as @country' do
|
137
|
-
country =
|
137
|
+
country = FactoryBot.create(:country)
|
138
138
|
get :edit, id: country.id
|
139
139
|
assigns(:country).should eq(country)
|
140
140
|
end
|
@@ -144,7 +144,7 @@ describe CountriesController do
|
|
144
144
|
login_fixture_librarian
|
145
145
|
|
146
146
|
it 'assigns the requested country as @country' do
|
147
|
-
country =
|
147
|
+
country = FactoryBot.create(:country)
|
148
148
|
get :edit, id: country.id
|
149
149
|
assigns(:country).should eq(country)
|
150
150
|
end
|
@@ -154,7 +154,7 @@ describe CountriesController do
|
|
154
154
|
login_fixture_user
|
155
155
|
|
156
156
|
it 'assigns the requested country as @country' do
|
157
|
-
country =
|
157
|
+
country = FactoryBot.create(:country)
|
158
158
|
get :edit, id: country.id
|
159
159
|
assigns(:country).should eq(country)
|
160
160
|
end
|
@@ -162,7 +162,7 @@ describe CountriesController do
|
|
162
162
|
|
163
163
|
describe 'When not logged in' do
|
164
164
|
it 'should not assign the requested country as @country' do
|
165
|
-
country =
|
165
|
+
country = FactoryBot.create(:country)
|
166
166
|
get :edit, id: country.id
|
167
167
|
expect(response).to redirect_to(new_user_session_url)
|
168
168
|
end
|
@@ -288,7 +288,7 @@ describe CountriesController do
|
|
288
288
|
|
289
289
|
describe 'PUT update' do
|
290
290
|
before(:each) do
|
291
|
-
@country =
|
291
|
+
@country = FactoryBot.create(:country)
|
292
292
|
@attrs = valid_attributes
|
293
293
|
@invalid_attrs = { name: '' }
|
294
294
|
end
|
@@ -397,7 +397,7 @@ describe CountriesController do
|
|
397
397
|
|
398
398
|
describe 'DELETE destroy' do
|
399
399
|
before(:each) do
|
400
|
-
@country =
|
400
|
+
@country = FactoryBot.create(:country)
|
401
401
|
end
|
402
402
|
|
403
403
|
describe 'When logged in as Administrator' do
|
@@ -26,7 +26,7 @@ describe CreateTypesController do
|
|
26
26
|
# CreateType. As you add validations to CreateType, be sure to
|
27
27
|
# update the return value of this method accordingly.
|
28
28
|
def valid_attributes
|
29
|
-
|
29
|
+
FactoryBot.attributes_for(:create_type)
|
30
30
|
end
|
31
31
|
|
32
32
|
describe 'GET index' do
|
@@ -6,12 +6,12 @@ describe CreatesController do
|
|
6
6
|
disconnect_sunspot
|
7
7
|
|
8
8
|
def valid_attributes
|
9
|
-
|
9
|
+
FactoryBot.attributes_for(:create)
|
10
10
|
end
|
11
11
|
|
12
12
|
describe 'GET index' do
|
13
13
|
before(:each) do
|
14
|
-
|
14
|
+
FactoryBot.create(:create)
|
15
15
|
end
|
16
16
|
|
17
17
|
describe 'When logged in as Administrator' do
|
@@ -54,7 +54,7 @@ describe CreatesController do
|
|
54
54
|
login_fixture_admin
|
55
55
|
|
56
56
|
it 'assigns the requested create as @create' do
|
57
|
-
create =
|
57
|
+
create = FactoryBot.create(:create)
|
58
58
|
get :show, id: create.id
|
59
59
|
expect(assigns(:create)).to eq(create)
|
60
60
|
end
|
@@ -64,7 +64,7 @@ describe CreatesController do
|
|
64
64
|
login_fixture_librarian
|
65
65
|
|
66
66
|
it 'assigns the requested create as @create' do
|
67
|
-
create =
|
67
|
+
create = FactoryBot.create(:create)
|
68
68
|
get :show, id: create.id
|
69
69
|
expect(assigns(:create)).to eq(create)
|
70
70
|
end
|
@@ -74,7 +74,7 @@ describe CreatesController do
|
|
74
74
|
login_fixture_user
|
75
75
|
|
76
76
|
it 'assigns the requested create as @create' do
|
77
|
-
create =
|
77
|
+
create = FactoryBot.create(:create)
|
78
78
|
get :show, id: create.id
|
79
79
|
expect(assigns(:create)).to eq(create)
|
80
80
|
end
|
@@ -82,7 +82,7 @@ describe CreatesController do
|
|
82
82
|
|
83
83
|
describe 'When not logged in' do
|
84
84
|
it 'assigns the requested create as @create' do
|
85
|
-
create =
|
85
|
+
create = FactoryBot.create(:create)
|
86
86
|
get :show, id: create.id
|
87
87
|
expect(assigns(:create)).to eq(create)
|
88
88
|
end
|
@@ -132,7 +132,7 @@ describe CreatesController do
|
|
132
132
|
login_fixture_admin
|
133
133
|
|
134
134
|
it 'assigns the requested create as @create' do
|
135
|
-
create =
|
135
|
+
create = FactoryBot.create(:create)
|
136
136
|
get :edit, id: create.id
|
137
137
|
expect(assigns(:create)).to eq(create)
|
138
138
|
end
|
@@ -142,7 +142,7 @@ describe CreatesController do
|
|
142
142
|
login_fixture_librarian
|
143
143
|
|
144
144
|
it 'assigns the requested create as @create' do
|
145
|
-
create =
|
145
|
+
create = FactoryBot.create(:create)
|
146
146
|
get :edit, id: create.id
|
147
147
|
expect(assigns(:create)).to eq(create)
|
148
148
|
end
|
@@ -152,7 +152,7 @@ describe CreatesController do
|
|
152
152
|
login_fixture_user
|
153
153
|
|
154
154
|
it 'assigns the requested create as @create' do
|
155
|
-
create =
|
155
|
+
create = FactoryBot.create(:create)
|
156
156
|
get :edit, id: create.id
|
157
157
|
expect(response).to be_forbidden
|
158
158
|
end
|
@@ -160,7 +160,7 @@ describe CreatesController do
|
|
160
160
|
|
161
161
|
describe 'When not logged in' do
|
162
162
|
it 'should not assign the requested create as @create' do
|
163
|
-
create =
|
163
|
+
create = FactoryBot.create(:create)
|
164
164
|
get :edit, id: create.id
|
165
165
|
expect(response).to redirect_to(new_user_session_url)
|
166
166
|
end
|
@@ -394,7 +394,7 @@ describe CreatesController do
|
|
394
394
|
|
395
395
|
describe 'DELETE destroy' do
|
396
396
|
before(:each) do
|
397
|
-
@create =
|
397
|
+
@create = FactoryBot.create(:create)
|
398
398
|
end
|
399
399
|
|
400
400
|
describe 'When logged in as Administrator' do
|
@@ -6,7 +6,7 @@ describe DonatesController do
|
|
6
6
|
disconnect_sunspot
|
7
7
|
|
8
8
|
def valid_attributes
|
9
|
-
|
9
|
+
FactoryBot.attributes_for(:donate)
|
10
10
|
end
|
11
11
|
|
12
12
|
describe 'GET index' do
|
@@ -50,7 +50,7 @@ describe DonatesController do
|
|
50
50
|
login_fixture_admin
|
51
51
|
|
52
52
|
it 'assigns the requested donate as @donate' do
|
53
|
-
donate =
|
53
|
+
donate = FactoryBot.create(:donate)
|
54
54
|
get :show, id: donate.id
|
55
55
|
expect(assigns(:donate)).to eq(donate)
|
56
56
|
end
|
@@ -60,7 +60,7 @@ describe DonatesController do
|
|
60
60
|
login_fixture_librarian
|
61
61
|
|
62
62
|
it 'assigns the requested donate as @donate' do
|
63
|
-
donate =
|
63
|
+
donate = FactoryBot.create(:donate)
|
64
64
|
get :show, id: donate.id
|
65
65
|
expect(assigns(:donate)).to eq(donate)
|
66
66
|
end
|
@@ -70,7 +70,7 @@ describe DonatesController do
|
|
70
70
|
login_fixture_user
|
71
71
|
|
72
72
|
it 'assigns the requested donate as @donate' do
|
73
|
-
donate =
|
73
|
+
donate = FactoryBot.create(:donate)
|
74
74
|
get :show, id: donate.id
|
75
75
|
expect(assigns(:donate)).to eq(donate)
|
76
76
|
end
|
@@ -78,7 +78,7 @@ describe DonatesController do
|
|
78
78
|
|
79
79
|
describe 'When not logged in' do
|
80
80
|
it 'assigns the requested donate as @donate' do
|
81
|
-
donate =
|
81
|
+
donate = FactoryBot.create(:donate)
|
82
82
|
get :show, id: donate.id
|
83
83
|
expect(assigns(:donate)).to eq(donate)
|
84
84
|
end
|
@@ -128,7 +128,7 @@ describe DonatesController do
|
|
128
128
|
login_fixture_admin
|
129
129
|
|
130
130
|
it 'assigns the requested donate as @donate' do
|
131
|
-
donate =
|
131
|
+
donate = FactoryBot.create(:donate)
|
132
132
|
get :edit, id: donate.id
|
133
133
|
expect(assigns(:donate)).to eq(donate)
|
134
134
|
end
|
@@ -138,7 +138,7 @@ describe DonatesController do
|
|
138
138
|
login_fixture_librarian
|
139
139
|
|
140
140
|
it 'assigns the requested donate as @donate' do
|
141
|
-
donate =
|
141
|
+
donate = FactoryBot.create(:donate)
|
142
142
|
get :edit, id: donate.id
|
143
143
|
expect(assigns(:donate)).to eq(donate)
|
144
144
|
end
|
@@ -148,7 +148,7 @@ describe DonatesController do
|
|
148
148
|
login_fixture_user
|
149
149
|
|
150
150
|
it 'assigns the requested donate as @donate' do
|
151
|
-
donate =
|
151
|
+
donate = FactoryBot.create(:donate)
|
152
152
|
get :edit, id: donate.id
|
153
153
|
expect(response).to be_forbidden
|
154
154
|
end
|
@@ -156,7 +156,7 @@ describe DonatesController do
|
|
156
156
|
|
157
157
|
describe 'When not logged in' do
|
158
158
|
it 'should not assign the requested donate as @donate' do
|
159
|
-
donate =
|
159
|
+
donate = FactoryBot.create(:donate)
|
160
160
|
get :edit, id: donate.id
|
161
161
|
expect(response).to redirect_to(new_user_session_url)
|
162
162
|
end
|
@@ -282,7 +282,7 @@ describe DonatesController do
|
|
282
282
|
|
283
283
|
describe 'PUT update' do
|
284
284
|
before(:each) do
|
285
|
-
@donate =
|
285
|
+
@donate = FactoryBot.create(:donate)
|
286
286
|
@attrs = valid_attributes
|
287
287
|
@invalid_attrs = { item_id: '' }
|
288
288
|
end
|
@@ -383,7 +383,7 @@ describe DonatesController do
|
|
383
383
|
|
384
384
|
describe 'DELETE destroy' do
|
385
385
|
before(:each) do
|
386
|
-
@donate =
|
386
|
+
@donate = FactoryBot.create(:donate)
|
387
387
|
end
|
388
388
|
|
389
389
|
describe 'When logged in as Administrator' do
|