enju_biblio 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/icons/book.png +0 -0
- data/app/assets/images/icons/cd.png +0 -0
- data/app/assets/images/icons/dvd.png +0 -0
- data/app/assets/images/icons/monitor.png +0 -0
- data/app/controllers/carrier_types_controller.rb +8 -3
- data/app/controllers/manifestations_controller.rb +17 -4
- data/app/controllers/picture_files_controller.rb +1 -1
- data/app/controllers/series_statements_controller.rb +6 -0
- data/app/helpers/manifestations_helper.rb +1 -1
- data/app/models/agent_import_file_transition.rb +1 -0
- data/app/models/carrier_type.rb +11 -7
- data/app/models/import_request_transition.rb +1 -0
- data/app/models/manifestation.rb +5 -0
- data/app/models/resource_export_file_transition.rb +1 -0
- data/app/models/resource_import_file_transition.rb +1 -0
- data/app/views/carrier_types/index.html.erb +4 -1
- data/app/views/manifestations/_show_detail_librarian.html.erb +4 -0
- data/app/views/manifestations/index.html.erb +3 -0
- data/config/locales/translation_en.yml +2 -0
- data/config/locales/translation_ja.yml +2 -0
- data/lib/enju_biblio/biblio_helper.rb +1 -12
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/generators/enju_biblio/setup/templates/config/schedule.rb +3 -3
- data/lib/tasks/carrier_type.rb +30 -18
- data/lib/tasks/enju_biblio_tasks.rake +2 -0
- data/spec/controllers/agent_import_files_controller_spec.rb +87 -87
- data/spec/controllers/agent_import_results_controller_spec.rb +22 -22
- data/spec/controllers/agent_merge_lists_controller_spec.rb +157 -157
- data/spec/controllers/agent_merges_controller_spec.rb +151 -151
- data/spec/controllers/agent_relationship_types_controller_spec.rb +152 -152
- data/spec/controllers/agent_relationships_controller_spec.rb +153 -153
- data/spec/controllers/agent_types_controller_spec.rb +49 -50
- data/spec/controllers/agents_controller_spec.rb +234 -234
- data/spec/controllers/carrier_types_controller_spec.rb +123 -103
- data/spec/controllers/content_types_controller_spec.rb +51 -52
- data/spec/controllers/countries_controller_spec.rb +156 -156
- data/spec/controllers/create_types_controller_spec.rb +48 -49
- data/spec/controllers/creates_controller_spec.rb +154 -154
- data/spec/controllers/donates_controller_spec.rb +153 -153
- data/spec/controllers/form_of_works_controller_spec.rb +48 -49
- data/spec/controllers/frequencies_controller_spec.rb +51 -52
- data/spec/controllers/identifier_types_controller_spec.rb +48 -49
- data/spec/controllers/import_requests_controller_spec.rb +165 -164
- data/spec/controllers/items_controller_spec.rb +214 -216
- data/spec/controllers/languages_controller_spec.rb +109 -109
- data/spec/controllers/licenses_controller_spec.rb +48 -49
- data/spec/controllers/manifestation_relationship_types_controller_spec.rb +152 -152
- data/spec/controllers/manifestation_relationships_controller_spec.rb +153 -153
- data/spec/controllers/manifestations_controller_spec.rb +319 -289
- data/spec/controllers/medium_of_performances_controller_spec.rb +48 -49
- data/spec/controllers/owns_controller_spec.rb +153 -153
- data/spec/controllers/picture_files_controller_spec.rb +156 -156
- data/spec/controllers/produce_types_controller_spec.rb +48 -49
- data/spec/controllers/produces_controller_spec.rb +154 -154
- data/spec/controllers/realize_types_controller_spec.rb +48 -49
- data/spec/controllers/realizes_controller_spec.rb +155 -155
- data/spec/controllers/resource_export_files_controller_spec.rb +72 -72
- data/spec/controllers/resource_import_files_controller_spec.rb +90 -90
- data/spec/controllers/resource_import_results_controller_spec.rb +43 -43
- data/spec/controllers/series_statement_merge_lists_controller_spec.rb +153 -153
- data/spec/controllers/series_statement_merges_controller_spec.rb +151 -151
- data/spec/controllers/series_statements_controller_spec.rb +154 -154
- data/spec/factories/checkout.rb +9 -0
- data/spec/factories/library.rb +13 -0
- data/spec/factories/shelf.rb +6 -0
- data/spec/fixtures/carrier_types.yml +11 -7
- data/spec/models/carrier_type_spec.rb +11 -7
- data/spec/models/resource_export_file_spec.rb +58 -16
- data/spec/support/resque.rb +0 -1
- data/spec/views/manifestations/show.html.erb_spec.rb +5 -0
- data/spec/views/resource_import_files/index.html.erb_spec.rb +1 -1
- data/spec/views/resource_import_files/show.html.erb_spec.rb +1 -1
- data/spec/views/resource_import_results/index.html.erb_spec.rb +1 -1
- data/spec/views/resource_import_results/show.html.erb_spec.rb +1 -1
- metadata +49 -39
@@ -4,37 +4,37 @@ require 'rails_helper'
|
|
4
4
|
describe ResourceImportResultsController do
|
5
5
|
fixtures :all
|
6
6
|
|
7
|
-
describe
|
8
|
-
describe
|
7
|
+
describe 'GET index' do
|
8
|
+
describe 'When logged in as Administrator' do
|
9
9
|
login_fixture_admin
|
10
10
|
|
11
|
-
it
|
11
|
+
it 'assigns all resource_import_results as @resource_import_results' do
|
12
12
|
get :index
|
13
13
|
expect(assigns(:resource_import_results)).to eq(ResourceImportResult.page(1))
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
describe
|
17
|
+
describe 'When logged in as Librarian' do
|
18
18
|
login_fixture_librarian
|
19
19
|
|
20
|
-
it
|
20
|
+
it 'assigns all resource_import_results as @resource_import_results' do
|
21
21
|
get :index
|
22
22
|
expect(assigns(:resource_import_results)).to eq(ResourceImportResult.page(1))
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
describe
|
26
|
+
describe 'When logged in as User' do
|
27
27
|
login_fixture_user
|
28
28
|
|
29
|
-
it
|
29
|
+
it 'assigns empty as @resource_import_results' do
|
30
30
|
get :index
|
31
31
|
expect(assigns(:resource_import_results)).to be_nil
|
32
32
|
expect(response).to be_forbidden
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
describe
|
37
|
-
it
|
36
|
+
describe 'When not logged in' do
|
37
|
+
it 'assigns empty as @resource_import_results' do
|
38
38
|
get :index
|
39
39
|
expect(assigns(:resource_import_results)).to be_nil
|
40
40
|
expect(response).to redirect_to(new_user_session_url)
|
@@ -42,94 +42,94 @@ describe ResourceImportResultsController do
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
describe
|
46
|
-
describe
|
45
|
+
describe 'GET show' do
|
46
|
+
describe 'When logged in as Administrator' do
|
47
47
|
login_fixture_admin
|
48
48
|
|
49
|
-
it
|
50
|
-
get :show, :
|
49
|
+
it 'assigns the requested resource_import_result as @resource_import_result' do
|
50
|
+
get :show, id: 1
|
51
51
|
expect(assigns(:resource_import_result)).to eq(ResourceImportResult.find(1))
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
describe
|
55
|
+
describe 'When logged in as Librarian' do
|
56
56
|
login_fixture_librarian
|
57
57
|
|
58
|
-
it
|
59
|
-
get :show, :
|
58
|
+
it 'assigns the requested resource_import_result as @resource_import_result' do
|
59
|
+
get :show, id: 1
|
60
60
|
expect(assigns(:resource_import_result)).to eq(ResourceImportResult.find(1))
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
describe
|
64
|
+
describe 'When logged in as User' do
|
65
65
|
login_fixture_user
|
66
66
|
|
67
|
-
it
|
68
|
-
get :show, :
|
67
|
+
it 'assigns the requested resource_import_result as @resource_import_result' do
|
68
|
+
get :show, id: 1
|
69
69
|
expect(assigns(:resource_import_result)).to eq(ResourceImportResult.find(1))
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
-
describe
|
74
|
-
it
|
75
|
-
get :show, :
|
73
|
+
describe 'When not logged in' do
|
74
|
+
it 'assigns the requested resource_import_result as @resource_import_result' do
|
75
|
+
get :show, id: 1
|
76
76
|
expect(assigns(:resource_import_result)).to eq(ResourceImportResult.find(1))
|
77
77
|
expect(response).to redirect_to(new_user_session_url)
|
78
78
|
end
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
-
describe
|
82
|
+
describe 'DELETE destroy' do
|
83
83
|
before(:each) do
|
84
84
|
@resource_import_result = resource_import_results(:one)
|
85
85
|
end
|
86
86
|
|
87
|
-
describe
|
87
|
+
describe 'When logged in as Administrator' do
|
88
88
|
login_fixture_admin
|
89
89
|
|
90
|
-
it
|
91
|
-
delete :destroy, :
|
90
|
+
it 'destroys the requested resource_import_result' do
|
91
|
+
delete :destroy, id: @resource_import_result.id
|
92
92
|
end
|
93
93
|
|
94
|
-
it
|
95
|
-
delete :destroy, :
|
94
|
+
it 'should be forbidden' do
|
95
|
+
delete :destroy, id: @resource_import_result.id
|
96
96
|
expect(response).to be_forbidden
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
-
describe
|
100
|
+
describe 'When logged in as Librarian' do
|
101
101
|
login_fixture_librarian
|
102
102
|
|
103
|
-
it
|
104
|
-
delete :destroy, :
|
103
|
+
it 'destroys the requested resource_import_result' do
|
104
|
+
delete :destroy, id: @resource_import_result.id
|
105
105
|
end
|
106
106
|
|
107
|
-
it
|
108
|
-
delete :destroy, :
|
107
|
+
it 'should be forbidden' do
|
108
|
+
delete :destroy, id: @resource_import_result.id
|
109
109
|
expect(response).to be_forbidden
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
-
describe
|
113
|
+
describe 'When logged in as User' do
|
114
114
|
login_fixture_user
|
115
115
|
|
116
|
-
it
|
117
|
-
delete :destroy, :
|
116
|
+
it 'destroys the requested resource_import_result' do
|
117
|
+
delete :destroy, id: @resource_import_result.id
|
118
118
|
end
|
119
119
|
|
120
|
-
it
|
121
|
-
delete :destroy, :
|
120
|
+
it 'should be forbidden' do
|
121
|
+
delete :destroy, id: @resource_import_result.id
|
122
122
|
expect(response).to be_forbidden
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|
126
|
-
describe
|
127
|
-
it
|
128
|
-
delete :destroy, :
|
126
|
+
describe 'When not logged in' do
|
127
|
+
it 'destroys the requested resource_import_result' do
|
128
|
+
delete :destroy, id: @resource_import_result.id
|
129
129
|
end
|
130
130
|
|
131
|
-
it
|
132
|
-
delete :destroy, :
|
131
|
+
it 'should be forbidden' do
|
132
|
+
delete :destroy, id: @resource_import_result.id
|
133
133
|
expect(response).to redirect_to(new_user_session_url)
|
134
134
|
end
|
135
135
|
end
|
@@ -4,113 +4,113 @@ require 'sunspot/rails/spec_helper'
|
|
4
4
|
describe SeriesStatementMergeListsController do
|
5
5
|
disconnect_sunspot
|
6
6
|
|
7
|
-
describe
|
8
|
-
describe
|
7
|
+
describe 'GET index' do
|
8
|
+
describe 'When logged in as Administrator' do
|
9
9
|
login_admin
|
10
10
|
|
11
|
-
it
|
11
|
+
it 'assigns all series_statement_merge_lists as @series_statement_merge_lists' do
|
12
12
|
get :index
|
13
13
|
assigns(:series_statement_merge_lists).should eq(SeriesStatementMergeList.page(1))
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
describe
|
17
|
+
describe 'When logged in as Librarian' do
|
18
18
|
login_librarian
|
19
19
|
|
20
|
-
it
|
20
|
+
it 'assigns all series_statement_merge_lists as @series_statement_merge_lists' do
|
21
21
|
get :index
|
22
22
|
assigns(:series_statement_merge_lists).should eq(SeriesStatementMergeList.page(1))
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
describe
|
26
|
+
describe 'When logged in as User' do
|
27
27
|
login_user
|
28
28
|
|
29
|
-
it
|
29
|
+
it 'assigns empty as @series_statement_merge_lists' do
|
30
30
|
get :index
|
31
31
|
assigns(:series_statement_merge_lists).should be_nil
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
describe
|
36
|
-
it
|
35
|
+
describe 'When not logged in' do
|
36
|
+
it 'assigns empty as @series_statement_merge_lists' do
|
37
37
|
get :index
|
38
38
|
assigns(:series_statement_merge_lists).should be_nil
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
describe
|
44
|
-
describe
|
43
|
+
describe 'GET show' do
|
44
|
+
describe 'When logged in as Administrator' do
|
45
45
|
login_admin
|
46
46
|
|
47
|
-
it
|
47
|
+
it 'assigns the requested series_statement_merge_list as @series_statement_merge_list' do
|
48
48
|
series_statement_merge_list = FactoryGirl.create(:series_statement_merge_list)
|
49
|
-
get :show, :
|
49
|
+
get :show, id: series_statement_merge_list.id
|
50
50
|
assigns(:series_statement_merge_list).should eq(series_statement_merge_list)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
describe
|
54
|
+
describe 'When logged in as Librarian' do
|
55
55
|
login_librarian
|
56
56
|
|
57
|
-
it
|
57
|
+
it 'assigns the requested series_statement_merge_list as @series_statement_merge_list' do
|
58
58
|
series_statement_merge_list = FactoryGirl.create(:series_statement_merge_list)
|
59
|
-
get :show, :
|
59
|
+
get :show, id: series_statement_merge_list.id
|
60
60
|
assigns(:series_statement_merge_list).should eq(series_statement_merge_list)
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
describe
|
64
|
+
describe 'When logged in as User' do
|
65
65
|
login_user
|
66
66
|
|
67
|
-
it
|
67
|
+
it 'assigns the requested series_statement_merge_list as @series_statement_merge_list' do
|
68
68
|
series_statement_merge_list = FactoryGirl.create(:series_statement_merge_list)
|
69
|
-
get :show, :
|
69
|
+
get :show, id: series_statement_merge_list.id
|
70
70
|
assigns(:series_statement_merge_list).should eq(series_statement_merge_list)
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
describe
|
75
|
-
it
|
74
|
+
describe 'When not logged in' do
|
75
|
+
it 'assigns the requested series_statement_merge_list as @series_statement_merge_list' do
|
76
76
|
series_statement_merge_list = FactoryGirl.create(:series_statement_merge_list)
|
77
|
-
get :show, :
|
77
|
+
get :show, id: series_statement_merge_list.id
|
78
78
|
assigns(:series_statement_merge_list).should eq(series_statement_merge_list)
|
79
79
|
end
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
describe
|
84
|
-
describe
|
83
|
+
describe 'GET new' do
|
84
|
+
describe 'When logged in as Administrator' do
|
85
85
|
login_admin
|
86
86
|
|
87
|
-
it
|
87
|
+
it 'assigns the requested series_statement_merge_list as @series_statement_merge_list' do
|
88
88
|
get :new
|
89
89
|
assigns(:series_statement_merge_list).should_not be_valid
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
-
describe
|
93
|
+
describe 'When logged in as Librarian' do
|
94
94
|
login_librarian
|
95
95
|
|
96
|
-
it
|
96
|
+
it 'assigns the requested series_statement_merge_list as @series_statement_merge_list' do
|
97
97
|
get :new
|
98
98
|
assigns(:series_statement_merge_list).should_not be_valid
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
|
-
describe
|
102
|
+
describe 'When logged in as User' do
|
103
103
|
login_user
|
104
104
|
|
105
|
-
it
|
105
|
+
it 'should not assign the requested series_statement_merge_list as @series_statement_merge_list' do
|
106
106
|
get :new
|
107
107
|
assigns(:series_statement_merge_list).should be_nil
|
108
108
|
response.should be_forbidden
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
112
|
-
describe
|
113
|
-
it
|
112
|
+
describe 'When not logged in' do
|
113
|
+
it 'should not assign the requested series_statement_merge_list as @series_statement_merge_list' do
|
114
114
|
get :new
|
115
115
|
assigns(:series_statement_merge_list).should be_nil
|
116
116
|
response.should redirect_to(new_user_session_url)
|
@@ -118,320 +118,320 @@ describe SeriesStatementMergeListsController do
|
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
121
|
-
describe
|
122
|
-
describe
|
121
|
+
describe 'GET edit' do
|
122
|
+
describe 'When logged in as Administrator' do
|
123
123
|
login_admin
|
124
124
|
|
125
|
-
it
|
125
|
+
it 'assigns the requested series_statement_merge_list as @series_statement_merge_list' do
|
126
126
|
series_statement_merge_list = FactoryGirl.create(:series_statement_merge_list)
|
127
|
-
get :edit, :
|
127
|
+
get :edit, id: series_statement_merge_list.id
|
128
128
|
assigns(:series_statement_merge_list).should eq(series_statement_merge_list)
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
|
-
describe
|
132
|
+
describe 'When logged in as Librarian' do
|
133
133
|
login_librarian
|
134
134
|
|
135
|
-
it
|
135
|
+
it 'assigns the requested series_statement_merge_list as @series_statement_merge_list' do
|
136
136
|
series_statement_merge_list = FactoryGirl.create(:series_statement_merge_list)
|
137
|
-
get :edit, :
|
137
|
+
get :edit, id: series_statement_merge_list.id
|
138
138
|
assigns(:series_statement_merge_list).should eq(series_statement_merge_list)
|
139
139
|
end
|
140
140
|
end
|
141
141
|
|
142
|
-
describe
|
142
|
+
describe 'When logged in as User' do
|
143
143
|
login_user
|
144
144
|
|
145
|
-
it
|
145
|
+
it 'assigns the requested series_statement_merge_list as @series_statement_merge_list' do
|
146
146
|
series_statement_merge_list = FactoryGirl.create(:series_statement_merge_list)
|
147
|
-
get :edit, :
|
147
|
+
get :edit, id: series_statement_merge_list.id
|
148
148
|
response.should be_forbidden
|
149
149
|
end
|
150
150
|
end
|
151
151
|
|
152
|
-
describe
|
153
|
-
it
|
152
|
+
describe 'When not logged in' do
|
153
|
+
it 'should not assign the requested series_statement_merge_list as @series_statement_merge_list' do
|
154
154
|
series_statement_merge_list = FactoryGirl.create(:series_statement_merge_list)
|
155
|
-
get :edit, :
|
155
|
+
get :edit, id: series_statement_merge_list.id
|
156
156
|
response.should redirect_to(new_user_session_url)
|
157
157
|
end
|
158
158
|
end
|
159
159
|
end
|
160
160
|
|
161
|
-
describe
|
161
|
+
describe 'POST create' do
|
162
162
|
before(:each) do
|
163
163
|
@attrs = FactoryGirl.attributes_for(:series_statement_merge_list)
|
164
|
-
@invalid_attrs = {:
|
164
|
+
@invalid_attrs = { title: '' }
|
165
165
|
end
|
166
166
|
|
167
|
-
describe
|
167
|
+
describe 'When logged in as Administrator' do
|
168
168
|
login_admin
|
169
169
|
|
170
|
-
describe
|
171
|
-
it
|
172
|
-
post :create, :
|
170
|
+
describe 'with valid params' do
|
171
|
+
it 'assigns a newly created series_statement_merge_list as @series_statement_merge_list' do
|
172
|
+
post :create, series_statement_merge_list: @attrs
|
173
173
|
assigns(:series_statement_merge_list).should be_valid
|
174
174
|
end
|
175
175
|
|
176
|
-
it
|
177
|
-
post :create, :
|
176
|
+
it 'redirects to the created series_statement_merge_list' do
|
177
|
+
post :create, series_statement_merge_list: @attrs
|
178
178
|
response.should redirect_to(series_statement_merge_list_url(assigns(:series_statement_merge_list)))
|
179
179
|
end
|
180
180
|
end
|
181
181
|
|
182
|
-
describe
|
183
|
-
it
|
184
|
-
post :create, :
|
182
|
+
describe 'with invalid params' do
|
183
|
+
it 'assigns a newly created but unsaved series_statement_merge_list as @series_statement_merge_list' do
|
184
|
+
post :create, series_statement_merge_list: @invalid_attrs
|
185
185
|
assigns(:series_statement_merge_list).should_not be_valid
|
186
186
|
end
|
187
187
|
|
188
188
|
it "re-renders the 'new' template" do
|
189
|
-
post :create, :
|
190
|
-
response.should render_template(
|
189
|
+
post :create, series_statement_merge_list: @invalid_attrs
|
190
|
+
response.should render_template('new')
|
191
191
|
end
|
192
192
|
end
|
193
193
|
end
|
194
194
|
|
195
|
-
describe
|
195
|
+
describe 'When logged in as Librarian' do
|
196
196
|
login_librarian
|
197
197
|
|
198
|
-
describe
|
199
|
-
it
|
200
|
-
post :create, :
|
198
|
+
describe 'with valid params' do
|
199
|
+
it 'assigns a newly created series_statement_merge_list as @series_statement_merge_list' do
|
200
|
+
post :create, series_statement_merge_list: @attrs
|
201
201
|
assigns(:series_statement_merge_list).should be_valid
|
202
202
|
end
|
203
203
|
|
204
|
-
it
|
205
|
-
post :create, :
|
204
|
+
it 'redirects to the created series_statement_merge_list' do
|
205
|
+
post :create, series_statement_merge_list: @attrs
|
206
206
|
response.should redirect_to(series_statement_merge_list_url(assigns(:series_statement_merge_list)))
|
207
207
|
end
|
208
208
|
end
|
209
209
|
|
210
|
-
describe
|
211
|
-
it
|
212
|
-
post :create, :
|
210
|
+
describe 'with invalid params' do
|
211
|
+
it 'assigns a newly created but unsaved series_statement_merge_list as @series_statement_merge_list' do
|
212
|
+
post :create, series_statement_merge_list: @invalid_attrs
|
213
213
|
assigns(:series_statement_merge_list).should_not be_valid
|
214
214
|
end
|
215
215
|
|
216
216
|
it "re-renders the 'new' template" do
|
217
|
-
post :create, :
|
218
|
-
response.should render_template(
|
217
|
+
post :create, series_statement_merge_list: @invalid_attrs
|
218
|
+
response.should render_template('new')
|
219
219
|
end
|
220
220
|
end
|
221
221
|
end
|
222
222
|
|
223
|
-
describe
|
223
|
+
describe 'When logged in as User' do
|
224
224
|
login_user
|
225
225
|
|
226
|
-
describe
|
227
|
-
it
|
228
|
-
post :create, :
|
226
|
+
describe 'with valid params' do
|
227
|
+
it 'assigns a newly created series_statement_merge_list as @series_statement_merge_list' do
|
228
|
+
post :create, series_statement_merge_list: @attrs
|
229
229
|
assigns(:series_statement_merge_list).should be_nil
|
230
230
|
end
|
231
231
|
|
232
|
-
it
|
233
|
-
post :create, :
|
232
|
+
it 'should be forbidden' do
|
233
|
+
post :create, series_statement_merge_list: @attrs
|
234
234
|
response.should be_forbidden
|
235
235
|
end
|
236
236
|
end
|
237
237
|
|
238
|
-
describe
|
239
|
-
it
|
240
|
-
post :create, :
|
238
|
+
describe 'with invalid params' do
|
239
|
+
it 'assigns a newly created but unsaved series_statement_merge_list as @series_statement_merge_list' do
|
240
|
+
post :create, series_statement_merge_list: @invalid_attrs
|
241
241
|
assigns(:series_statement_merge_list).should be_nil
|
242
242
|
end
|
243
243
|
|
244
|
-
it
|
245
|
-
post :create, :
|
244
|
+
it 'should be forbidden' do
|
245
|
+
post :create, series_statement_merge_list: @invalid_attrs
|
246
246
|
response.should be_forbidden
|
247
247
|
end
|
248
248
|
end
|
249
249
|
end
|
250
250
|
|
251
|
-
describe
|
252
|
-
describe
|
253
|
-
it
|
254
|
-
post :create, :
|
251
|
+
describe 'When not logged in' do
|
252
|
+
describe 'with valid params' do
|
253
|
+
it 'assigns a newly created series_statement_merge_list as @series_statement_merge_list' do
|
254
|
+
post :create, series_statement_merge_list: @attrs
|
255
255
|
assigns(:series_statement_merge_list).should be_nil
|
256
256
|
end
|
257
257
|
|
258
|
-
it
|
259
|
-
post :create, :
|
258
|
+
it 'should be forbidden' do
|
259
|
+
post :create, series_statement_merge_list: @attrs
|
260
260
|
response.should redirect_to(new_user_session_url)
|
261
261
|
end
|
262
262
|
end
|
263
263
|
|
264
|
-
describe
|
265
|
-
it
|
266
|
-
post :create, :
|
264
|
+
describe 'with invalid params' do
|
265
|
+
it 'assigns a newly created but unsaved series_statement_merge_list as @series_statement_merge_list' do
|
266
|
+
post :create, series_statement_merge_list: @invalid_attrs
|
267
267
|
assigns(:series_statement_merge_list).should be_nil
|
268
268
|
end
|
269
269
|
|
270
|
-
it
|
271
|
-
post :create, :
|
270
|
+
it 'should be forbidden' do
|
271
|
+
post :create, series_statement_merge_list: @invalid_attrs
|
272
272
|
response.should redirect_to(new_user_session_url)
|
273
273
|
end
|
274
274
|
end
|
275
275
|
end
|
276
276
|
end
|
277
277
|
|
278
|
-
describe
|
278
|
+
describe 'PUT update' do
|
279
279
|
before(:each) do
|
280
280
|
@series_statement_merge_list = FactoryGirl.create(:series_statement_merge_list)
|
281
281
|
@attrs = FactoryGirl.attributes_for(:series_statement_merge_list)
|
282
|
-
@invalid_attrs = {:
|
282
|
+
@invalid_attrs = { title: '' }
|
283
283
|
end
|
284
284
|
|
285
|
-
describe
|
285
|
+
describe 'When logged in as Administrator' do
|
286
286
|
login_admin
|
287
287
|
|
288
|
-
describe
|
289
|
-
it
|
290
|
-
put :update, :
|
288
|
+
describe 'with valid params' do
|
289
|
+
it 'updates the requested series_statement_merge_list' do
|
290
|
+
put :update, id: @series_statement_merge_list.id, series_statement_merge_list: @attrs
|
291
291
|
end
|
292
292
|
|
293
|
-
it
|
294
|
-
put :update, :
|
293
|
+
it 'assigns the requested series_statement_merge_list as @series_statement_merge_list' do
|
294
|
+
put :update, id: @series_statement_merge_list.id, series_statement_merge_list: @attrs
|
295
295
|
assigns(:series_statement_merge_list).should eq(@series_statement_merge_list)
|
296
296
|
response.should redirect_to(@series_statement_merge_list)
|
297
297
|
end
|
298
298
|
end
|
299
299
|
|
300
|
-
describe
|
301
|
-
it
|
302
|
-
put :update, :
|
300
|
+
describe 'with invalid params' do
|
301
|
+
it 'assigns the requested series_statement_merge_list as @series_statement_merge_list' do
|
302
|
+
put :update, id: @series_statement_merge_list.id, series_statement_merge_list: @invalid_attrs
|
303
303
|
end
|
304
304
|
|
305
305
|
it "re-renders the 'edit' template" do
|
306
|
-
put :update, :
|
307
|
-
response.should render_template(
|
306
|
+
put :update, id: @series_statement_merge_list.id, series_statement_merge_list: @invalid_attrs
|
307
|
+
response.should render_template('edit')
|
308
308
|
end
|
309
309
|
end
|
310
310
|
end
|
311
311
|
|
312
|
-
describe
|
312
|
+
describe 'When logged in as Librarian' do
|
313
313
|
login_librarian
|
314
314
|
|
315
|
-
describe
|
316
|
-
it
|
317
|
-
put :update, :
|
315
|
+
describe 'with valid params' do
|
316
|
+
it 'updates the requested series_statement_merge_list' do
|
317
|
+
put :update, id: @series_statement_merge_list.id, series_statement_merge_list: @attrs
|
318
318
|
end
|
319
319
|
|
320
|
-
it
|
321
|
-
put :update, :
|
320
|
+
it 'assigns the requested series_statement_merge_list as @series_statement_merge_list' do
|
321
|
+
put :update, id: @series_statement_merge_list.id, series_statement_merge_list: @attrs
|
322
322
|
assigns(:series_statement_merge_list).should eq(@series_statement_merge_list)
|
323
323
|
response.should redirect_to(@series_statement_merge_list)
|
324
324
|
end
|
325
325
|
end
|
326
326
|
|
327
|
-
describe
|
328
|
-
it
|
329
|
-
put :update, :
|
327
|
+
describe 'with invalid params' do
|
328
|
+
it 'assigns the series_statement_merge_list as @series_statement_merge_list' do
|
329
|
+
put :update, id: @series_statement_merge_list.id, series_statement_merge_list: @invalid_attrs
|
330
330
|
assigns(:series_statement_merge_list).should_not be_valid
|
331
331
|
end
|
332
332
|
|
333
333
|
it "re-renders the 'edit' template" do
|
334
|
-
put :update, :
|
335
|
-
response.should render_template(
|
334
|
+
put :update, id: @series_statement_merge_list.id, series_statement_merge_list: @invalid_attrs
|
335
|
+
response.should render_template('edit')
|
336
336
|
end
|
337
337
|
end
|
338
338
|
end
|
339
339
|
|
340
|
-
describe
|
340
|
+
describe 'When logged in as User' do
|
341
341
|
login_user
|
342
342
|
|
343
|
-
describe
|
344
|
-
it
|
345
|
-
put :update, :
|
343
|
+
describe 'with valid params' do
|
344
|
+
it 'updates the requested series_statement_merge_list' do
|
345
|
+
put :update, id: @series_statement_merge_list.id, series_statement_merge_list: @attrs
|
346
346
|
end
|
347
347
|
|
348
|
-
it
|
349
|
-
put :update, :
|
348
|
+
it 'assigns the requested series_statement_merge_list as @series_statement_merge_list' do
|
349
|
+
put :update, id: @series_statement_merge_list.id, series_statement_merge_list: @attrs
|
350
350
|
assigns(:series_statement_merge_list).should eq(@series_statement_merge_list)
|
351
351
|
response.should be_forbidden
|
352
352
|
end
|
353
353
|
end
|
354
354
|
|
355
|
-
describe
|
356
|
-
it
|
357
|
-
put :update, :
|
355
|
+
describe 'with invalid params' do
|
356
|
+
it 'assigns the requested series_statement_merge_list as @series_statement_merge_list' do
|
357
|
+
put :update, id: @series_statement_merge_list.id, series_statement_merge_list: @invalid_attrs
|
358
358
|
response.should be_forbidden
|
359
359
|
end
|
360
360
|
end
|
361
361
|
end
|
362
362
|
|
363
|
-
describe
|
364
|
-
describe
|
365
|
-
it
|
366
|
-
put :update, :
|
363
|
+
describe 'When not logged in' do
|
364
|
+
describe 'with valid params' do
|
365
|
+
it 'updates the requested series_statement_merge_list' do
|
366
|
+
put :update, id: @series_statement_merge_list.id, series_statement_merge_list: @attrs
|
367
367
|
end
|
368
368
|
|
369
|
-
it
|
370
|
-
put :update, :
|
369
|
+
it 'should be forbidden' do
|
370
|
+
put :update, id: @series_statement_merge_list.id, series_statement_merge_list: @attrs
|
371
371
|
response.should redirect_to(new_user_session_url)
|
372
372
|
end
|
373
373
|
end
|
374
374
|
|
375
|
-
describe
|
376
|
-
it
|
377
|
-
put :update, :
|
375
|
+
describe 'with invalid params' do
|
376
|
+
it 'assigns the requested series_statement_merge_list as @series_statement_merge_list' do
|
377
|
+
put :update, id: @series_statement_merge_list.id, series_statement_merge_list: @invalid_attrs
|
378
378
|
response.should redirect_to(new_user_session_url)
|
379
379
|
end
|
380
380
|
end
|
381
381
|
end
|
382
382
|
end
|
383
383
|
|
384
|
-
describe
|
384
|
+
describe 'DELETE destroy' do
|
385
385
|
before(:each) do
|
386
386
|
@series_statement_merge_list = FactoryGirl.create(:series_statement_merge_list)
|
387
387
|
end
|
388
388
|
|
389
|
-
describe
|
389
|
+
describe 'When logged in as Administrator' do
|
390
390
|
login_admin
|
391
391
|
|
392
|
-
it
|
393
|
-
delete :destroy, :
|
392
|
+
it 'destroys the requested series_statement_merge_list' do
|
393
|
+
delete :destroy, id: @series_statement_merge_list.id
|
394
394
|
end
|
395
395
|
|
396
|
-
it
|
397
|
-
delete :destroy, :
|
396
|
+
it 'redirects to the series_statement_merge_lists list' do
|
397
|
+
delete :destroy, id: @series_statement_merge_list.id
|
398
398
|
response.should redirect_to(series_statement_merge_lists_url)
|
399
399
|
end
|
400
400
|
end
|
401
401
|
|
402
|
-
describe
|
402
|
+
describe 'When logged in as Librarian' do
|
403
403
|
login_librarian
|
404
404
|
|
405
|
-
it
|
406
|
-
delete :destroy, :
|
405
|
+
it 'destroys the requested series_statement_merge_list' do
|
406
|
+
delete :destroy, id: @series_statement_merge_list.id
|
407
407
|
end
|
408
408
|
|
409
|
-
it
|
410
|
-
delete :destroy, :
|
409
|
+
it 'redirects to the series_statement_merge_lists list' do
|
410
|
+
delete :destroy, id: @series_statement_merge_list.id
|
411
411
|
response.should redirect_to(series_statement_merge_lists_url)
|
412
412
|
end
|
413
413
|
end
|
414
414
|
|
415
|
-
describe
|
415
|
+
describe 'When logged in as User' do
|
416
416
|
login_user
|
417
417
|
|
418
|
-
it
|
419
|
-
delete :destroy, :
|
418
|
+
it 'destroys the requested series_statement_merge_list' do
|
419
|
+
delete :destroy, id: @series_statement_merge_list.id
|
420
420
|
end
|
421
421
|
|
422
|
-
it
|
423
|
-
delete :destroy, :
|
422
|
+
it 'should be forbidden' do
|
423
|
+
delete :destroy, id: @series_statement_merge_list.id
|
424
424
|
response.should be_forbidden
|
425
425
|
end
|
426
426
|
end
|
427
427
|
|
428
|
-
describe
|
429
|
-
it
|
430
|
-
delete :destroy, :
|
428
|
+
describe 'When not logged in' do
|
429
|
+
it 'destroys the requested series_statement_merge_list' do
|
430
|
+
delete :destroy, id: @series_statement_merge_list.id
|
431
431
|
end
|
432
432
|
|
433
|
-
it
|
434
|
-
delete :destroy, :
|
433
|
+
it 'should be forbidden' do
|
434
|
+
delete :destroy, id: @series_statement_merge_list.id
|
435
435
|
response.should redirect_to(new_user_session_url)
|
436
436
|
end
|
437
437
|
end
|