enju_event 0.1.19 → 0.2.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +3 -3
- data/Rakefile +9 -15
- data/app/controllers/concerns/enju_event/controller.rb +13 -0
- data/app/controllers/event_categories_controller.rb +13 -2
- data/app/controllers/event_export_files_controller.rb +13 -3
- data/app/controllers/event_import_files_controller.rb +14 -4
- data/app/controllers/event_import_results_controller.rb +12 -1
- data/app/controllers/events_controller.rb +18 -8
- data/app/controllers/participates_controller.rb +11 -1
- data/app/controllers/places_controller.rb +64 -0
- data/app/jobs/event_export_file_job.rb +7 -0
- data/app/jobs/event_import_file_job.rb +7 -0
- data/app/models/event.rb +6 -5
- data/app/models/event_category.rb +3 -4
- data/app/models/event_export_file.rb +4 -5
- data/app/models/event_export_file_transition.rb +4 -4
- data/app/models/event_import_file.rb +8 -9
- data/app/models/event_import_file_transition.rb +4 -4
- data/app/models/event_import_result.rb +2 -3
- data/app/models/participate.rb +2 -3
- data/app/models/place.rb +18 -0
- data/app/policies/event_category_policy.rb +23 -0
- data/app/policies/event_export_file_policy.rb +21 -0
- data/app/policies/event_import_file_policy.rb +21 -0
- data/app/policies/event_import_result_policy.rb +21 -0
- data/app/policies/event_policy.rb +21 -0
- data/app/policies/participate_policy.rb +21 -0
- data/app/policies/place_policy.rb +21 -0
- data/app/views/event_categories/index.html.erb +4 -4
- data/app/views/event_categories/show.html.erb +1 -1
- data/app/views/events/_calendar.html.erb +1 -1
- data/app/views/events/{index.mobile.erb → index.html+phone.erb} +6 -6
- data/app/views/events/index.html.erb +11 -12
- data/app/views/events/index.rss.builder +2 -2
- data/app/views/events/{show.mobile.erb → show.html+phone.erb} +0 -0
- data/app/views/events/show.html.erb +2 -2
- data/app/views/picture_files/_index_event.html.erb +4 -4
- data/app/views/places/_form.html.erb +37 -0
- data/app/views/places/edit.html.erb +6 -0
- data/app/views/places/index.html.erb +35 -0
- data/app/views/places/new.html.erb +5 -0
- data/app/views/places/show.html.erb +29 -0
- data/config/routes.rb +1 -0
- data/db/migrate/20151128142913_create_places.rb +15 -0
- data/db/migrate/20151201163718_add_place_id_to_event.rb +6 -0
- data/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb +9 -0
- data/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb +9 -0
- data/lib/enju_event.rb +0 -19
- data/lib/enju_event/version.rb +1 -1
- data/lib/tasks/enju_event_tasks.rake +1 -1
- data/spec/controllers/event_categories_controller_spec.rb +58 -58
- data/spec/controllers/event_export_files_controller_spec.rb +6 -6
- data/spec/controllers/event_import_files_controller_spec.rb +4 -4
- data/spec/controllers/event_import_results_controller_spec.rb +2 -2
- data/spec/controllers/events_controller_spec.rb +6 -6
- data/spec/controllers/participates_controller_spec.rb +54 -54
- data/spec/dummy/app/controllers/application_controller.rb +8 -4
- data/spec/dummy/app/models/user.rb +2 -2
- data/spec/dummy/config/application.rb +5 -24
- data/spec/dummy/config/environments/development.rb +25 -14
- data/spec/dummy/config/environments/production.rb +50 -31
- data/spec/dummy/config/environments/test.rb +19 -14
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/db/migrate/20140821151023_create_colors.rb +14 -0
- data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +13 -0
- data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +13 -0
- data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +9 -0
- data/spec/dummy/db/schema.rb +52 -1
- data/spec/fixtures/event_categories.yml +3 -4
- data/spec/fixtures/event_export_files.yml +4 -4
- data/spec/fixtures/event_import_files.yml +8 -8
- data/spec/fixtures/event_import_results.yml +2 -3
- data/spec/fixtures/events.yml +7 -7
- data/spec/fixtures/participates.yml +2 -3
- data/spec/models/event_category_spec.rb +3 -4
- data/spec/models/event_export_file_spec.rb +5 -5
- data/spec/models/event_import_file_spec.rb +9 -9
- data/spec/models/event_import_result_spec.rb +2 -3
- data/spec/models/event_spec.rb +4 -3
- data/spec/models/participate_spec.rb +2 -3
- data/spec/support/devise.rb +2 -2
- metadata +132 -25
- data/app/models/enju_event/ability.rb +0 -43
- data/app/workers/event_export_file_queue.rb +0 -7
- data/app/workers/event_import_file_queue.rb +0 -7
- data/lib/enju_event/import_file.rb +0 -13
- data/spec/dummy/app/models/ability.rb +0 -41
@@ -27,7 +27,7 @@ describe EventExportFilesController do
|
|
27
27
|
|
28
28
|
it "assigns empty as @event_export_files" do
|
29
29
|
get :index
|
30
|
-
assigns(:event_export_files).should
|
30
|
+
assigns(:event_export_files).should be_nil
|
31
31
|
response.should be_forbidden
|
32
32
|
end
|
33
33
|
end
|
@@ -35,7 +35,7 @@ describe EventExportFilesController do
|
|
35
35
|
describe "When not logged in" do
|
36
36
|
it "assigns empty as @event_export_files" do
|
37
37
|
get :index
|
38
|
-
assigns(:event_export_files).should
|
38
|
+
assigns(:event_export_files).should be_nil
|
39
39
|
response.should redirect_to(new_user_session_url)
|
40
40
|
end
|
41
41
|
end
|
@@ -107,7 +107,7 @@ describe EventExportFilesController do
|
|
107
107
|
|
108
108
|
it "should not assign the requested event_export_file as @event_export_file" do
|
109
109
|
get :new
|
110
|
-
assigns(:event_export_file).
|
110
|
+
assigns(:event_export_file).should be_nil
|
111
111
|
response.should be_forbidden
|
112
112
|
end
|
113
113
|
end
|
@@ -115,7 +115,7 @@ describe EventExportFilesController do
|
|
115
115
|
describe "When not logged in" do
|
116
116
|
it "should not assign the requested event_export_file as @event_export_file" do
|
117
117
|
get :new
|
118
|
-
assigns(:event_export_file).
|
118
|
+
assigns(:event_export_file).should be_nil
|
119
119
|
response.should redirect_to(new_user_session_url)
|
120
120
|
end
|
121
121
|
end
|
@@ -138,7 +138,7 @@ describe EventExportFilesController do
|
|
138
138
|
|
139
139
|
it "should be forbidden" do
|
140
140
|
post :create, :event_export_file => { event_export_file_name: 'test.txt' }
|
141
|
-
assigns(:event_export_file).
|
141
|
+
assigns(:event_export_file).should be_nil
|
142
142
|
response.should be_forbidden
|
143
143
|
end
|
144
144
|
end
|
@@ -146,7 +146,7 @@ describe EventExportFilesController do
|
|
146
146
|
describe "When not logged in" do
|
147
147
|
it "should be redirected to new session url" do
|
148
148
|
post :create, :event_export_file => { event_export_file_name: 'test.txt' }
|
149
|
-
assigns(:event_export_file).
|
149
|
+
assigns(:event_export_file).should be_nil
|
150
150
|
response.should redirect_to new_user_session_url
|
151
151
|
end
|
152
152
|
end
|
@@ -28,7 +28,7 @@ describe EventImportFilesController do
|
|
28
28
|
|
29
29
|
it "assigns empty as @event_import_files" do
|
30
30
|
get :index
|
31
|
-
assigns(:event_import_files).should
|
31
|
+
assigns(:event_import_files).should be_nil
|
32
32
|
response.should be_forbidden
|
33
33
|
end
|
34
34
|
end
|
@@ -36,7 +36,7 @@ describe EventImportFilesController do
|
|
36
36
|
describe "When not logged in" do
|
37
37
|
it "assigns empty as @event_import_files" do
|
38
38
|
get :index
|
39
|
-
assigns(:event_import_files).should
|
39
|
+
assigns(:event_import_files).should be_nil
|
40
40
|
response.should redirect_to(new_user_session_url)
|
41
41
|
end
|
42
42
|
end
|
@@ -105,7 +105,7 @@ describe EventImportFilesController do
|
|
105
105
|
|
106
106
|
it "should not assign the requested event_import_file as @event_import_file" do
|
107
107
|
get :new
|
108
|
-
assigns(:event_import_file).
|
108
|
+
assigns(:event_import_file).should be_nil
|
109
109
|
response.should be_forbidden
|
110
110
|
end
|
111
111
|
end
|
@@ -113,7 +113,7 @@ describe EventImportFilesController do
|
|
113
113
|
describe "When not logged in" do
|
114
114
|
it "should not assign the requested event_import_file as @event_import_file" do
|
115
115
|
get :new
|
116
|
-
assigns(:event_import_file).
|
116
|
+
assigns(:event_import_file).should be_nil
|
117
117
|
response.should redirect_to(new_user_session_url)
|
118
118
|
end
|
119
119
|
end
|
@@ -28,7 +28,7 @@ describe EventImportResultsController do
|
|
28
28
|
|
29
29
|
it "assigns empty as @event_import_results" do
|
30
30
|
get :index
|
31
|
-
assigns(:event_import_results).should
|
31
|
+
assigns(:event_import_results).should be_nil
|
32
32
|
response.should be_forbidden
|
33
33
|
end
|
34
34
|
end
|
@@ -36,7 +36,7 @@ describe EventImportResultsController do
|
|
36
36
|
describe "When not logged in" do
|
37
37
|
it "assigns empty as @event_import_results" do
|
38
38
|
get :index
|
39
|
-
assigns(:event_import_results).should
|
39
|
+
assigns(:event_import_results).should be_nil
|
40
40
|
response.should redirect_to(new_user_session_url)
|
41
41
|
end
|
42
42
|
end
|
@@ -145,7 +145,7 @@ describe EventsController do
|
|
145
145
|
|
146
146
|
it "should not assign the requested event as @event" do
|
147
147
|
get :new
|
148
|
-
assigns(:event).
|
148
|
+
assigns(:event).should be_nil
|
149
149
|
response.should be_forbidden
|
150
150
|
end
|
151
151
|
end
|
@@ -153,7 +153,7 @@ describe EventsController do
|
|
153
153
|
describe "When not logged in" do
|
154
154
|
it "should not assign the requested event as @event" do
|
155
155
|
get :new
|
156
|
-
assigns(:event).
|
156
|
+
assigns(:event).should be_nil
|
157
157
|
response.should redirect_to(new_user_session_url)
|
158
158
|
end
|
159
159
|
end
|
@@ -266,7 +266,7 @@ describe EventsController do
|
|
266
266
|
describe "with valid params" do
|
267
267
|
it "assigns a newly created event as @event" do
|
268
268
|
post :create, :event => @attrs
|
269
|
-
assigns(:event).should
|
269
|
+
assigns(:event).should be_nil
|
270
270
|
end
|
271
271
|
|
272
272
|
it "should be forbidden" do
|
@@ -278,7 +278,7 @@ describe EventsController do
|
|
278
278
|
describe "with invalid params" do
|
279
279
|
it "assigns a newly created but unsaved event as @event" do
|
280
280
|
post :create, :event => @invalid_attrs
|
281
|
-
assigns(:event).
|
281
|
+
assigns(:event).should be_nil
|
282
282
|
end
|
283
283
|
|
284
284
|
it "should be forbidden" do
|
@@ -292,7 +292,7 @@ describe EventsController do
|
|
292
292
|
describe "with valid params" do
|
293
293
|
it "assigns a newly created event as @event" do
|
294
294
|
post :create, :event => @attrs
|
295
|
-
assigns(:event).should
|
295
|
+
assigns(:event).should be_nil
|
296
296
|
end
|
297
297
|
|
298
298
|
it "should be forbidden" do
|
@@ -304,7 +304,7 @@ describe EventsController do
|
|
304
304
|
describe "with invalid params" do
|
305
305
|
it "assigns a newly created but unsaved event as @event" do
|
306
306
|
post :create, :event => @invalid_attrs
|
307
|
-
assigns(:event).
|
307
|
+
assigns(:event).should be_nil
|
308
308
|
end
|
309
309
|
|
310
310
|
it "should be forbidden" do
|
@@ -33,14 +33,14 @@ describe ParticipatesController do
|
|
33
33
|
|
34
34
|
it "assigns empty as @participates" do
|
35
35
|
get :index
|
36
|
-
assigns(:participates).should
|
36
|
+
assigns(:participates).should be_nil
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
40
|
describe "When not logged in" do
|
41
41
|
it "assigns empty as @participates" do
|
42
42
|
get :index
|
43
|
-
assigns(:participates).should
|
43
|
+
assigns(:participates).should be_nil
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -51,7 +51,7 @@ describe ParticipatesController do
|
|
51
51
|
|
52
52
|
it "assigns the requested participate as @participate" do
|
53
53
|
participate = FactoryGirl.create(:participate)
|
54
|
-
get :show, :
|
54
|
+
get :show, id: participate.id
|
55
55
|
assigns(:participate).should eq(participate)
|
56
56
|
end
|
57
57
|
end
|
@@ -61,7 +61,7 @@ describe ParticipatesController do
|
|
61
61
|
|
62
62
|
it "assigns the requested participate as @participate" do
|
63
63
|
participate = FactoryGirl.create(:participate)
|
64
|
-
get :show, :
|
64
|
+
get :show, id: participate.id
|
65
65
|
assigns(:participate).should eq(participate)
|
66
66
|
end
|
67
67
|
end
|
@@ -71,7 +71,7 @@ describe ParticipatesController do
|
|
71
71
|
|
72
72
|
it "assigns the requested participate as @participate" do
|
73
73
|
participate = FactoryGirl.create(:participate)
|
74
|
-
get :show, :
|
74
|
+
get :show, id: participate.id
|
75
75
|
assigns(:participate).should eq(participate)
|
76
76
|
end
|
77
77
|
end
|
@@ -79,7 +79,7 @@ describe ParticipatesController do
|
|
79
79
|
describe "When not logged in" do
|
80
80
|
it "assigns the requested participate as @participate" do
|
81
81
|
participate = FactoryGirl.create(:participate)
|
82
|
-
get :show, :
|
82
|
+
get :show, id: participate.id
|
83
83
|
assigns(:participate).should eq(participate)
|
84
84
|
end
|
85
85
|
end
|
@@ -109,7 +109,7 @@ describe ParticipatesController do
|
|
109
109
|
|
110
110
|
it "should not assign the requested participate as @participate" do
|
111
111
|
get :new
|
112
|
-
assigns(:participate).
|
112
|
+
assigns(:participate).should be_nil
|
113
113
|
response.should be_forbidden
|
114
114
|
end
|
115
115
|
end
|
@@ -117,7 +117,7 @@ describe ParticipatesController do
|
|
117
117
|
describe "When not logged in" do
|
118
118
|
it "should not assign the requested participate as @participate" do
|
119
119
|
get :new
|
120
|
-
assigns(:participate).
|
120
|
+
assigns(:participate).should be_nil
|
121
121
|
response.should redirect_to(new_user_session_url)
|
122
122
|
end
|
123
123
|
end
|
@@ -129,7 +129,7 @@ describe ParticipatesController do
|
|
129
129
|
|
130
130
|
it "assigns the requested participate as @participate" do
|
131
131
|
participate = FactoryGirl.create(:participate)
|
132
|
-
get :edit, :
|
132
|
+
get :edit, id: participate.id
|
133
133
|
assigns(:participate).should eq(participate)
|
134
134
|
end
|
135
135
|
end
|
@@ -139,7 +139,7 @@ describe ParticipatesController do
|
|
139
139
|
|
140
140
|
it "assigns the requested participate as @participate" do
|
141
141
|
participate = FactoryGirl.create(:participate)
|
142
|
-
get :edit, :
|
142
|
+
get :edit, id: participate.id
|
143
143
|
assigns(:participate).should eq(participate)
|
144
144
|
end
|
145
145
|
end
|
@@ -149,7 +149,7 @@ describe ParticipatesController do
|
|
149
149
|
|
150
150
|
it "assigns the requested participate as @participate" do
|
151
151
|
participate = FactoryGirl.create(:participate)
|
152
|
-
get :edit, :
|
152
|
+
get :edit, id: participate.id
|
153
153
|
response.should be_forbidden
|
154
154
|
end
|
155
155
|
end
|
@@ -157,7 +157,7 @@ describe ParticipatesController do
|
|
157
157
|
describe "When not logged in" do
|
158
158
|
it "should not assign the requested participate as @participate" do
|
159
159
|
participate = FactoryGirl.create(:participate)
|
160
|
-
get :edit, :
|
160
|
+
get :edit, id: participate.id
|
161
161
|
response.should redirect_to(new_user_session_url)
|
162
162
|
end
|
163
163
|
end
|
@@ -174,24 +174,24 @@ describe ParticipatesController do
|
|
174
174
|
|
175
175
|
describe "with valid params" do
|
176
176
|
it "assigns a newly created participate as @participate" do
|
177
|
-
post :create, :
|
177
|
+
post :create, participate: @attrs
|
178
178
|
assigns(:participate).should be_valid
|
179
179
|
end
|
180
180
|
|
181
181
|
it "redirects to the created participate" do
|
182
|
-
post :create, :
|
182
|
+
post :create, participate: @attrs
|
183
183
|
response.should redirect_to(participate_url(assigns(:participate)))
|
184
184
|
end
|
185
185
|
end
|
186
186
|
|
187
187
|
describe "with invalid params" do
|
188
188
|
it "assigns a newly created but unsaved participate as @participate" do
|
189
|
-
post :create, :
|
189
|
+
post :create, participate: @invalid_attrs
|
190
190
|
assigns(:participate).should_not be_valid
|
191
191
|
end
|
192
192
|
|
193
193
|
it "re-renders the 'new' template" do
|
194
|
-
post :create, :
|
194
|
+
post :create, participate: @invalid_attrs
|
195
195
|
response.should render_template("new")
|
196
196
|
end
|
197
197
|
end
|
@@ -202,24 +202,24 @@ describe ParticipatesController do
|
|
202
202
|
|
203
203
|
describe "with valid params" do
|
204
204
|
it "assigns a newly created participate as @participate" do
|
205
|
-
post :create, :
|
205
|
+
post :create, participate: @attrs
|
206
206
|
assigns(:participate).should be_valid
|
207
207
|
end
|
208
208
|
|
209
209
|
it "redirects to the created participate" do
|
210
|
-
post :create, :
|
210
|
+
post :create, participate: @attrs
|
211
211
|
response.should redirect_to(participate_url(assigns(:participate)))
|
212
212
|
end
|
213
213
|
end
|
214
214
|
|
215
215
|
describe "with invalid params" do
|
216
216
|
it "assigns a newly created but unsaved participate as @participate" do
|
217
|
-
post :create, :
|
217
|
+
post :create, participate: @invalid_attrs
|
218
218
|
assigns(:participate).should_not be_valid
|
219
219
|
end
|
220
220
|
|
221
221
|
it "re-renders the 'new' template" do
|
222
|
-
post :create, :
|
222
|
+
post :create, participate: @invalid_attrs
|
223
223
|
response.should render_template("new")
|
224
224
|
end
|
225
225
|
end
|
@@ -230,24 +230,24 @@ describe ParticipatesController do
|
|
230
230
|
|
231
231
|
describe "with valid params" do
|
232
232
|
it "assigns a newly created participate as @participate" do
|
233
|
-
post :create, :
|
234
|
-
assigns(:participate).should
|
233
|
+
post :create, participate: @attrs
|
234
|
+
assigns(:participate).should be_nil
|
235
235
|
end
|
236
236
|
|
237
237
|
it "should be forbidden" do
|
238
|
-
post :create, :
|
238
|
+
post :create, participate: @attrs
|
239
239
|
response.should 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 participate as @participate" do
|
245
|
-
post :create, :
|
246
|
-
assigns(:participate).
|
245
|
+
post :create, participate: @invalid_attrs
|
246
|
+
assigns(:participate).should be_nil
|
247
247
|
end
|
248
248
|
|
249
249
|
it "should be forbidden" do
|
250
|
-
post :create, :
|
250
|
+
post :create, participate: @invalid_attrs
|
251
251
|
response.should be_forbidden
|
252
252
|
end
|
253
253
|
end
|
@@ -256,24 +256,24 @@ describe ParticipatesController do
|
|
256
256
|
describe "When not logged in" do
|
257
257
|
describe "with valid params" do
|
258
258
|
it "assigns a newly created participate as @participate" do
|
259
|
-
post :create, :
|
260
|
-
assigns(:participate).should
|
259
|
+
post :create, participate: @attrs
|
260
|
+
assigns(:participate).should be_nil
|
261
261
|
end
|
262
262
|
|
263
263
|
it "should be forbidden" do
|
264
|
-
post :create, :
|
264
|
+
post :create, participate: @attrs
|
265
265
|
response.should 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 participate as @participate" do
|
271
|
-
post :create, :
|
272
|
-
assigns(:participate).
|
271
|
+
post :create, participate: @invalid_attrs
|
272
|
+
assigns(:participate).should be_nil
|
273
273
|
end
|
274
274
|
|
275
275
|
it "should be forbidden" do
|
276
|
-
post :create, :
|
276
|
+
post :create, participate: @invalid_attrs
|
277
277
|
response.should redirect_to(new_user_session_url)
|
278
278
|
end
|
279
279
|
end
|
@@ -292,11 +292,11 @@ describe ParticipatesController do
|
|
292
292
|
|
293
293
|
describe "with valid params" do
|
294
294
|
it "updates the requested participate" do
|
295
|
-
put :update, :
|
295
|
+
put :update, id: @participate.id, participate: @attrs
|
296
296
|
end
|
297
297
|
|
298
298
|
it "assigns the requested participate as @participate" do
|
299
|
-
put :update, :
|
299
|
+
put :update, id: @participate.id, participate: @attrs
|
300
300
|
assigns(:participate).should eq(@participate)
|
301
301
|
response.should redirect_to(@participate)
|
302
302
|
end
|
@@ -304,11 +304,11 @@ describe ParticipatesController do
|
|
304
304
|
|
305
305
|
describe "with invalid params" do
|
306
306
|
it "assigns the requested participate as @participate" do
|
307
|
-
put :update, :
|
307
|
+
put :update, id: @participate.id, participate: @invalid_attrs
|
308
308
|
end
|
309
309
|
|
310
310
|
it "re-renders the 'edit' template" do
|
311
|
-
put :update, :
|
311
|
+
put :update, id: @participate.id, participate: @invalid_attrs
|
312
312
|
response.should render_template("edit")
|
313
313
|
end
|
314
314
|
end
|
@@ -319,11 +319,11 @@ describe ParticipatesController do
|
|
319
319
|
|
320
320
|
describe "with valid params" do
|
321
321
|
it "updates the requested participate" do
|
322
|
-
put :update, :
|
322
|
+
put :update, id: @participate.id, participate: @attrs
|
323
323
|
end
|
324
324
|
|
325
325
|
it "assigns the requested participate as @participate" do
|
326
|
-
put :update, :
|
326
|
+
put :update, id: @participate.id, participate: @attrs
|
327
327
|
assigns(:participate).should eq(@participate)
|
328
328
|
response.should redirect_to(@participate)
|
329
329
|
end
|
@@ -331,12 +331,12 @@ describe ParticipatesController do
|
|
331
331
|
|
332
332
|
describe "with invalid params" do
|
333
333
|
it "assigns the participate as @participate" do
|
334
|
-
put :update, :
|
334
|
+
put :update, id: @participate.id, participate: @invalid_attrs
|
335
335
|
assigns(:participate).should_not be_valid
|
336
336
|
end
|
337
337
|
|
338
338
|
it "re-renders the 'edit' template" do
|
339
|
-
put :update, :
|
339
|
+
put :update, id: @participate.id, participate: @invalid_attrs
|
340
340
|
response.should render_template("edit")
|
341
341
|
end
|
342
342
|
end
|
@@ -347,11 +347,11 @@ describe ParticipatesController do
|
|
347
347
|
|
348
348
|
describe "with valid params" do
|
349
349
|
it "updates the requested participate" do
|
350
|
-
put :update, :
|
350
|
+
put :update, id: @participate.id, participate: @attrs
|
351
351
|
end
|
352
352
|
|
353
353
|
it "assigns the requested participate as @participate" do
|
354
|
-
put :update, :
|
354
|
+
put :update, id: @participate.id, participate: @attrs
|
355
355
|
assigns(:participate).should eq(@participate)
|
356
356
|
response.should be_forbidden
|
357
357
|
end
|
@@ -359,7 +359,7 @@ describe ParticipatesController do
|
|
359
359
|
|
360
360
|
describe "with invalid params" do
|
361
361
|
it "assigns the requested participate as @participate" do
|
362
|
-
put :update, :
|
362
|
+
put :update, id: @participate.id, participate: @invalid_attrs
|
363
363
|
response.should be_forbidden
|
364
364
|
end
|
365
365
|
end
|
@@ -368,18 +368,18 @@ describe ParticipatesController do
|
|
368
368
|
describe "When not logged in" do
|
369
369
|
describe "with valid params" do
|
370
370
|
it "updates the requested participate" do
|
371
|
-
put :update, :
|
371
|
+
put :update, id: @participate.id, participate: @attrs
|
372
372
|
end
|
373
373
|
|
374
374
|
it "should be forbidden" do
|
375
|
-
put :update, :
|
375
|
+
put :update, id: @participate.id, participate: @attrs
|
376
376
|
response.should redirect_to(new_user_session_url)
|
377
377
|
end
|
378
378
|
end
|
379
379
|
|
380
380
|
describe "with invalid params" do
|
381
381
|
it "assigns the requested participate as @participate" do
|
382
|
-
put :update, :
|
382
|
+
put :update, id: @participate.id, participate: @invalid_attrs
|
383
383
|
response.should redirect_to(new_user_session_url)
|
384
384
|
end
|
385
385
|
end
|
@@ -395,11 +395,11 @@ describe ParticipatesController do
|
|
395
395
|
login_fixture_admin
|
396
396
|
|
397
397
|
it "destroys the requested participate" do
|
398
|
-
delete :destroy, :
|
398
|
+
delete :destroy, id: @participate.id
|
399
399
|
end
|
400
400
|
|
401
401
|
it "redirects to the participates list" do
|
402
|
-
delete :destroy, :
|
402
|
+
delete :destroy, id: @participate.id
|
403
403
|
response.should redirect_to(participates_url)
|
404
404
|
end
|
405
405
|
end
|
@@ -408,11 +408,11 @@ describe ParticipatesController do
|
|
408
408
|
login_fixture_librarian
|
409
409
|
|
410
410
|
it "destroys the requested participate" do
|
411
|
-
delete :destroy, :
|
411
|
+
delete :destroy, id: @participate.id
|
412
412
|
end
|
413
413
|
|
414
414
|
it "redirects to the participates list" do
|
415
|
-
delete :destroy, :
|
415
|
+
delete :destroy, id: @participate.id
|
416
416
|
response.should redirect_to(participates_url)
|
417
417
|
end
|
418
418
|
end
|
@@ -421,22 +421,22 @@ describe ParticipatesController do
|
|
421
421
|
login_fixture_user
|
422
422
|
|
423
423
|
it "destroys the requested participate" do
|
424
|
-
delete :destroy, :
|
424
|
+
delete :destroy, id: @participate.id
|
425
425
|
end
|
426
426
|
|
427
427
|
it "should be forbidden" do
|
428
|
-
delete :destroy, :
|
428
|
+
delete :destroy, id: @participate.id
|
429
429
|
response.should be_forbidden
|
430
430
|
end
|
431
431
|
end
|
432
432
|
|
433
433
|
describe "When not logged in" do
|
434
434
|
it "destroys the requested participate" do
|
435
|
-
delete :destroy, :
|
435
|
+
delete :destroy, id: @participate.id
|
436
436
|
end
|
437
437
|
|
438
438
|
it "should be forbidden" do
|
439
|
-
delete :destroy, :
|
439
|
+
delete :destroy, id: @participate.id
|
440
440
|
response.should redirect_to(new_user_session_url)
|
441
441
|
end
|
442
442
|
end
|