enju_bookmark 0.1.2.pre15 → 0.1.2.pre16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/enju_bookmark/acts_as_taggable_stylesheet.css +7 -0
  3. data/app/controllers/bookmarks_controller.rb +8 -14
  4. data/app/models/bookmark.rb +13 -21
  5. data/app/views/bookmarks/show.html.erb +5 -0
  6. data/lib/enju_bookmark/manifestation.rb +3 -7
  7. data/lib/enju_bookmark/version.rb +1 -1
  8. data/spec/controllers/bookmark_stats_controller_spec.rb +49 -49
  9. data/spec/controllers/bookmarks_controller_spec.rb +76 -76
  10. data/spec/controllers/tags_controller_spec.rb +28 -28
  11. data/spec/dummy/db/test.sqlite3 +0 -0
  12. data/spec/dummy/solr/default/data/index/segments.gen +0 -0
  13. data/spec/dummy/solr/default/data/index/segments_1i0 +0 -0
  14. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001933 +0 -0
  15. data/spec/dummy/solr/default/data/tlog/{tlog.0000000000000001700 → tlog.0000000000000001934} +0 -0
  16. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001935 +0 -0
  17. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001936 +0 -0
  18. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001937 +0 -0
  19. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001938 +0 -0
  20. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001939 +0 -0
  21. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001940 +0 -0
  22. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001941 +0 -0
  23. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001942 +0 -0
  24. data/spec/fixtures/languages.yml +1 -1
  25. data/spec/spec_helper.rb +3 -0
  26. metadata +43 -35
  27. data/app/views/bookmark_stat_has_manifestations/_form.html.erb +0 -15
  28. data/app/views/bookmark_stat_has_manifestations/edit.html.erb +0 -13
  29. data/app/views/bookmark_stat_has_manifestations/index.html.erb +0 -32
  30. data/app/views/bookmark_stat_has_manifestations/new.html.erb +0 -12
  31. data/app/views/bookmark_stat_has_manifestations/show.html.erb +0 -29
  32. data/spec/controllers/bookmark_stat_has_manifestations_controller_spec.rb +0 -443
  33. data/spec/dummy/solr/default/data/index/segments_1bi +0 -0
  34. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001699 +0 -0
  35. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001701 +0 -0
  36. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001702 +0 -0
  37. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001703 +0 -0
  38. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001704 +0 -0
  39. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001705 +0 -0
  40. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001706 +0 -0
  41. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001707 +0 -0
  42. data/spec/dummy/solr/default/data/tlog/tlog.0000000000000001708 +0 -0
@@ -1,443 +0,0 @@
1
- require 'spec_helper'
2
- require 'sunspot/rails/spec_helper'
3
-
4
- describe BookmarkStatHasManifestationsController do
5
- fixtures :all
6
- disconnect_sunspot
7
-
8
- describe "GET index" do
9
- before(:each) do
10
- FactoryGirl.create(:bookmark_stat_has_manifestation)
11
- end
12
-
13
- describe "When logged in as Administrator" do
14
- login_fixture_admin
15
-
16
- it "assigns all bookmark_stat_has_manifestations as @bookmark_stat_has_manifestations" do
17
- get :index
18
- assigns(:bookmark_stat_has_manifestations).should eq(BookmarkStatHasManifestation.all)
19
- end
20
- end
21
-
22
- describe "When logged in as Librarian" do
23
- login_fixture_librarian
24
-
25
- it "assigns all bookmark_stat_has_manifestations as @bookmark_stat_has_manifestations" do
26
- get :index
27
- assigns(:bookmark_stat_has_manifestations).should eq(BookmarkStatHasManifestation.all)
28
- end
29
- end
30
-
31
- describe "When logged in as Manifestation" do
32
- login_fixture_user
33
-
34
- it "assigns all bookmark_stat_has_manifestations as @bookmark_stat_has_manifestations" do
35
- get :index
36
- assigns(:bookmark_stat_has_manifestations).should be_empty
37
- response.should be_forbidden
38
- end
39
- end
40
-
41
- describe "When not logged in" do
42
- it "assigns all bookmark_stat_has_manifestations as @bookmark_stat_has_manifestations" do
43
- get :index
44
- assigns(:bookmark_stat_has_manifestations).should be_empty
45
- response.should redirect_to(new_user_session_url)
46
- end
47
- end
48
- end
49
-
50
- describe "GET show" do
51
- describe "When logged in as Administrator" do
52
- login_fixture_admin
53
-
54
- it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
55
- bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
56
- get :show, :id => bookmark_stat_has_manifestation.id
57
- assigns(:bookmark_stat_has_manifestation).should eq(bookmark_stat_has_manifestation)
58
- end
59
- end
60
-
61
- describe "When logged in as Librarian" do
62
- login_fixture_librarian
63
-
64
- it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
65
- bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
66
- get :show, :id => bookmark_stat_has_manifestation.id
67
- assigns(:bookmark_stat_has_manifestation).should eq(bookmark_stat_has_manifestation)
68
- end
69
- end
70
-
71
- describe "When logged in as Manifestation" do
72
- login_fixture_user
73
-
74
- it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
75
- bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
76
- get :show, :id => bookmark_stat_has_manifestation.id
77
- assigns(:bookmark_stat_has_manifestation).should eq(bookmark_stat_has_manifestation)
78
- end
79
- end
80
-
81
- describe "When not logged in" do
82
- it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
83
- bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
84
- get :show, :id => bookmark_stat_has_manifestation.id
85
- assigns(:bookmark_stat_has_manifestation).should eq(bookmark_stat_has_manifestation)
86
- end
87
- end
88
- end
89
-
90
- describe "GET new" do
91
- describe "When logged in as Administrator" do
92
- login_fixture_admin
93
-
94
- it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
95
- get :new
96
- assigns(:bookmark_stat_has_manifestation).should_not be_valid
97
- response.should be_success
98
- end
99
- end
100
-
101
- describe "When logged in as Librarian" do
102
- login_fixture_librarian
103
-
104
- it "should not assign the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
105
- get :new
106
- assigns(:bookmark_stat_has_manifestation).should_not be_valid
107
- response.should be_forbidden
108
- end
109
- end
110
-
111
- describe "When logged in as Manifestation" do
112
- login_fixture_user
113
-
114
- it "should not assign the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
115
- get :new
116
- assigns(:bookmark_stat_has_manifestation).should_not be_valid
117
- response.should be_forbidden
118
- end
119
- end
120
-
121
- describe "When not logged in" do
122
- it "should not assign the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
123
- get :new
124
- assigns(:bookmark_stat_has_manifestation).should_not be_valid
125
- response.should redirect_to(new_user_session_url)
126
- end
127
- end
128
- end
129
-
130
- describe "GET edit" do
131
- describe "When logged in as Administrator" do
132
- login_fixture_admin
133
-
134
- it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
135
- bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
136
- get :edit, :id => bookmark_stat_has_manifestation.id
137
- assigns(:bookmark_stat_has_manifestation).should eq(bookmark_stat_has_manifestation)
138
- end
139
- end
140
-
141
- describe "When logged in as Librarian" do
142
- login_fixture_librarian
143
-
144
- it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
145
- bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
146
- get :edit, :id => bookmark_stat_has_manifestation.id
147
- assigns(:bookmark_stat_has_manifestation).should eq(bookmark_stat_has_manifestation)
148
- end
149
- end
150
-
151
- describe "When logged in as Manifestation" do
152
- login_fixture_user
153
-
154
- it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
155
- bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
156
- get :edit, :id => bookmark_stat_has_manifestation.id
157
- response.should be_forbidden
158
- end
159
- end
160
-
161
- describe "When not logged in" do
162
- it "should not assign the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
163
- bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
164
- get :edit, :id => bookmark_stat_has_manifestation.id
165
- response.should redirect_to(new_user_session_url)
166
- end
167
- end
168
- end
169
-
170
- describe "POST create" do
171
- before(:each) do
172
- @attrs = FactoryGirl.attributes_for(:bookmark_stat_has_manifestation)
173
- @invalid_attrs = {:bookmark_stat_id => ''}
174
- end
175
-
176
- describe "When logged in as Administrator" do
177
- login_fixture_admin
178
-
179
- describe "with valid params" do
180
- it "assigns a newly created bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
181
- post :create, :bookmark_stat_has_manifestation => @attrs
182
- assigns(:bookmark_stat_has_manifestation).should be_valid
183
- end
184
-
185
- it "redirects to the created patron" do
186
- post :create, :bookmark_stat_has_manifestation => @attrs
187
- response.should redirect_to(assigns(:bookmark_stat_has_manifestation))
188
- end
189
- end
190
-
191
- describe "with invalid params" do
192
- it "assigns a newly created but unsaved bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
193
- post :create, :bookmark_stat_has_manifestation => @invalid_attrs
194
- assigns(:bookmark_stat_has_manifestation).should_not be_valid
195
- end
196
-
197
- it "re-renders the 'new' template" do
198
- post :create, :bookmark_stat_has_manifestation => @invalid_attrs
199
- response.should render_template("new")
200
- end
201
- end
202
- end
203
-
204
- describe "When logged in as Librarian" do
205
- login_fixture_librarian
206
-
207
- describe "with valid params" do
208
- it "assigns a newly created bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
209
- post :create, :bookmark_stat_has_manifestation => @attrs
210
- assigns(:bookmark_stat_has_manifestation).should_not be_valid
211
- end
212
-
213
- it "should be forbidden" do
214
- post :create, :bookmark_stat_has_manifestation => @attrs
215
- response.should be_forbidden
216
- end
217
- end
218
-
219
- describe "with invalid params" do
220
- it "assigns a newly created but unsaved bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
221
- post :create, :bookmark_stat_has_manifestation => @invalid_attrs
222
- assigns(:bookmark_stat_has_manifestation).should_not be_valid
223
- end
224
-
225
- it "should be forbidden" do
226
- post :create, :bookmark_stat_has_manifestation => @invalid_attrs
227
- response.should be_forbidden
228
- end
229
- end
230
- end
231
-
232
- describe "When logged in as Manifestation" do
233
- login_fixture_user
234
-
235
- describe "with valid params" do
236
- it "assigns a newly created bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
237
- post :create, :bookmark_stat_has_manifestation => @attrs
238
- assigns(:bookmark_stat_has_manifestation).should_not be_valid
239
- end
240
-
241
- it "should be forbidden" do
242
- post :create, :bookmark_stat_has_manifestation => @attrs
243
- response.should be_forbidden
244
- end
245
- end
246
-
247
- describe "with invalid params" do
248
- it "assigns a newly created but unsaved bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
249
- post :create, :bookmark_stat_has_manifestation => @invalid_attrs
250
- assigns(:bookmark_stat_has_manifestation).should_not be_valid
251
- end
252
-
253
- it "should be forbidden" do
254
- post :create, :bookmark_stat_has_manifestation => @invalid_attrs
255
- response.should be_forbidden
256
- end
257
- end
258
- end
259
-
260
- describe "When not logged in" do
261
- describe "with valid params" do
262
- it "assigns a newly created bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
263
- post :create, :bookmark_stat_has_manifestation => @attrs
264
- assigns(:bookmark_stat_has_manifestation).should_not be_valid
265
- end
266
-
267
- it "should be forbidden" do
268
- post :create, :bookmark_stat_has_manifestation => @attrs
269
- response.should redirect_to(new_user_session_url)
270
- end
271
- end
272
-
273
- describe "with invalid params" do
274
- it "assigns a newly created but unsaved bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
275
- post :create, :bookmark_stat_has_manifestation => @invalid_attrs
276
- assigns(:bookmark_stat_has_manifestation).should_not be_valid
277
- end
278
-
279
- it "should be forbidden" do
280
- post :create, :bookmark_stat_has_manifestation => @invalid_attrs
281
- response.should redirect_to(new_user_session_url)
282
- end
283
- end
284
- end
285
- end
286
-
287
- describe "PUT update" do
288
- before(:each) do
289
- @bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
290
- @attrs = FactoryGirl.attributes_for(:bookmark_stat_has_manifestation)
291
- @invalid_attrs = {:bookmark_stat_id => ''}
292
- end
293
-
294
- describe "When logged in as Administrator" do
295
- login_fixture_admin
296
-
297
- describe "with valid params" do
298
- it "updates the requested bookmark_stat_has_manifestation" do
299
- put :update, :id => @bookmark_stat_has_manifestation.id, :bookmark_stat_has_manifestation => @attrs
300
- end
301
-
302
- it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
303
- put :update, :id => @bookmark_stat_has_manifestation.id, :bookmark_stat_has_manifestation => @attrs
304
- assigns(:bookmark_stat_has_manifestation).should eq(@bookmark_stat_has_manifestation)
305
- response.should redirect_to(@bookmark_stat_has_manifestation)
306
- end
307
- end
308
-
309
- describe "with invalid params" do
310
- it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
311
- put :update, :id => @bookmark_stat_has_manifestation.id, :bookmark_stat_has_manifestation => @invalid_attrs
312
- response.should render_template("edit")
313
- end
314
- end
315
- end
316
-
317
- describe "When logged in as Librarian" do
318
- login_fixture_librarian
319
-
320
- describe "with valid params" do
321
- it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
322
- put :update, :id => @bookmark_stat_has_manifestation.id, :bookmark_stat_has_manifestation => @attrs
323
- end
324
-
325
- it "should be forbidden" do
326
- put :update, :id => @bookmark_stat_has_manifestation.id, :bookmark_stat_has_manifestation => @attrs
327
- response.should be_forbidden
328
- end
329
- end
330
-
331
- describe "with invalid params" do
332
- it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
333
- put :update, :id => @bookmark_stat_has_manifestation.id, :bookmark_stat_has_manifestation => @invalid_attrs
334
- assigns(:bookmark_stat_has_manifestation).should eq(@bookmark_stat_has_manifestation)
335
- end
336
-
337
- it "should be forbidden" do
338
- put :update, :id => @bookmark_stat_has_manifestation.id, :bookmark_stat_has_manifestation => @invalid_attrs
339
- response.should be_forbidden
340
- end
341
- end
342
- end
343
-
344
- describe "When logged in as Manifestation" do
345
- login_fixture_user
346
-
347
- describe "with valid params" do
348
- it "updates the requested bookmark_stat_has_manifestation" do
349
- put :update, :id => @bookmark_stat_has_manifestation.id, :bookmark_stat_has_manifestation => @attrs
350
- end
351
-
352
- it "should be forbidden" do
353
- put :update, :id => @bookmark_stat_has_manifestation.id, :bookmark_stat_has_manifestation => @attrs
354
- assigns(:bookmark_stat_has_manifestation).should eq(@bookmark_stat_has_manifestation)
355
- response.should be_forbidden
356
- end
357
- end
358
-
359
- describe "with invalid params" do
360
- it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
361
- put :update, :id => @bookmark_stat_has_manifestation.id, :bookmark_stat_has_manifestation => @invalid_attrs
362
- response.should be_forbidden
363
- end
364
- end
365
- end
366
-
367
- describe "When not logged in" do
368
- describe "with valid params" do
369
- it "updates the requested bookmark_stat_has_manifestation" do
370
- put :update, :id => @bookmark_stat_has_manifestation.id, :bookmark_stat_has_manifestation => @attrs
371
- end
372
-
373
- it "should be forbidden" do
374
- put :update, :id => @bookmark_stat_has_manifestation.id, :bookmark_stat_has_manifestation => @attrs
375
- response.should redirect_to(new_user_session_url)
376
- end
377
- end
378
-
379
- describe "with invalid params" do
380
- it "assigns the requested bookmark_stat_has_manifestation as @bookmark_stat_has_manifestation" do
381
- put :update, :id => @bookmark_stat_has_manifestation.id, :bookmark_stat_has_manifestation => @invalid_attrs
382
- response.should redirect_to(new_user_session_url)
383
- end
384
- end
385
- end
386
- end
387
-
388
- describe "DELETE destroy" do
389
- before(:each) do
390
- @bookmark_stat_has_manifestation = FactoryGirl.create(:bookmark_stat_has_manifestation)
391
- end
392
-
393
- describe "When logged in as Administrator" do
394
- login_fixture_admin
395
-
396
- it "destroys the requested bookmark_stat_has_manifestation" do
397
- delete :destroy, :id => @bookmark_stat_has_manifestation.id
398
- end
399
-
400
- it "redirects to the bookmark_stat_has_manifestations list" do
401
- delete :destroy, :id => @bookmark_stat_has_manifestation.id
402
- response.should redirect_to(bookmark_stat_has_manifestations_url)
403
- end
404
- end
405
-
406
- describe "When logged in as Librarian" do
407
- login_fixture_librarian
408
-
409
- it "destroys the requested bookmark_stat_has_manifestation" do
410
- delete :destroy, :id => @bookmark_stat_has_manifestation.id
411
- end
412
-
413
- it "redirects to the bookmark_stat_has_manifestations list" do
414
- delete :destroy, :id => @bookmark_stat_has_manifestation.id
415
- response.should be_forbidden
416
- end
417
- end
418
-
419
- describe "When logged in as Manifestation" do
420
- login_fixture_user
421
-
422
- it "destroys the requested bookmark_stat_has_manifestation" do
423
- delete :destroy, :id => @bookmark_stat_has_manifestation.id
424
- end
425
-
426
- it "should be forbidden" do
427
- delete :destroy, :id => @bookmark_stat_has_manifestation.id
428
- response.should be_forbidden
429
- end
430
- end
431
-
432
- describe "When not logged in" do
433
- it "destroys the requested bookmark_stat_has_manifestation" do
434
- delete :destroy, :id => @bookmark_stat_has_manifestation.id
435
- end
436
-
437
- it "should be forbidden" do
438
- delete :destroy, :id => @bookmark_stat_has_manifestation.id
439
- response.should redirect_to(new_user_session_url)
440
- end
441
- end
442
- end
443
- end