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
@@ -0,0 +1,37 @@
|
|
1
|
+
<%= form_for(@place) do |f| %>
|
2
|
+
<% if @place.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(@place.errors.count, "error") %> prohibited this place from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% @place.errors.full_messages.each do |message| %>
|
8
|
+
<li><%= message %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<div class="field">
|
15
|
+
<%= f.label :term %><br>
|
16
|
+
<%= f.text_area :term %>
|
17
|
+
</div>
|
18
|
+
<div class="field">
|
19
|
+
<%= f.label :city %><br>
|
20
|
+
<%= f.text_area :city %>
|
21
|
+
</div>
|
22
|
+
<div class="field">
|
23
|
+
<%= f.label :country_id %><br>
|
24
|
+
<%= f.number_field :country_id %>
|
25
|
+
</div>
|
26
|
+
<div class="field">
|
27
|
+
<%= f.label :latitude %><br>
|
28
|
+
<%= f.text_field :latitude %>
|
29
|
+
</div>
|
30
|
+
<div class="field">
|
31
|
+
<%= f.label :longitude %><br>
|
32
|
+
<%= f.text_field :longitude %>
|
33
|
+
</div>
|
34
|
+
<div class="actions">
|
35
|
+
<%= f.submit %>
|
36
|
+
</div>
|
37
|
+
<% end %>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Listing Places</h1>
|
4
|
+
|
5
|
+
<table>
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<th>Term</th>
|
9
|
+
<th>City</th>
|
10
|
+
<th>Country</th>
|
11
|
+
<th>Latitude</th>
|
12
|
+
<th>Longitude</th>
|
13
|
+
<th colspan="3"></th>
|
14
|
+
</tr>
|
15
|
+
</thead>
|
16
|
+
|
17
|
+
<tbody>
|
18
|
+
<% @places.each do |place| %>
|
19
|
+
<tr>
|
20
|
+
<td><%= place.term %></td>
|
21
|
+
<td><%= place.city %></td>
|
22
|
+
<td><%= place.country_id %></td>
|
23
|
+
<td><%= place.latitude %></td>
|
24
|
+
<td><%= place.longitude %></td>
|
25
|
+
<td><%= link_to 'Show', place %></td>
|
26
|
+
<td><%= link_to 'Edit', edit_place_path(place) %></td>
|
27
|
+
<td><%= link_to 'Destroy', place, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
28
|
+
</tr>
|
29
|
+
<% end %>
|
30
|
+
</tbody>
|
31
|
+
</table>
|
32
|
+
|
33
|
+
<br>
|
34
|
+
|
35
|
+
<%= link_to 'New Place', new_place_path %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<strong>Term:</strong>
|
5
|
+
<%= @place.term %>
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<strong>City:</strong>
|
10
|
+
<%= @place.city %>
|
11
|
+
</p>
|
12
|
+
|
13
|
+
<p>
|
14
|
+
<strong>Country:</strong>
|
15
|
+
<%= @place.country_id %>
|
16
|
+
</p>
|
17
|
+
|
18
|
+
<p>
|
19
|
+
<strong>Latitude:</strong>
|
20
|
+
<%= @place.latitude %>
|
21
|
+
</p>
|
22
|
+
|
23
|
+
<p>
|
24
|
+
<strong>Longitude:</strong>
|
25
|
+
<%= @place.longitude %>
|
26
|
+
</p>
|
27
|
+
|
28
|
+
<%= link_to 'Edit', edit_place_path(@place) %> |
|
29
|
+
<%= link_to 'Back', places_path %>
|
data/config/routes.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreatePlaces < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :places do |t|
|
4
|
+
t.string :term
|
5
|
+
t.text :city
|
6
|
+
t.integer :country_id
|
7
|
+
t.float :latitude
|
8
|
+
t.float :longitude
|
9
|
+
|
10
|
+
t.timestamps null: false
|
11
|
+
end
|
12
|
+
add_index :places, :term
|
13
|
+
add_index :places, :country_id
|
14
|
+
end
|
15
|
+
end
|
data/lib/enju_event.rb
CHANGED
@@ -1,23 +1,4 @@
|
|
1
1
|
require "enju_event/engine"
|
2
2
|
|
3
3
|
module EnjuEvent
|
4
|
-
def self.included(base)
|
5
|
-
base.extend(ClassMethods)
|
6
|
-
end
|
7
|
-
|
8
|
-
module ClassMethods
|
9
|
-
def enju_event
|
10
|
-
include EnjuEvent::InstanceMethods
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
module InstanceMethods
|
15
|
-
private
|
16
|
-
|
17
|
-
def get_event
|
18
|
-
@event = Event.find(params[:event_id]) if params[:event_id]
|
19
|
-
end
|
20
|
-
end
|
21
4
|
end
|
22
|
-
|
23
|
-
ActionController::Base.send(:include, EnjuEvent)
|
data/lib/enju_event/version.rb
CHANGED
@@ -3,7 +3,7 @@ desc "create initial records for enju_event"
|
|
3
3
|
namespace :enju_event do
|
4
4
|
task :setup => :environment do
|
5
5
|
Dir.glob(Rails.root.to_s + '/db/fixtures/enju_event/*.yml').each do |file|
|
6
|
-
ActiveRecord::
|
6
|
+
ActiveRecord::FixtureSet.create_fixtures('db/fixtures/enju_event', File.basename(file, '.*'))
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
@@ -19,7 +19,7 @@ describe EventCategoriesController do
|
|
19
19
|
|
20
20
|
it "assigns all event_categories as @event_categories" do
|
21
21
|
get :index
|
22
|
-
assigns(:event_categories).should eq(EventCategory.
|
22
|
+
assigns(:event_categories).should eq(EventCategory.order(:position))
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -28,7 +28,7 @@ describe EventCategoriesController do
|
|
28
28
|
|
29
29
|
it "assigns all event_categories as @event_categories" do
|
30
30
|
get :index
|
31
|
-
assigns(:event_categories).should eq(EventCategory.
|
31
|
+
assigns(:event_categories).should eq(EventCategory.order(:position))
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -37,14 +37,14 @@ describe EventCategoriesController do
|
|
37
37
|
|
38
38
|
it "assigns all event_categories as @event_categories" do
|
39
39
|
get :index
|
40
|
-
assigns(:event_categories).should eq(EventCategory.
|
40
|
+
assigns(:event_categories).should eq(EventCategory.order(:position))
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
describe "When not logged in" do
|
45
45
|
it "assigns all event_categories as @event_categories" do
|
46
46
|
get :index
|
47
|
-
assigns(:event_categories).should eq(EventCategory.
|
47
|
+
assigns(:event_categories).should eq(EventCategory.order(:position))
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
@@ -55,7 +55,7 @@ describe EventCategoriesController do
|
|
55
55
|
|
56
56
|
it "assigns the requested event_category as @event_category" do
|
57
57
|
event_category = FactoryGirl.create(:event_category)
|
58
|
-
get :show, :
|
58
|
+
get :show, id: event_category.id
|
59
59
|
assigns(:event_category).should eq(event_category)
|
60
60
|
end
|
61
61
|
end
|
@@ -65,7 +65,7 @@ describe EventCategoriesController do
|
|
65
65
|
|
66
66
|
it "assigns the requested event_category as @event_category" do
|
67
67
|
event_category = FactoryGirl.create(:event_category)
|
68
|
-
get :show, :
|
68
|
+
get :show, id: event_category.id
|
69
69
|
assigns(:event_category).should eq(event_category)
|
70
70
|
end
|
71
71
|
end
|
@@ -75,7 +75,7 @@ describe EventCategoriesController do
|
|
75
75
|
|
76
76
|
it "assigns the requested event_category as @event_category" do
|
77
77
|
event_category = FactoryGirl.create(:event_category)
|
78
|
-
get :show, :
|
78
|
+
get :show, id: event_category.id
|
79
79
|
assigns(:event_category).should eq(event_category)
|
80
80
|
end
|
81
81
|
end
|
@@ -83,7 +83,7 @@ describe EventCategoriesController do
|
|
83
83
|
describe "When not logged in" do
|
84
84
|
it "assigns the requested event_category as @event_category" do
|
85
85
|
event_category = FactoryGirl.create(:event_category)
|
86
|
-
get :show, :
|
86
|
+
get :show, id: event_category.id
|
87
87
|
assigns(:event_category).should eq(event_category)
|
88
88
|
end
|
89
89
|
end
|
@@ -105,7 +105,7 @@ describe EventCategoriesController do
|
|
105
105
|
|
106
106
|
it "should not assign the requested event_category as @event_category" do
|
107
107
|
get :new
|
108
|
-
assigns(:event_category).
|
108
|
+
assigns(:event_category).should be_nil
|
109
109
|
response.should be_forbidden
|
110
110
|
end
|
111
111
|
end
|
@@ -115,7 +115,7 @@ describe EventCategoriesController do
|
|
115
115
|
|
116
116
|
it "should not assign the requested event_category as @event_category" do
|
117
117
|
get :new
|
118
|
-
assigns(:event_category).
|
118
|
+
assigns(:event_category).should be_nil
|
119
119
|
response.should be_forbidden
|
120
120
|
end
|
121
121
|
end
|
@@ -123,7 +123,7 @@ describe EventCategoriesController do
|
|
123
123
|
describe "When not logged in" do
|
124
124
|
it "should not assign the requested event_category as @event_category" do
|
125
125
|
get :new
|
126
|
-
assigns(:event_category).
|
126
|
+
assigns(:event_category).should be_nil
|
127
127
|
response.should redirect_to(new_user_session_url)
|
128
128
|
end
|
129
129
|
end
|
@@ -135,7 +135,7 @@ describe EventCategoriesController do
|
|
135
135
|
|
136
136
|
it "assigns the requested event_category as @event_category" do
|
137
137
|
event_category = FactoryGirl.create(:event_category)
|
138
|
-
get :edit, :
|
138
|
+
get :edit, id: event_category.id
|
139
139
|
assigns(:event_category).should eq(event_category)
|
140
140
|
end
|
141
141
|
end
|
@@ -145,7 +145,7 @@ describe EventCategoriesController do
|
|
145
145
|
|
146
146
|
it "assigns the requested event_category as @event_category" do
|
147
147
|
event_category = FactoryGirl.create(:event_category)
|
148
|
-
get :edit, :
|
148
|
+
get :edit, id: event_category.id
|
149
149
|
response.should be_forbidden
|
150
150
|
end
|
151
151
|
end
|
@@ -155,7 +155,7 @@ describe EventCategoriesController do
|
|
155
155
|
|
156
156
|
it "assigns the requested event_category as @event_category" do
|
157
157
|
event_category = FactoryGirl.create(:event_category)
|
158
|
-
get :edit, :
|
158
|
+
get :edit, id: event_category.id
|
159
159
|
response.should be_forbidden
|
160
160
|
end
|
161
161
|
end
|
@@ -163,7 +163,7 @@ describe EventCategoriesController do
|
|
163
163
|
describe "When not logged in" do
|
164
164
|
it "should not assign the requested event_category as @event_category" do
|
165
165
|
event_category = FactoryGirl.create(:event_category)
|
166
|
-
get :edit, :
|
166
|
+
get :edit, id: event_category.id
|
167
167
|
response.should redirect_to(new_user_session_url)
|
168
168
|
end
|
169
169
|
end
|
@@ -180,24 +180,24 @@ describe EventCategoriesController do
|
|
180
180
|
|
181
181
|
describe "with valid params" do
|
182
182
|
it "assigns a newly created event_category as @event_category" do
|
183
|
-
post :create, :
|
183
|
+
post :create, event_category: @attrs
|
184
184
|
assigns(:event_category).should be_valid
|
185
185
|
end
|
186
186
|
|
187
187
|
it "redirects to the created patron" do
|
188
|
-
post :create, :
|
188
|
+
post :create, event_category: @attrs
|
189
189
|
response.should redirect_to(assigns(:event_category))
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
193
193
|
describe "with invalid params" do
|
194
194
|
it "assigns a newly created but unsaved event_category as @event_category" do
|
195
|
-
post :create, :
|
195
|
+
post :create, event_category: @invalid_attrs
|
196
196
|
assigns(:event_category).should_not be_valid
|
197
197
|
end
|
198
198
|
|
199
199
|
it "should be successful" do
|
200
|
-
post :create, :
|
200
|
+
post :create, event_category: @invalid_attrs
|
201
201
|
response.should be_success
|
202
202
|
end
|
203
203
|
end
|
@@ -208,24 +208,24 @@ describe EventCategoriesController do
|
|
208
208
|
|
209
209
|
describe "with valid params" do
|
210
210
|
it "assigns a newly created event_category as @event_category" do
|
211
|
-
post :create, :
|
212
|
-
assigns(:event_category).should
|
211
|
+
post :create, event_category: @attrs
|
212
|
+
assigns(:event_category).should be_nil
|
213
213
|
end
|
214
214
|
|
215
215
|
it "should be forbidden" do
|
216
|
-
post :create, :
|
216
|
+
post :create, event_category: @attrs
|
217
217
|
response.should be_forbidden
|
218
218
|
end
|
219
219
|
end
|
220
220
|
|
221
221
|
describe "with invalid params" do
|
222
222
|
it "assigns a newly created but unsaved event_category as @event_category" do
|
223
|
-
post :create, :
|
224
|
-
assigns(:event_category).
|
223
|
+
post :create, event_category: @invalid_attrs
|
224
|
+
assigns(:event_category).should be_nil
|
225
225
|
end
|
226
226
|
|
227
227
|
it "should be forbidden" do
|
228
|
-
post :create, :
|
228
|
+
post :create, event_category: @invalid_attrs
|
229
229
|
response.should be_forbidden
|
230
230
|
end
|
231
231
|
end
|
@@ -236,24 +236,24 @@ describe EventCategoriesController do
|
|
236
236
|
|
237
237
|
describe "with valid params" do
|
238
238
|
it "assigns a newly created event_category as @event_category" do
|
239
|
-
post :create, :
|
240
|
-
assigns(:event_category).should
|
239
|
+
post :create, event_category: @attrs
|
240
|
+
assigns(:event_category).should be_nil
|
241
241
|
end
|
242
242
|
|
243
243
|
it "should be forbidden" do
|
244
|
-
post :create, :
|
244
|
+
post :create, event_category: @attrs
|
245
245
|
response.should be_forbidden
|
246
246
|
end
|
247
247
|
end
|
248
248
|
|
249
249
|
describe "with invalid params" do
|
250
250
|
it "assigns a newly created but unsaved event_category as @event_category" do
|
251
|
-
post :create, :
|
252
|
-
assigns(:event_category).
|
251
|
+
post :create, event_category: @invalid_attrs
|
252
|
+
assigns(:event_category).should be_nil
|
253
253
|
end
|
254
254
|
|
255
255
|
it "should be forbidden" do
|
256
|
-
post :create, :
|
256
|
+
post :create, event_category: @invalid_attrs
|
257
257
|
response.should be_forbidden
|
258
258
|
end
|
259
259
|
end
|
@@ -262,24 +262,24 @@ describe EventCategoriesController do
|
|
262
262
|
describe "When not logged in" do
|
263
263
|
describe "with valid params" do
|
264
264
|
it "assigns a newly created event_category as @event_category" do
|
265
|
-
post :create, :
|
266
|
-
assigns(:event_category).should
|
265
|
+
post :create, event_category: @attrs
|
266
|
+
assigns(:event_category).should be_nil
|
267
267
|
end
|
268
268
|
|
269
269
|
it "should be forbidden" do
|
270
|
-
post :create, :
|
270
|
+
post :create, event_category: @attrs
|
271
271
|
response.should redirect_to(new_user_session_url)
|
272
272
|
end
|
273
273
|
end
|
274
274
|
|
275
275
|
describe "with invalid params" do
|
276
276
|
it "assigns a newly created but unsaved event_category as @event_category" do
|
277
|
-
post :create, :
|
278
|
-
assigns(:event_category).
|
277
|
+
post :create, event_category: @invalid_attrs
|
278
|
+
assigns(:event_category).should be_nil
|
279
279
|
end
|
280
280
|
|
281
281
|
it "should be forbidden" do
|
282
|
-
post :create, :
|
282
|
+
post :create, event_category: @invalid_attrs
|
283
283
|
response.should redirect_to(new_user_session_url)
|
284
284
|
end
|
285
285
|
end
|
@@ -298,23 +298,23 @@ describe EventCategoriesController do
|
|
298
298
|
|
299
299
|
describe "with valid params" do
|
300
300
|
it "updates the requested event_category" do
|
301
|
-
put :update, :
|
301
|
+
put :update, id: @event_category.id, event_category: @attrs
|
302
302
|
end
|
303
303
|
|
304
304
|
it "assigns the requested event_category as @event_category" do
|
305
|
-
put :update, :
|
305
|
+
put :update, id: @event_category.id, event_category: @attrs
|
306
306
|
assigns(:event_category).should eq(@event_category)
|
307
307
|
end
|
308
308
|
|
309
309
|
it "moves its position when specified" do
|
310
|
-
put :update, :
|
310
|
+
put :update, id: @event_category.id, event_category: @attrs, :move => 'lower'
|
311
311
|
response.should redirect_to(event_categories_url)
|
312
312
|
end
|
313
313
|
end
|
314
314
|
|
315
315
|
describe "with invalid params" do
|
316
316
|
it "assigns the requested event_category as @event_category" do
|
317
|
-
put :update, :
|
317
|
+
put :update, id: @event_category.id, event_category: @invalid_attrs
|
318
318
|
response.should render_template("edit")
|
319
319
|
end
|
320
320
|
end
|
@@ -325,11 +325,11 @@ describe EventCategoriesController do
|
|
325
325
|
|
326
326
|
describe "with valid params" do
|
327
327
|
it "updates the requested event_category" do
|
328
|
-
put :update, :
|
328
|
+
put :update, id: @event_category.id, event_category: @attrs
|
329
329
|
end
|
330
330
|
|
331
331
|
it "assigns the requested event_category as @event_category" do
|
332
|
-
put :update, :
|
332
|
+
put :update, id: @event_category.id, event_category: @attrs
|
333
333
|
assigns(:event_category).should eq(@event_category)
|
334
334
|
response.should be_forbidden
|
335
335
|
end
|
@@ -337,7 +337,7 @@ describe EventCategoriesController do
|
|
337
337
|
|
338
338
|
describe "with invalid params" do
|
339
339
|
it "assigns the requested event_category as @event_category" do
|
340
|
-
put :update, :
|
340
|
+
put :update, id: @event_category.id, event_category: @invalid_attrs
|
341
341
|
response.should be_forbidden
|
342
342
|
end
|
343
343
|
end
|
@@ -348,11 +348,11 @@ describe EventCategoriesController do
|
|
348
348
|
|
349
349
|
describe "with valid params" do
|
350
350
|
it "updates the requested event_category" do
|
351
|
-
put :update, :
|
351
|
+
put :update, id: @event_category.id, event_category: @attrs
|
352
352
|
end
|
353
353
|
|
354
354
|
it "assigns the requested event_category as @event_category" do
|
355
|
-
put :update, :
|
355
|
+
put :update, id: @event_category.id, event_category: @attrs
|
356
356
|
assigns(:event_category).should eq(@event_category)
|
357
357
|
response.should be_forbidden
|
358
358
|
end
|
@@ -360,7 +360,7 @@ describe EventCategoriesController do
|
|
360
360
|
|
361
361
|
describe "with invalid params" do
|
362
362
|
it "assigns the requested event_category as @event_category" do
|
363
|
-
put :update, :
|
363
|
+
put :update, id: @event_category.id, event_category: @invalid_attrs
|
364
364
|
response.should be_forbidden
|
365
365
|
end
|
366
366
|
end
|
@@ -369,18 +369,18 @@ describe EventCategoriesController do
|
|
369
369
|
describe "When not logged in" do
|
370
370
|
describe "with valid params" do
|
371
371
|
it "updates the requested event_category" do
|
372
|
-
put :update, :
|
372
|
+
put :update, id: @event_category.id, event_category: @attrs
|
373
373
|
end
|
374
374
|
|
375
375
|
it "should be forbidden" do
|
376
|
-
put :update, :
|
376
|
+
put :update, id: @event_category.id, event_category: @attrs
|
377
377
|
response.should redirect_to(new_user_session_url)
|
378
378
|
end
|
379
379
|
end
|
380
380
|
|
381
381
|
describe "with invalid params" do
|
382
382
|
it "assigns the requested event_category as @event_category" do
|
383
|
-
put :update, :
|
383
|
+
put :update, id: @event_category.id, event_category: @invalid_attrs
|
384
384
|
response.should redirect_to(new_user_session_url)
|
385
385
|
end
|
386
386
|
end
|
@@ -396,11 +396,11 @@ describe EventCategoriesController do
|
|
396
396
|
login_fixture_admin
|
397
397
|
|
398
398
|
it "destroys the requested event_category" do
|
399
|
-
delete :destroy, :
|
399
|
+
delete :destroy, id: @event_category.id
|
400
400
|
end
|
401
401
|
|
402
402
|
it "redirects to the event_categories list" do
|
403
|
-
delete :destroy, :
|
403
|
+
delete :destroy, id: @event_category.id
|
404
404
|
response.should redirect_to(event_categories_url)
|
405
405
|
end
|
406
406
|
end
|
@@ -409,11 +409,11 @@ describe EventCategoriesController do
|
|
409
409
|
login_fixture_librarian
|
410
410
|
|
411
411
|
it "destroys the requested event_category" do
|
412
|
-
delete :destroy, :
|
412
|
+
delete :destroy, id: @event_category.id
|
413
413
|
end
|
414
414
|
|
415
415
|
it "should be forbidden" do
|
416
|
-
delete :destroy, :
|
416
|
+
delete :destroy, id: @event_category.id
|
417
417
|
response.should be_forbidden
|
418
418
|
end
|
419
419
|
end
|
@@ -422,22 +422,22 @@ describe EventCategoriesController do
|
|
422
422
|
login_fixture_user
|
423
423
|
|
424
424
|
it "destroys the requested event_category" do
|
425
|
-
delete :destroy, :
|
425
|
+
delete :destroy, id: @event_category.id
|
426
426
|
end
|
427
427
|
|
428
428
|
it "should be forbidden" do
|
429
|
-
delete :destroy, :
|
429
|
+
delete :destroy, id: @event_category.id
|
430
430
|
response.should be_forbidden
|
431
431
|
end
|
432
432
|
end
|
433
433
|
|
434
434
|
describe "When not logged in" do
|
435
435
|
it "destroys the requested event_category" do
|
436
|
-
delete :destroy, :
|
436
|
+
delete :destroy, id: @event_category.id
|
437
437
|
end
|
438
438
|
|
439
439
|
it "should be forbidden" do
|
440
|
-
delete :destroy, :
|
440
|
+
delete :destroy, id: @event_category.id
|
441
441
|
response.should redirect_to(new_user_session_url)
|
442
442
|
end
|
443
443
|
end
|