enju_biblio 0.1.0.pre56 → 0.1.0.pre57
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/agent_import_files_controller.rb +1 -1
- data/app/controllers/agent_import_results_controller.rb +30 -6
- data/app/controllers/agent_relationship_types_controller.rb +74 -4
- data/app/controllers/agent_relationships_controller.rb +92 -10
- data/app/controllers/agent_types_controller.rb +74 -3
- data/app/controllers/carrier_types_controller.rb +1 -1
- data/app/controllers/content_types_controller.rb +74 -4
- data/app/controllers/countries_controller.rb +66 -4
- data/app/controllers/create_types_controller.rb +74 -3
- data/app/controllers/extents_controller.rb +74 -4
- data/app/controllers/form_of_works_controller.rb +74 -4
- data/app/controllers/frequencies_controller.rb +74 -4
- data/app/controllers/identifier_types_controller.rb +4 -5
- data/app/controllers/import_requests_controller.rb +1 -1
- data/app/controllers/languages_controller.rb +66 -4
- data/app/controllers/licenses_controller.rb +74 -3
- data/app/controllers/manifestation_relationship_types_controller.rb +74 -3
- data/app/controllers/manifestation_relationships_controller.rb +92 -9
- data/app/controllers/medium_of_performances_controller.rb +74 -3
- data/app/controllers/picture_files_controller.rb +34 -10
- data/app/controllers/produce_types_controller.rb +74 -3
- data/app/controllers/realize_types_controller.rb +74 -3
- data/app/controllers/resource_import_files_controller.rb +2 -1
- data/app/controllers/resource_import_results_controller.rb +31 -11
- data/app/models/agent_import_file.rb +1 -1
- data/app/models/agent_import_result.rb +0 -2
- data/app/models/carrier_type.rb +1 -1
- data/app/models/identifier.rb +5 -0
- data/app/models/item.rb +1 -1
- data/app/models/manifestation.rb +13 -8
- data/app/models/resource_import_file.rb +73 -79
- data/app/views/agent_import_files/index.html.erb +1 -0
- data/app/views/agent_relationship_types/index.html.erb +5 -4
- data/app/views/agent_types/index.html.erb +5 -4
- data/app/views/carrier_types/index.html.erb +2 -1
- data/app/views/content_types/index.html.erb +1 -0
- data/app/views/countries/show.html.erb +5 -0
- data/app/views/create_types/index.html.erb +5 -4
- data/app/views/extents/index.html.erb +2 -1
- data/app/views/form_of_works/index.html.erb +2 -1
- data/app/views/frequencies/index.html.erb +2 -1
- data/app/views/identifier_types/index.html.erb +12 -5
- data/app/views/import_requests/index.html.erb +1 -0
- data/app/views/items/show.html.erb +3 -7
- data/app/views/languages/_form.html.erb +19 -4
- data/app/views/languages/index.html.erb +6 -5
- data/app/views/languages/show.html.erb +19 -4
- data/app/views/layouts/manifestations.html.erb +2 -1
- data/app/views/licenses/index.html.erb +2 -1
- data/app/views/manifestation_relationship_types/index.html.erb +5 -4
- data/app/views/manifestations/_call_number.html.erb +1 -1
- data/app/views/manifestations/_edit_detail.html.erb +4 -1
- data/app/views/manifestations/_form.html.erb +5 -5
- data/app/views/manifestations/_show_detail_librarian.html.erb +8 -3
- data/app/views/manifestations/_show_detail_user.html.erb +8 -3
- data/app/views/medium_of_performances/index.html.erb +2 -1
- data/app/views/notifier/manifestation_info.en.text.erb +1 -1
- data/app/views/notifier/manifestation_info.ja.text.erb +1 -1
- data/app/views/picture_files/_index.html.erb +1 -0
- data/app/views/picture_files/_index_agent.html.erb +1 -0
- data/app/views/picture_files/_index_manifestation.html.erb +1 -0
- data/app/views/picture_files/show.html.erb +15 -7
- data/app/views/produce_types/index.html.erb +5 -4
- data/app/views/realize_types/index.html.erb +5 -4
- data/app/views/resource_import_files/index.html.erb +1 -0
- data/app/views/series_statements/_index.html.erb +1 -0
- data/app/views/series_statements/_index_series_statement_merge_list.html.erb +1 -0
- data/config/locales/translation_en.yml +70 -1
- data/config/locales/translation_ja.yml +77 -8
- data/db/migrate/20140817155043_add_extent_of_text_to_manifestation.rb +5 -0
- data/lib/enju_biblio/biblio_helper.rb +13 -0
- data/lib/enju_biblio/engine.rb +0 -2
- data/lib/enju_biblio/version.rb +1 -1
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/content_types.yml +1 -1
- data/lib/generators/enju_biblio/setup/templates/db/fixtures/identifier_types.yml +24 -3
- data/lib/tasks/enju_biblio_tasks.rake +2 -0
- data/lib/tasks/identifier_type.rb +12 -0
- data/lib/tasks/item.rb +1 -1
- data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_send_message_when_import_is_completed.yml +433 -0
- data/spec/controllers/agent_import_files_controller_spec.rb +35 -35
- data/spec/controllers/agent_import_results_controller_spec.rb +11 -11
- data/spec/controllers/agent_relationship_types_controller_spec.rb +51 -51
- data/spec/controllers/agent_relationships_controller_spec.rb +53 -53
- data/spec/controllers/agent_types_controller_spec.rb +15 -15
- data/spec/controllers/agents_controller_spec.rb +96 -96
- data/spec/controllers/carrier_types_controller_spec.rb +15 -15
- data/spec/controllers/content_types_controller_spec.rb +15 -15
- data/spec/controllers/countries_controller_spec.rb +25 -25
- data/spec/controllers/create_types_controller_spec.rb +15 -15
- data/spec/controllers/creates_controller_spec.rb +50 -50
- data/spec/controllers/donates_controller_spec.rb +49 -49
- data/spec/controllers/extents_controller_spec.rb +15 -15
- data/spec/controllers/form_of_works_controller_spec.rb +15 -15
- data/spec/controllers/frequencies_controller_spec.rb +6 -6
- data/spec/controllers/identifier_types_controller_spec.rb +15 -15
- data/spec/controllers/import_requests_controller_spec.rb +50 -50
- data/spec/controllers/items_controller_spec.rb +72 -72
- data/spec/controllers/languages_controller_spec.rb +18 -18
- data/spec/controllers/licenses_controller_spec.rb +15 -15
- data/spec/controllers/manifestation_relationship_types_controller_spec.rb +51 -51
- data/spec/controllers/manifestation_relationships_controller_spec.rb +53 -53
- data/spec/controllers/manifestations_controller_spec.rb +108 -108
- data/spec/controllers/medium_of_performances_controller_spec.rb +15 -15
- data/spec/controllers/owns_controller_spec.rb +52 -52
- data/spec/controllers/picture_files_controller_spec.rb +52 -52
- data/spec/controllers/produce_types_controller_spec.rb +15 -15
- data/spec/controllers/produces_controller_spec.rb +50 -50
- data/spec/controllers/realize_types_controller_spec.rb +15 -15
- data/spec/controllers/realizes_controller_spec.rb +51 -51
- data/spec/controllers/resource_export_files_controller_spec.rb +38 -38
- data/spec/controllers/resource_import_files_controller_spec.rb +38 -38
- data/spec/controllers/resource_import_results_controller_spec.rb +15 -15
- data/spec/controllers/series_statements_controller_spec.rb +54 -54
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +2 -3
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/resource_import_file_sample1.tsv +19 -19
- data/spec/dummy/private/system/resource_import_files/resource_imports/000/000/004/original/resource_import_file_sample2.tsv +19 -19
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-53863-1jz1wlr.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-55246-1rvhs1s.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-60268-1psjqua.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-60996-1cy28m2.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-67507-19qjhj3.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-69234-1cllrec.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140818-76875-1os6joy.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-1148-136brhb.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-473-1c326dm.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-93795-1x882ik.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-94274-1xr9d9e.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-94643-1fjcept.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-97947-mfqh5b.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-98488-126cvb4.txt +147 -0
- data/spec/dummy/public/system/resource_export_files/resource_exports/000/000/004/original/resource_export_file_20140819-98849-1lg47mm.txt +147 -0
- data/spec/dummy/solr/test/data/index/segments.gen +0 -0
- data/spec/dummy/solr/test/data/index/segments_5ur +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007580 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007581 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007582 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007583 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007584 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000007585 +0 -0
- data/spec/dummy/tmp/cache/ACB/B20/manifestation_search_total +0 -0
- data/spec/dummy/tmp/cache/stdout +2554 -0
- data/spec/dummy/tmp/pids/redis-test.pid +1 -1
- data/spec/fixtures/agent_import_results.yml +0 -3
- data/spec/fixtures/carrier_types.yml +16 -16
- data/spec/fixtures/content_types.yml +78 -29
- data/spec/fixtures/frequencies.yml +32 -62
- data/spec/fixtures/manifestations.yml +1 -1
- data/spec/models/agent_import_result_spec.rb +0 -2
- data/spec/models/manifestation_spec.rb +1 -1
- data/spec/models/resource_import_file_spec.rb +30 -3
- data/spec/views/manifestations/show.html.erb_spec.rb +1 -1
- metadata +68 -103
- data/app/views/picture_files/_index_event.html.erb +0 -53
- data/app/views/picture_files/_index_shelf.html.erb +0 -53
- data/db/migrate/20121116033446_add_doi_to_manifestation.rb +0 -6
- data/spec/dummy/solr/test/data/index/_20i.fdt +0 -0
- data/spec/dummy/solr/test/data/index/_20i.fdx +0 -0
- data/spec/dummy/solr/test/data/index/_20i.fnm +0 -0
- data/spec/dummy/solr/test/data/index/_20i.nvd +0 -0
- data/spec/dummy/solr/test/data/index/_20i.nvm +0 -0
- data/spec/dummy/solr/test/data/index/_20i.si +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/test/data/index/_20i_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/test/data/index/_20j.fdt +0 -0
- data/spec/dummy/solr/test/data/index/_20j.fdx +0 -0
- data/spec/dummy/solr/test/data/index/_20j.fnm +0 -0
- data/spec/dummy/solr/test/data/index/_20j.nvd +0 -0
- data/spec/dummy/solr/test/data/index/_20j.nvm +0 -0
- data/spec/dummy/solr/test/data/index/_20j.si +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/test/data/index/_20j_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/test/data/index/_20k.fdt +0 -0
- data/spec/dummy/solr/test/data/index/_20k.fdx +0 -0
- data/spec/dummy/solr/test/data/index/_20k.fnm +0 -0
- data/spec/dummy/solr/test/data/index/_20k.nvd +0 -0
- data/spec/dummy/solr/test/data/index/_20k.nvm +0 -0
- data/spec/dummy/solr/test/data/index/_20k.si +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.doc +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.pos +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.tim +0 -0
- data/spec/dummy/solr/test/data/index/_20k_Lucene41_0.tip +0 -0
- data/spec/dummy/solr/test/data/index/segments_2uc +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000003680 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000003681 +0 -0
- data/spec/dummy/solr/test/data/tlog/tlog.0000000000000003682 +0 -0
@@ -15,7 +15,7 @@ describe ProducesController do
|
|
15
15
|
|
16
16
|
it "assigns all produces as @produces" do
|
17
17
|
get :index
|
18
|
-
assigns(:produces).
|
18
|
+
expect(assigns(:produces)).to eq(Produce.page(1))
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -24,7 +24,7 @@ describe ProducesController do
|
|
24
24
|
|
25
25
|
it "assigns all produces as @produces" do
|
26
26
|
get :index
|
27
|
-
assigns(:produces).
|
27
|
+
expect(assigns(:produces)).to eq(Produce.page(1))
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
@@ -33,14 +33,14 @@ describe ProducesController do
|
|
33
33
|
|
34
34
|
it "assigns all produces as @produces" do
|
35
35
|
get :index
|
36
|
-
assigns(:produces).
|
36
|
+
expect(assigns(:produces)).to eq(Produce.page(1))
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
40
|
describe "When not logged in" do
|
41
41
|
it "assigns all produces as @produces" do
|
42
42
|
get :index
|
43
|
-
assigns(:produces).
|
43
|
+
expect(assigns(:produces)).to eq(Produce.page(1))
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -52,7 +52,7 @@ describe ProducesController do
|
|
52
52
|
it "assigns the requested produce as @produce" do
|
53
53
|
produce = FactoryGirl.create(:produce)
|
54
54
|
get :show, :id => produce.id
|
55
|
-
assigns(:produce).
|
55
|
+
expect(assigns(:produce)).to eq(produce)
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -62,7 +62,7 @@ describe ProducesController do
|
|
62
62
|
it "assigns the requested produce as @produce" do
|
63
63
|
produce = FactoryGirl.create(:produce)
|
64
64
|
get :show, :id => produce.id
|
65
|
-
assigns(:produce).
|
65
|
+
expect(assigns(:produce)).to eq(produce)
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
@@ -72,7 +72,7 @@ describe ProducesController do
|
|
72
72
|
it "assigns the requested produce as @produce" do
|
73
73
|
produce = FactoryGirl.create(:produce)
|
74
74
|
get :show, :id => produce.id
|
75
|
-
assigns(:produce).
|
75
|
+
expect(assigns(:produce)).to eq(produce)
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
@@ -80,7 +80,7 @@ describe ProducesController do
|
|
80
80
|
it "assigns the requested produce as @produce" do
|
81
81
|
produce = FactoryGirl.create(:produce)
|
82
82
|
get :show, :id => produce.id
|
83
|
-
assigns(:produce).
|
83
|
+
expect(assigns(:produce)).to eq(produce)
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|
@@ -91,7 +91,7 @@ describe ProducesController do
|
|
91
91
|
|
92
92
|
it "assigns the requested produce as @produce" do
|
93
93
|
get :new
|
94
|
-
assigns(:produce).
|
94
|
+
expect(assigns(:produce)).not_to be_valid
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
@@ -100,7 +100,7 @@ describe ProducesController do
|
|
100
100
|
|
101
101
|
it "assigns the requested produce as @produce" do
|
102
102
|
get :new
|
103
|
-
assigns(:produce).
|
103
|
+
expect(assigns(:produce)).not_to be_valid
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
@@ -109,16 +109,16 @@ describe ProducesController do
|
|
109
109
|
|
110
110
|
it "should not assign the requested produce as @produce" do
|
111
111
|
get :new
|
112
|
-
assigns(:produce).
|
113
|
-
response.
|
112
|
+
expect(assigns(:produce)).not_to be_valid
|
113
|
+
expect(response).to be_forbidden
|
114
114
|
end
|
115
115
|
end
|
116
116
|
|
117
117
|
describe "When not logged in" do
|
118
118
|
it "should not assign the requested produce as @produce" do
|
119
119
|
get :new
|
120
|
-
assigns(:produce).
|
121
|
-
response.
|
120
|
+
expect(assigns(:produce)).not_to be_valid
|
121
|
+
expect(response).to redirect_to(new_user_session_url)
|
122
122
|
end
|
123
123
|
end
|
124
124
|
end
|
@@ -130,7 +130,7 @@ describe ProducesController do
|
|
130
130
|
it "assigns the requested produce as @produce" do
|
131
131
|
produce = FactoryGirl.create(:produce)
|
132
132
|
get :edit, :id => produce.id
|
133
|
-
assigns(:produce).
|
133
|
+
expect(assigns(:produce)).to eq(produce)
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
@@ -140,7 +140,7 @@ describe ProducesController do
|
|
140
140
|
it "assigns the requested produce as @produce" do
|
141
141
|
produce = FactoryGirl.create(:produce)
|
142
142
|
get :edit, :id => produce.id
|
143
|
-
assigns(:produce).
|
143
|
+
expect(assigns(:produce)).to eq(produce)
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
@@ -150,7 +150,7 @@ describe ProducesController do
|
|
150
150
|
it "assigns the requested produce as @produce" do
|
151
151
|
produce = FactoryGirl.create(:produce)
|
152
152
|
get :edit, :id => produce.id
|
153
|
-
response.
|
153
|
+
expect(response).to be_forbidden
|
154
154
|
end
|
155
155
|
end
|
156
156
|
|
@@ -158,7 +158,7 @@ describe ProducesController do
|
|
158
158
|
it "should not assign the requested produce as @produce" do
|
159
159
|
produce = FactoryGirl.create(:produce)
|
160
160
|
get :edit, :id => produce.id
|
161
|
-
response.
|
161
|
+
expect(response).to redirect_to(new_user_session_url)
|
162
162
|
end
|
163
163
|
end
|
164
164
|
end
|
@@ -175,24 +175,24 @@ describe ProducesController do
|
|
175
175
|
describe "with valid params" do
|
176
176
|
it "assigns a newly created produce as @produce" do
|
177
177
|
post :create, :produce => @attrs
|
178
|
-
assigns(:produce).
|
178
|
+
expect(assigns(:produce)).to be_valid
|
179
179
|
end
|
180
180
|
|
181
181
|
it "redirects to the created produce" do
|
182
182
|
post :create, :produce => @attrs
|
183
|
-
response.
|
183
|
+
expect(response).to redirect_to(produce_url(assigns(:produce)))
|
184
184
|
end
|
185
185
|
end
|
186
186
|
|
187
187
|
describe "with invalid params" do
|
188
188
|
it "assigns a newly created but unsaved produce as @produce" do
|
189
189
|
post :create, :produce => @invalid_attrs
|
190
|
-
assigns(:produce).
|
190
|
+
expect(assigns(:produce)).not_to be_valid
|
191
191
|
end
|
192
192
|
|
193
193
|
it "re-renders the 'new' template" do
|
194
194
|
post :create, :produce => @invalid_attrs
|
195
|
-
response.
|
195
|
+
expect(response).to render_template("new")
|
196
196
|
end
|
197
197
|
end
|
198
198
|
end
|
@@ -203,24 +203,24 @@ describe ProducesController do
|
|
203
203
|
describe "with valid params" do
|
204
204
|
it "assigns a newly created produce as @produce" do
|
205
205
|
post :create, :produce => @attrs
|
206
|
-
assigns(:produce).
|
206
|
+
expect(assigns(:produce)).to be_valid
|
207
207
|
end
|
208
208
|
|
209
209
|
it "redirects to the created produce" do
|
210
210
|
post :create, :produce => @attrs
|
211
|
-
response.
|
211
|
+
expect(response).to redirect_to(produce_url(assigns(:produce)))
|
212
212
|
end
|
213
213
|
end
|
214
214
|
|
215
215
|
describe "with invalid params" do
|
216
216
|
it "assigns a newly created but unsaved produce as @produce" do
|
217
217
|
post :create, :produce => @invalid_attrs
|
218
|
-
assigns(:produce).
|
218
|
+
expect(assigns(:produce)).not_to be_valid
|
219
219
|
end
|
220
220
|
|
221
221
|
it "re-renders the 'new' template" do
|
222
222
|
post :create, :produce => @invalid_attrs
|
223
|
-
response.
|
223
|
+
expect(response).to render_template("new")
|
224
224
|
end
|
225
225
|
end
|
226
226
|
end
|
@@ -231,24 +231,24 @@ describe ProducesController do
|
|
231
231
|
describe "with valid params" do
|
232
232
|
it "assigns a newly created produce as @produce" do
|
233
233
|
post :create, :produce => @attrs
|
234
|
-
assigns(:produce).
|
234
|
+
expect(assigns(:produce)).to be_valid
|
235
235
|
end
|
236
236
|
|
237
237
|
it "should be forbidden" do
|
238
238
|
post :create, :produce => @attrs
|
239
|
-
response.
|
239
|
+
expect(response).to be_forbidden
|
240
240
|
end
|
241
241
|
end
|
242
242
|
|
243
243
|
describe "with invalid params" do
|
244
244
|
it "assigns a newly created but unsaved produce as @produce" do
|
245
245
|
post :create, :produce => @invalid_attrs
|
246
|
-
assigns(:produce).
|
246
|
+
expect(assigns(:produce)).not_to be_valid
|
247
247
|
end
|
248
248
|
|
249
249
|
it "should be forbidden" do
|
250
250
|
post :create, :produce => @invalid_attrs
|
251
|
-
response.
|
251
|
+
expect(response).to be_forbidden
|
252
252
|
end
|
253
253
|
end
|
254
254
|
end
|
@@ -257,24 +257,24 @@ describe ProducesController do
|
|
257
257
|
describe "with valid params" do
|
258
258
|
it "assigns a newly created produce as @produce" do
|
259
259
|
post :create, :produce => @attrs
|
260
|
-
assigns(:produce).
|
260
|
+
expect(assigns(:produce)).to be_valid
|
261
261
|
end
|
262
262
|
|
263
263
|
it "should be forbidden" do
|
264
264
|
post :create, :produce => @attrs
|
265
|
-
response.
|
265
|
+
expect(response).to redirect_to(new_user_session_url)
|
266
266
|
end
|
267
267
|
end
|
268
268
|
|
269
269
|
describe "with invalid params" do
|
270
270
|
it "assigns a newly created but unsaved produce as @produce" do
|
271
271
|
post :create, :produce => @invalid_attrs
|
272
|
-
assigns(:produce).
|
272
|
+
expect(assigns(:produce)).not_to be_valid
|
273
273
|
end
|
274
274
|
|
275
275
|
it "should be forbidden" do
|
276
276
|
post :create, :produce => @invalid_attrs
|
277
|
-
response.
|
277
|
+
expect(response).to redirect_to(new_user_session_url)
|
278
278
|
end
|
279
279
|
end
|
280
280
|
end
|
@@ -297,14 +297,14 @@ describe ProducesController do
|
|
297
297
|
|
298
298
|
it "assigns the requested produce as @produce" do
|
299
299
|
put :update, :id => @produce.id, :produce => @attrs
|
300
|
-
assigns(:produce).
|
300
|
+
expect(assigns(:produce)).to eq(@produce)
|
301
301
|
end
|
302
302
|
end
|
303
303
|
|
304
304
|
describe "with invalid params" do
|
305
305
|
it "assigns the requested produce as @produce" do
|
306
306
|
put :update, :id => @produce.id, :produce => @invalid_attrs
|
307
|
-
response.
|
307
|
+
expect(response).to render_template("edit")
|
308
308
|
end
|
309
309
|
end
|
310
310
|
end
|
@@ -319,14 +319,14 @@ describe ProducesController do
|
|
319
319
|
|
320
320
|
it "assigns the requested produce as @produce" do
|
321
321
|
put :update, :id => @produce.id, :produce => @attrs
|
322
|
-
assigns(:produce).
|
323
|
-
response.
|
322
|
+
expect(assigns(:produce)).to eq(@produce)
|
323
|
+
expect(response).to redirect_to(@produce)
|
324
324
|
end
|
325
325
|
|
326
326
|
it "moves its position when specified" do
|
327
327
|
position = @produce.position
|
328
328
|
put :update, :id => @produce.id, :manifestation_id => @produce.manifestation.id, :move => 'lower'
|
329
|
-
response.
|
329
|
+
expect(response).to redirect_to produces_url(manifestation_id: @produce.manifestation_id)
|
330
330
|
assigns(:produce).position.should eq position + 1
|
331
331
|
end
|
332
332
|
end
|
@@ -334,12 +334,12 @@ describe ProducesController do
|
|
334
334
|
describe "with invalid params" do
|
335
335
|
it "assigns the produce as @produce" do
|
336
336
|
put :update, :id => @produce, :produce => @invalid_attrs
|
337
|
-
assigns(:produce).
|
337
|
+
expect(assigns(:produce)).not_to be_valid
|
338
338
|
end
|
339
339
|
|
340
340
|
it "re-renders the 'edit' template" do
|
341
341
|
put :update, :id => @produce, :produce => @invalid_attrs
|
342
|
-
response.
|
342
|
+
expect(response).to render_template("edit")
|
343
343
|
end
|
344
344
|
end
|
345
345
|
end
|
@@ -354,15 +354,15 @@ describe ProducesController do
|
|
354
354
|
|
355
355
|
it "assigns the requested produce as @produce" do
|
356
356
|
put :update, :id => @produce.id, :produce => @attrs
|
357
|
-
assigns(:produce).
|
358
|
-
response.
|
357
|
+
expect(assigns(:produce)).to eq(@produce)
|
358
|
+
expect(response).to be_forbidden
|
359
359
|
end
|
360
360
|
end
|
361
361
|
|
362
362
|
describe "with invalid params" do
|
363
363
|
it "assigns the requested produce as @produce" do
|
364
364
|
put :update, :id => @produce.id, :produce => @invalid_attrs
|
365
|
-
response.
|
365
|
+
expect(response).to be_forbidden
|
366
366
|
end
|
367
367
|
end
|
368
368
|
end
|
@@ -375,14 +375,14 @@ describe ProducesController do
|
|
375
375
|
|
376
376
|
it "should be forbidden" do
|
377
377
|
put :update, :id => @produce.id, :produce => @attrs
|
378
|
-
response.
|
378
|
+
expect(response).to redirect_to(new_user_session_url)
|
379
379
|
end
|
380
380
|
end
|
381
381
|
|
382
382
|
describe "with invalid params" do
|
383
383
|
it "assigns the requested produce as @produce" do
|
384
384
|
put :update, :id => @produce.id, :produce => @invalid_attrs
|
385
|
-
response.
|
385
|
+
expect(response).to redirect_to(new_user_session_url)
|
386
386
|
end
|
387
387
|
end
|
388
388
|
end
|
@@ -402,7 +402,7 @@ describe ProducesController do
|
|
402
402
|
|
403
403
|
it "redirects to the produces list" do
|
404
404
|
delete :destroy, :id => @produce.id
|
405
|
-
response.
|
405
|
+
expect(response).to redirect_to(produces_url)
|
406
406
|
end
|
407
407
|
end
|
408
408
|
|
@@ -415,7 +415,7 @@ describe ProducesController do
|
|
415
415
|
|
416
416
|
it "should be forbidden" do
|
417
417
|
delete :destroy, :id => @produce.id
|
418
|
-
response.
|
418
|
+
expect(response).to redirect_to(produces_url)
|
419
419
|
end
|
420
420
|
end
|
421
421
|
|
@@ -428,7 +428,7 @@ describe ProducesController do
|
|
428
428
|
|
429
429
|
it "should be forbidden" do
|
430
430
|
delete :destroy, :id => @produce.id
|
431
|
-
response.
|
431
|
+
expect(response).to be_forbidden
|
432
432
|
end
|
433
433
|
end
|
434
434
|
|
@@ -439,7 +439,7 @@ describe ProducesController do
|
|
439
439
|
|
440
440
|
it "should be forbidden" do
|
441
441
|
delete :destroy, :id => @produce.id
|
442
|
-
response.
|
442
|
+
expect(response).to redirect_to(new_user_session_url)
|
443
443
|
end
|
444
444
|
end
|
445
445
|
end
|
@@ -33,7 +33,7 @@ describe RealizeTypesController do
|
|
33
33
|
it "assigns all realize_types as @realize_types" do
|
34
34
|
realize_type = RealizeType.create! valid_attributes
|
35
35
|
get :index
|
36
|
-
assigns(:realize_types).
|
36
|
+
expect(assigns(:realize_types)).to eq(RealizeType.all)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -41,14 +41,14 @@ describe RealizeTypesController do
|
|
41
41
|
it "assigns the requested realize_type as @realize_type" do
|
42
42
|
realize_type = RealizeType.create! valid_attributes
|
43
43
|
get :show, :id => realize_type.id
|
44
|
-
assigns(:realize_type).
|
44
|
+
expect(assigns(:realize_type)).to eq(realize_type)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
48
|
describe "GET new" do
|
49
49
|
it "assigns a new realize_type as @realize_type" do
|
50
50
|
get :new
|
51
|
-
assigns(:realize_type).
|
51
|
+
expect(assigns(:realize_type)).to be_a_new(RealizeType)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -56,7 +56,7 @@ describe RealizeTypesController do
|
|
56
56
|
it "assigns the requested realize_type as @realize_type" do
|
57
57
|
realize_type = RealizeType.create! valid_attributes
|
58
58
|
get :edit, :id => realize_type.id
|
59
|
-
assigns(:realize_type).
|
59
|
+
expect(assigns(:realize_type)).to eq(realize_type)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -70,13 +70,13 @@ describe RealizeTypesController do
|
|
70
70
|
|
71
71
|
it "assigns a newly created realize_type as @realize_type" do
|
72
72
|
post :create, :realize_type => valid_attributes
|
73
|
-
assigns(:realize_type).
|
74
|
-
assigns(:realize_type).
|
73
|
+
expect(assigns(:realize_type)).to be_a(RealizeType)
|
74
|
+
expect(assigns(:realize_type)).to be_persisted
|
75
75
|
end
|
76
76
|
|
77
77
|
it "redirects to the created realize_type" do
|
78
78
|
post :create, :realize_type => valid_attributes
|
79
|
-
response.
|
79
|
+
expect(response).to redirect_to(RealizeType.last)
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
@@ -85,14 +85,14 @@ describe RealizeTypesController do
|
|
85
85
|
# Trigger the behavior that occurs when invalid params are submitted
|
86
86
|
RealizeType.any_instance.stub(:save).and_return(false)
|
87
87
|
post :create, :realize_type => {}
|
88
|
-
assigns(:realize_type).
|
88
|
+
expect(assigns(:realize_type)).to be_a_new(RealizeType)
|
89
89
|
end
|
90
90
|
|
91
91
|
it "re-renders the 'new' template" do
|
92
92
|
# Trigger the behavior that occurs when invalid params are submitted
|
93
93
|
RealizeType.any_instance.stub(:save).and_return(false)
|
94
94
|
post :create, :realize_type => {}
|
95
|
-
#response.
|
95
|
+
#expect(response).to render_template("new")
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end
|
@@ -112,20 +112,20 @@ describe RealizeTypesController do
|
|
112
112
|
it "assigns the requested realize_type as @realize_type" do
|
113
113
|
realize_type = RealizeType.create! valid_attributes
|
114
114
|
put :update, :id => realize_type.id, :realize_type => valid_attributes
|
115
|
-
assigns(:realize_type).
|
115
|
+
expect(assigns(:realize_type)).to eq(realize_type)
|
116
116
|
end
|
117
117
|
|
118
118
|
it "redirects to the realize_type" do
|
119
119
|
realize_type = RealizeType.create! valid_attributes
|
120
120
|
put :update, :id => realize_type.id, :realize_type => valid_attributes
|
121
|
-
response.
|
121
|
+
expect(response).to redirect_to(realize_type)
|
122
122
|
end
|
123
123
|
|
124
124
|
it "moves its position when specified" do
|
125
125
|
realize_type = RealizeType.create! valid_attributes
|
126
126
|
position = realize_type.position
|
127
127
|
put :update, :id => realize_type.id, :move => 'higher'
|
128
|
-
response.
|
128
|
+
expect(response).to redirect_to realize_types_url
|
129
129
|
assigns(:realize_type).position.should eq position - 1
|
130
130
|
end
|
131
131
|
end
|
@@ -136,7 +136,7 @@ describe RealizeTypesController do
|
|
136
136
|
# Trigger the behavior that occurs when invalid params are submitted
|
137
137
|
RealizeType.any_instance.stub(:save).and_return(false)
|
138
138
|
put :update, :id => realize_type.id, :realize_type => {}
|
139
|
-
assigns(:realize_type).
|
139
|
+
expect(assigns(:realize_type)).to eq(realize_type)
|
140
140
|
end
|
141
141
|
|
142
142
|
it "re-renders the 'edit' template" do
|
@@ -144,7 +144,7 @@ describe RealizeTypesController do
|
|
144
144
|
# Trigger the behavior that occurs when invalid params are submitted
|
145
145
|
RealizeType.any_instance.stub(:save).and_return(false)
|
146
146
|
put :update, :id => realize_type.id, :realize_type => {}
|
147
|
-
#response.
|
147
|
+
#expect(response).to render_template("edit")
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|
@@ -160,7 +160,7 @@ describe RealizeTypesController do
|
|
160
160
|
it "redirects to the realize_types list" do
|
161
161
|
realize_type = RealizeType.create! valid_attributes
|
162
162
|
delete :destroy, :id => realize_type.id
|
163
|
-
response.
|
163
|
+
expect(response).to redirect_to(realize_types_url)
|
164
164
|
end
|
165
165
|
end
|
166
166
|
|