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
@@ -11,7 +11,7 @@ describe PictureFilesController do
|
|
11
11
|
|
12
12
|
it "assigns all picture_files as @picture_files" do
|
13
13
|
get :index
|
14
|
-
assigns(:picture_files).
|
14
|
+
expect(assigns(:picture_files)).to eq(PictureFile.all)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -20,7 +20,7 @@ describe PictureFilesController do
|
|
20
20
|
|
21
21
|
it "assigns all picture_files as @picture_files" do
|
22
22
|
get :index
|
23
|
-
assigns(:picture_files).
|
23
|
+
expect(assigns(:picture_files)).to eq(PictureFile.all)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -29,14 +29,14 @@ describe PictureFilesController do
|
|
29
29
|
|
30
30
|
it "assigns all picture_files as @picture_files" do
|
31
31
|
get :index
|
32
|
-
assigns(:picture_files).
|
32
|
+
expect(assigns(:picture_files)).to eq(PictureFile.all)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
describe "When not logged in" do
|
37
37
|
it "assigns all picture_files as @picture_files" do
|
38
38
|
get :index
|
39
|
-
assigns(:picture_files).
|
39
|
+
expect(assigns(:picture_files)).to eq(PictureFile.all)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -48,7 +48,7 @@ describe PictureFilesController do
|
|
48
48
|
it "assigns the requested picture_file as @picture_file" do
|
49
49
|
picture_file = PictureFile.find(1)
|
50
50
|
get :show, :id => picture_file.id
|
51
|
-
assigns(:picture_file).
|
51
|
+
expect(assigns(:picture_file)).to eq(picture_file)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -58,7 +58,7 @@ describe PictureFilesController do
|
|
58
58
|
it "assigns the requested picture_file as @picture_file" do
|
59
59
|
picture_file = PictureFile.find(1)
|
60
60
|
get :show, :id => picture_file.id
|
61
|
-
assigns(:picture_file).
|
61
|
+
expect(assigns(:picture_file)).to eq(picture_file)
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
@@ -68,7 +68,7 @@ describe PictureFilesController do
|
|
68
68
|
it "assigns the requested picture_file as @picture_file" do
|
69
69
|
picture_file = PictureFile.find(1)
|
70
70
|
get :show, :id => picture_file.id
|
71
|
-
assigns(:picture_file).
|
71
|
+
expect(assigns(:picture_file)).to eq(picture_file)
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
@@ -76,7 +76,7 @@ describe PictureFilesController do
|
|
76
76
|
it "assigns the requested picture_file as @picture_file" do
|
77
77
|
picture_file = PictureFile.find(1)
|
78
78
|
get :show, :id => picture_file.id
|
79
|
-
assigns(:picture_file).
|
79
|
+
expect(assigns(:picture_file)).to eq(picture_file)
|
80
80
|
end
|
81
81
|
end
|
82
82
|
end
|
@@ -87,8 +87,8 @@ describe PictureFilesController do
|
|
87
87
|
|
88
88
|
it "assigns the requested picture_file as @picture_file" do
|
89
89
|
get :new
|
90
|
-
assigns(:picture_file).
|
91
|
-
response.
|
90
|
+
expect(assigns(:picture_file)).not_to be_valid
|
91
|
+
expect(response).to redirect_to picture_files_url
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
@@ -97,8 +97,8 @@ describe PictureFilesController do
|
|
97
97
|
|
98
98
|
it "assigns the requested picture_file as @picture_file" do
|
99
99
|
get :new
|
100
|
-
assigns(:picture_file).
|
101
|
-
response.
|
100
|
+
expect(assigns(:picture_file)).not_to be_valid
|
101
|
+
expect(response).to redirect_to picture_files_url
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
@@ -107,16 +107,16 @@ describe PictureFilesController do
|
|
107
107
|
|
108
108
|
it "should not assign the requested picture_file as @picture_file" do
|
109
109
|
get :new
|
110
|
-
assigns(:picture_file).
|
111
|
-
response.
|
110
|
+
expect(assigns(:picture_file)).not_to be_valid
|
111
|
+
expect(response).to be_forbidden
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
115
|
describe "When not logged in" do
|
116
116
|
it "should not assign the requested picture_file as @picture_file" do
|
117
117
|
get :new
|
118
|
-
assigns(:picture_file).
|
119
|
-
response.
|
118
|
+
expect(assigns(:picture_file)).not_to be_valid
|
119
|
+
expect(response).to redirect_to(new_user_session_url)
|
120
120
|
end
|
121
121
|
end
|
122
122
|
end
|
@@ -128,7 +128,7 @@ describe PictureFilesController do
|
|
128
128
|
it "assigns the requested picture_file as @picture_file" do
|
129
129
|
picture_file = PictureFile.find(1)
|
130
130
|
get :edit, :id => picture_file.id
|
131
|
-
assigns(:picture_file).
|
131
|
+
expect(assigns(:picture_file)).to eq(picture_file)
|
132
132
|
end
|
133
133
|
end
|
134
134
|
|
@@ -138,7 +138,7 @@ describe PictureFilesController do
|
|
138
138
|
it "assigns the requested picture_file as @picture_file" do
|
139
139
|
picture_file = PictureFile.find(1)
|
140
140
|
get :edit, :id => picture_file.id
|
141
|
-
assigns(:picture_file).
|
141
|
+
expect(assigns(:picture_file)).to eq(picture_file)
|
142
142
|
end
|
143
143
|
end
|
144
144
|
|
@@ -148,7 +148,7 @@ describe PictureFilesController do
|
|
148
148
|
it "assigns the requested picture_file as @picture_file" do
|
149
149
|
picture_file = PictureFile.find(1)
|
150
150
|
get :edit, :id => picture_file.id
|
151
|
-
response.
|
151
|
+
expect(response).to be_forbidden
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
@@ -156,7 +156,7 @@ describe PictureFilesController do
|
|
156
156
|
it "should not assign the requested picture_file as @picture_file" do
|
157
157
|
picture_file = PictureFile.find(1)
|
158
158
|
get :edit, :id => picture_file.id
|
159
|
-
response.
|
159
|
+
expect(response).to redirect_to(new_user_session_url)
|
160
160
|
end
|
161
161
|
end
|
162
162
|
end
|
@@ -173,24 +173,24 @@ describe PictureFilesController do
|
|
173
173
|
describe "with valid params" do
|
174
174
|
it "assigns a newly created picture_file as @picture_file" do
|
175
175
|
post :create, :picture_file => @attrs
|
176
|
-
assigns(:picture_file).
|
176
|
+
expect(assigns(:picture_file)).to be_valid
|
177
177
|
end
|
178
178
|
|
179
179
|
it "redirects to the created picture_file" do
|
180
180
|
post :create, :picture_file => @attrs
|
181
|
-
response.
|
181
|
+
expect(response).to redirect_to(picture_file_url(assigns(:picture_file)))
|
182
182
|
end
|
183
183
|
end
|
184
184
|
|
185
185
|
describe "with invalid params" do
|
186
186
|
it "assigns a newly created but unsaved picture_file as @picture_file" do
|
187
187
|
post :create, :picture_file => @invalid_attrs
|
188
|
-
assigns(:picture_file).
|
188
|
+
expect(assigns(:picture_file)).not_to be_valid
|
189
189
|
end
|
190
190
|
|
191
191
|
it "re-renders the 'new' template" do
|
192
192
|
post :create, :picture_file => @invalid_attrs
|
193
|
-
response.
|
193
|
+
expect(response).to render_template("new")
|
194
194
|
end
|
195
195
|
end
|
196
196
|
end
|
@@ -201,24 +201,24 @@ describe PictureFilesController do
|
|
201
201
|
describe "with valid params" do
|
202
202
|
it "assigns a newly created picture_file as @picture_file" do
|
203
203
|
post :create, :picture_file => @attrs
|
204
|
-
assigns(:picture_file).
|
204
|
+
expect(assigns(:picture_file)).to be_valid
|
205
205
|
end
|
206
206
|
|
207
207
|
it "redirects to the created picture_file" do
|
208
208
|
post :create, :picture_file => @attrs
|
209
|
-
response.
|
209
|
+
expect(response).to redirect_to(picture_file_url(assigns(:picture_file)))
|
210
210
|
end
|
211
211
|
end
|
212
212
|
|
213
213
|
describe "with invalid params" do
|
214
214
|
it "assigns a newly created but unsaved picture_file as @picture_file" do
|
215
215
|
post :create, :picture_file => @invalid_attrs
|
216
|
-
assigns(:picture_file).
|
216
|
+
expect(assigns(:picture_file)).not_to be_valid
|
217
217
|
end
|
218
218
|
|
219
219
|
it "re-renders the 'new' template" do
|
220
220
|
post :create, :picture_file => @invalid_attrs
|
221
|
-
response.
|
221
|
+
expect(response).to render_template("new")
|
222
222
|
end
|
223
223
|
end
|
224
224
|
end
|
@@ -229,24 +229,24 @@ describe PictureFilesController do
|
|
229
229
|
describe "with valid params" do
|
230
230
|
it "assigns a newly created picture_file as @picture_file" do
|
231
231
|
post :create, :picture_file => @attrs
|
232
|
-
assigns(:picture_file).
|
232
|
+
expect(assigns(:picture_file)).to be_valid
|
233
233
|
end
|
234
234
|
|
235
235
|
it "should be forbidden" do
|
236
236
|
post :create, :picture_file => @attrs
|
237
|
-
response.
|
237
|
+
expect(response).to be_forbidden
|
238
238
|
end
|
239
239
|
end
|
240
240
|
|
241
241
|
describe "with invalid params" do
|
242
242
|
it "assigns a newly created but unsaved picture_file as @picture_file" do
|
243
243
|
post :create, :picture_file => @invalid_attrs
|
244
|
-
assigns(:picture_file).
|
244
|
+
expect(assigns(:picture_file)).not_to be_valid
|
245
245
|
end
|
246
246
|
|
247
247
|
it "should be forbidden" do
|
248
248
|
post :create, :picture_file => @invalid_attrs
|
249
|
-
response.
|
249
|
+
expect(response).to be_forbidden
|
250
250
|
end
|
251
251
|
end
|
252
252
|
end
|
@@ -255,24 +255,24 @@ describe PictureFilesController do
|
|
255
255
|
describe "with valid params" do
|
256
256
|
it "assigns a newly created picture_file as @picture_file" do
|
257
257
|
post :create, :picture_file => @attrs
|
258
|
-
assigns(:picture_file).
|
258
|
+
expect(assigns(:picture_file)).to be_valid
|
259
259
|
end
|
260
260
|
|
261
261
|
it "should be forbidden" do
|
262
262
|
post :create, :picture_file => @attrs
|
263
|
-
response.
|
263
|
+
expect(response).to redirect_to(new_user_session_url)
|
264
264
|
end
|
265
265
|
end
|
266
266
|
|
267
267
|
describe "with invalid params" do
|
268
268
|
it "assigns a newly created but unsaved picture_file as @picture_file" do
|
269
269
|
post :create, :picture_file => @invalid_attrs
|
270
|
-
assigns(:picture_file).
|
270
|
+
expect(assigns(:picture_file)).not_to be_valid
|
271
271
|
end
|
272
272
|
|
273
273
|
it "should be forbidden" do
|
274
274
|
post :create, :picture_file => @invalid_attrs
|
275
|
-
response.
|
275
|
+
expect(response).to redirect_to(new_user_session_url)
|
276
276
|
end
|
277
277
|
end
|
278
278
|
end
|
@@ -295,19 +295,19 @@ describe PictureFilesController do
|
|
295
295
|
|
296
296
|
it "assigns the requested picture_file as @picture_file" do
|
297
297
|
put :update, :id => @picture_file.id, :picture_file => @attrs
|
298
|
-
assigns(:picture_file).
|
298
|
+
expect(assigns(:picture_file)).to eq(@picture_file)
|
299
299
|
end
|
300
300
|
|
301
301
|
it "moves its position when specified" do
|
302
302
|
put :update, :id => @picture_file.id, :move => 'lower'
|
303
|
-
response.
|
303
|
+
expect(response).to redirect_to(picture_files_url(shelf_id: @picture_file.picture_attachable_id))
|
304
304
|
end
|
305
305
|
end
|
306
306
|
|
307
307
|
describe "with invalid params" do
|
308
308
|
it "assigns the requested picture_file as @picture_file" do
|
309
309
|
put :update, :id => @picture_file.id, :picture_file => @invalid_attrs
|
310
|
-
response.
|
310
|
+
expect(response).to render_template("edit")
|
311
311
|
end
|
312
312
|
end
|
313
313
|
end
|
@@ -322,20 +322,20 @@ describe PictureFilesController do
|
|
322
322
|
|
323
323
|
it "assigns the requested picture_file as @picture_file" do
|
324
324
|
put :update, :id => @picture_file.id, :picture_file => @attrs
|
325
|
-
assigns(:picture_file).
|
326
|
-
response.
|
325
|
+
expect(assigns(:picture_file)).to eq(@picture_file)
|
326
|
+
expect(response).to redirect_to(@picture_file)
|
327
327
|
end
|
328
328
|
end
|
329
329
|
|
330
330
|
describe "with invalid params" do
|
331
331
|
it "assigns the picture_file as @picture_file" do
|
332
332
|
put :update, :id => @picture_file, :picture_file => @invalid_attrs
|
333
|
-
assigns(:picture_file).
|
333
|
+
expect(assigns(:picture_file)).not_to be_valid
|
334
334
|
end
|
335
335
|
|
336
336
|
it "re-renders the 'edit' template" do
|
337
337
|
put :update, :id => @picture_file, :picture_file => @invalid_attrs
|
338
|
-
response.
|
338
|
+
expect(response).to render_template("edit")
|
339
339
|
end
|
340
340
|
end
|
341
341
|
end
|
@@ -350,15 +350,15 @@ describe PictureFilesController do
|
|
350
350
|
|
351
351
|
it "assigns the requested picture_file as @picture_file" do
|
352
352
|
put :update, :id => @picture_file.id, :picture_file => @attrs
|
353
|
-
assigns(:picture_file).
|
354
|
-
response.
|
353
|
+
expect(assigns(:picture_file)).to eq(@picture_file)
|
354
|
+
expect(response).to be_forbidden
|
355
355
|
end
|
356
356
|
end
|
357
357
|
|
358
358
|
describe "with invalid params" do
|
359
359
|
it "assigns the requested picture_file as @picture_file" do
|
360
360
|
put :update, :id => @picture_file.id, :picture_file => @invalid_attrs
|
361
|
-
response.
|
361
|
+
expect(response).to be_forbidden
|
362
362
|
end
|
363
363
|
end
|
364
364
|
end
|
@@ -371,14 +371,14 @@ describe PictureFilesController do
|
|
371
371
|
|
372
372
|
it "should be forbidden" do
|
373
373
|
put :update, :id => @picture_file.id, :picture_file => @attrs
|
374
|
-
response.
|
374
|
+
expect(response).to redirect_to(new_user_session_url)
|
375
375
|
end
|
376
376
|
end
|
377
377
|
|
378
378
|
describe "with invalid params" do
|
379
379
|
it "assigns the requested picture_file as @picture_file" do
|
380
380
|
put :update, :id => @picture_file.id, :picture_file => @invalid_attrs
|
381
|
-
response.
|
381
|
+
expect(response).to redirect_to(new_user_session_url)
|
382
382
|
end
|
383
383
|
end
|
384
384
|
end
|
@@ -398,7 +398,7 @@ describe PictureFilesController do
|
|
398
398
|
|
399
399
|
it "redirects to the picture_files list" do
|
400
400
|
delete :destroy, :id => @picture_file.id
|
401
|
-
response.
|
401
|
+
expect(response).to redirect_to(picture_files_url(shelf_id: @picture_file.picture_attachable_id))
|
402
402
|
end
|
403
403
|
end
|
404
404
|
|
@@ -411,7 +411,7 @@ describe PictureFilesController do
|
|
411
411
|
|
412
412
|
it "should be forbidden" do
|
413
413
|
delete :destroy, :id => @picture_file.id
|
414
|
-
response.
|
414
|
+
expect(response).to redirect_to(picture_files_url(shelf_id: @picture_file.picture_attachable_id))
|
415
415
|
end
|
416
416
|
end
|
417
417
|
|
@@ -424,7 +424,7 @@ describe PictureFilesController do
|
|
424
424
|
|
425
425
|
it "should be forbidden" do
|
426
426
|
delete :destroy, :id => @picture_file.id
|
427
|
-
response.
|
427
|
+
expect(response).to be_forbidden
|
428
428
|
end
|
429
429
|
end
|
430
430
|
|
@@ -435,7 +435,7 @@ describe PictureFilesController do
|
|
435
435
|
|
436
436
|
it "should be forbidden" do
|
437
437
|
delete :destroy, :id => @picture_file.id
|
438
|
-
response.
|
438
|
+
expect(response).to redirect_to(new_user_session_url)
|
439
439
|
end
|
440
440
|
end
|
441
441
|
end
|
@@ -33,7 +33,7 @@ describe ProduceTypesController do
|
|
33
33
|
it "assigns all produce_types as @produce_types" do
|
34
34
|
produce_type = ProduceType.create! valid_attributes
|
35
35
|
get :index
|
36
|
-
assigns(:produce_types).
|
36
|
+
expect(assigns(:produce_types)).to eq(ProduceType.all)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -41,14 +41,14 @@ describe ProduceTypesController do
|
|
41
41
|
it "assigns the requested produce_type as @produce_type" do
|
42
42
|
produce_type = ProduceType.create! valid_attributes
|
43
43
|
get :show, :id => produce_type.id
|
44
|
-
assigns(:produce_type).
|
44
|
+
expect(assigns(:produce_type)).to eq(produce_type)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
48
|
describe "GET new" do
|
49
49
|
it "assigns a new produce_type as @produce_type" do
|
50
50
|
get :new
|
51
|
-
assigns(:produce_type).
|
51
|
+
expect(assigns(:produce_type)).to be_a_new(ProduceType)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -56,7 +56,7 @@ describe ProduceTypesController do
|
|
56
56
|
it "assigns the requested produce_type as @produce_type" do
|
57
57
|
produce_type = ProduceType.create! valid_attributes
|
58
58
|
get :edit, :id => produce_type.id
|
59
|
-
assigns(:produce_type).
|
59
|
+
expect(assigns(:produce_type)).to eq(produce_type)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -70,13 +70,13 @@ describe ProduceTypesController do
|
|
70
70
|
|
71
71
|
it "assigns a newly created produce_type as @produce_type" do
|
72
72
|
post :create, :produce_type => valid_attributes
|
73
|
-
assigns(:produce_type).
|
74
|
-
assigns(:produce_type).
|
73
|
+
expect(assigns(:produce_type)).to be_a(ProduceType)
|
74
|
+
expect(assigns(:produce_type)).to be_persisted
|
75
75
|
end
|
76
76
|
|
77
77
|
it "redirects to the created produce_type" do
|
78
78
|
post :create, :produce_type => valid_attributes
|
79
|
-
response.
|
79
|
+
expect(response).to redirect_to(ProduceType.last)
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
@@ -85,14 +85,14 @@ describe ProduceTypesController do
|
|
85
85
|
# Trigger the behavior that occurs when invalid params are submitted
|
86
86
|
ProduceType.any_instance.stub(:save).and_return(false)
|
87
87
|
post :create, :produce_type => {}
|
88
|
-
assigns(:produce_type).
|
88
|
+
expect(assigns(:produce_type)).to be_a_new(ProduceType)
|
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
|
ProduceType.any_instance.stub(:save).and_return(false)
|
94
94
|
post :create, :produce_type => {}
|
95
|
-
#response.
|
95
|
+
#expect(response).to render_template("new")
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end
|
@@ -112,20 +112,20 @@ describe ProduceTypesController do
|
|
112
112
|
it "assigns the requested produce_type as @produce_type" do
|
113
113
|
produce_type = ProduceType.create! valid_attributes
|
114
114
|
put :update, :id => produce_type.id, :produce_type => valid_attributes
|
115
|
-
assigns(:produce_type).
|
115
|
+
expect(assigns(:produce_type)).to eq(produce_type)
|
116
116
|
end
|
117
117
|
|
118
118
|
it "redirects to the produce_type" do
|
119
119
|
produce_type = ProduceType.create! valid_attributes
|
120
120
|
put :update, :id => produce_type.id, :produce_type => valid_attributes
|
121
|
-
response.
|
121
|
+
expect(response).to redirect_to(produce_type)
|
122
122
|
end
|
123
123
|
|
124
124
|
it "moves its position when specified" do
|
125
125
|
produce_type = ProduceType.create! valid_attributes
|
126
126
|
position = produce_type.position
|
127
127
|
put :update, :id => produce_type.id, :move => 'higher'
|
128
|
-
response.
|
128
|
+
expect(response).to redirect_to produce_types_url
|
129
129
|
assigns(:produce_type).position.should eq position - 1
|
130
130
|
end
|
131
131
|
end
|
@@ -136,7 +136,7 @@ describe ProduceTypesController do
|
|
136
136
|
# Trigger the behavior that occurs when invalid params are submitted
|
137
137
|
ProduceType.any_instance.stub(:save).and_return(false)
|
138
138
|
put :update, :id => produce_type.id, :produce_type => {}
|
139
|
-
assigns(:produce_type).
|
139
|
+
expect(assigns(:produce_type)).to eq(produce_type)
|
140
140
|
end
|
141
141
|
|
142
142
|
it "re-renders the 'edit' template" do
|
@@ -144,7 +144,7 @@ describe ProduceTypesController do
|
|
144
144
|
# Trigger the behavior that occurs when invalid params are submitted
|
145
145
|
ProduceType.any_instance.stub(:save).and_return(false)
|
146
146
|
put :update, :id => produce_type.id, :produce_type => {}
|
147
|
-
#response.
|
147
|
+
#expect(response).to render_template("edit")
|
148
148
|
end
|
149
149
|
end
|
150
150
|
end
|
@@ -160,7 +160,7 @@ describe ProduceTypesController do
|
|
160
160
|
it "redirects to the produce_types list" do
|
161
161
|
produce_type = ProduceType.create! valid_attributes
|
162
162
|
delete :destroy, :id => produce_type.id
|
163
|
-
response.
|
163
|
+
expect(response).to redirect_to(produce_types_url)
|
164
164
|
end
|
165
165
|
end
|
166
166
|
|