enju_library 0.1.2 → 0.2.0.beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +3 -3
  3. data/Rakefile +15 -8
  4. data/app/controllers/accepts_controller.rb +13 -3
  5. data/app/controllers/baskets_controller.rb +11 -1
  6. data/app/controllers/bookstores_controller.rb +12 -1
  7. data/app/controllers/budget_types_controller.rb +13 -2
  8. data/app/controllers/concerns/enju_library/controller.rb +43 -0
  9. data/app/controllers/libraries_controller.rb +13 -4
  10. data/app/controllers/library_groups_controller.rb +16 -6
  11. data/app/controllers/request_status_types_controller.rb +13 -2
  12. data/app/controllers/request_types_controller.rb +13 -2
  13. data/app/controllers/search_engines_controller.rb +13 -2
  14. data/app/controllers/shelves_controller.rb +14 -4
  15. data/app/controllers/subscribes_controller.rb +12 -2
  16. data/app/controllers/subscriptions_controller.rb +12 -3
  17. data/app/controllers/withdraws_controller.rb +14 -3
  18. data/app/helpers/shelves_helper.rb +2 -2
  19. data/app/models/accept.rb +2 -4
  20. data/app/models/basket.rb +0 -2
  21. data/app/models/budget_type.rb +0 -1
  22. data/app/models/concerns/enju_library/enju_item.rb +32 -0
  23. data/app/models/library_group.rb +9 -16
  24. data/app/models/request_status_type.rb +0 -1
  25. data/app/models/request_type.rb +0 -1
  26. data/app/models/search_engine.rb +0 -1
  27. data/app/models/withdraw.rb +8 -4
  28. data/app/policies/accept_policy.rb +21 -0
  29. data/app/policies/basket_policy.rb +21 -0
  30. data/app/policies/bookstore_policy.rb +23 -0
  31. data/app/policies/budget_type_policy.rb +21 -0
  32. data/app/policies/library_group_policy.rb +23 -0
  33. data/app/policies/library_policy.rb +25 -0
  34. data/app/policies/request_status_type_policy.rb +21 -0
  35. data/app/policies/request_type_policy.rb +21 -0
  36. data/app/policies/search_engine_policy.rb +21 -0
  37. data/app/policies/shelf_policy.rb +23 -0
  38. data/app/policies/subscribe_policy.rb +21 -0
  39. data/app/policies/subscription_policy.rb +21 -0
  40. data/app/policies/withdraw_policy.rb +21 -0
  41. data/app/views/accepts/index.html.erb +1 -1
  42. data/app/views/accepts/show.html.erb +1 -1
  43. data/app/views/baskets/edit.html.erb +1 -1
  44. data/app/views/baskets/new.html.erb +3 -1
  45. data/app/views/bookstores/index.html.erb +4 -4
  46. data/app/views/bookstores/show.html.erb +2 -2
  47. data/app/views/budget_types/index.html.erb +4 -4
  48. data/app/views/budget_types/show.html.erb +2 -2
  49. data/app/views/libraries/{_map.mobile.erb → _map.html+phone.erb} +0 -0
  50. data/app/views/libraries/index.html.erb +4 -4
  51. data/app/views/libraries/{show.mobile.erb → show.html+phone.erb} +0 -0
  52. data/app/views/libraries/show.html.erb +5 -5
  53. data/app/views/library_groups/_color_fields.html.erb +5 -0
  54. data/app/views/library_groups/_form.html.erb +17 -7
  55. data/app/views/library_groups/edit.html.erb +1 -1
  56. data/app/views/library_groups/index.html.erb +1 -1
  57. data/app/views/library_groups/show.html.erb +6 -2
  58. data/app/views/picture_files/_index_shelf.html.erb +4 -4
  59. data/app/views/request_status_types/index.html.erb +6 -4
  60. data/app/views/request_status_types/show.html.erb +1 -1
  61. data/app/views/request_types/index.html.erb +6 -4
  62. data/app/views/request_types/show.html.erb +1 -1
  63. data/app/views/search_engines/index.html.erb +4 -4
  64. data/app/views/search_engines/show.html.erb +2 -2
  65. data/app/views/shelves/_library_facet.html.erb +1 -1
  66. data/app/views/shelves/index.html.erb +4 -4
  67. data/app/views/shelves/{show.mobile.erb → show.html+phone.erb} +0 -0
  68. data/app/views/shelves/show.html.erb +3 -3
  69. data/app/views/subscriptions/index.html.erb +3 -1
  70. data/app/views/subscriptions/show.html.erb +1 -1
  71. data/app/views/withdraws/index.html.erb +1 -1
  72. data/app/views/withdraws/show.html.erb +1 -1
  73. data/config/locales/translation_en.yml +2 -1
  74. data/config/locales/translation_ja.yml +2 -1
  75. data/db/migrate/20151213070943_add_translation_table_to_library_group.rb +13 -0
  76. data/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +9 -0
  77. data/lib/enju_library/engine.rb +3 -0
  78. data/lib/enju_library/version.rb +1 -1
  79. data/lib/enju_library.rb +0 -41
  80. data/lib/generators/enju_library/setup/setup_generator.rb +2 -0
  81. data/lib/generators/enju_library/setup/templates/db/fixtures/library_group/translations.yml +10 -0
  82. data/lib/tasks/enju_library_tasks.rake +6 -2
  83. data/spec/controllers/accepts_controller_spec.rb +6 -6
  84. data/spec/controllers/baskets_controller_spec.rb +7 -7
  85. data/spec/controllers/bookstores_controller_spec.rb +11 -11
  86. data/spec/controllers/budget_types_controller_spec.rb +1 -1
  87. data/spec/controllers/libraries_controller_spec.rb +9 -9
  88. data/spec/controllers/library_groups_controller_spec.rb +3 -3
  89. data/spec/controllers/request_status_types_controller_spec.rb +16 -16
  90. data/spec/controllers/request_types_controller_spec.rb +16 -16
  91. data/spec/controllers/search_engines_controller_spec.rb +13 -13
  92. data/spec/controllers/shelves_controller_spec.rb +10 -9
  93. data/spec/controllers/subscribes_controller_spec.rb +8 -8
  94. data/spec/controllers/subscriptions_controller_spec.rb +8 -8
  95. data/spec/controllers/withdraws_controller_spec.rb +11 -3
  96. data/spec/dummy/app/controllers/application_controller.rb +6 -3
  97. data/spec/dummy/app/models/user.rb +2 -2
  98. data/spec/dummy/config/application.rb +8 -38
  99. data/spec/dummy/config/environments/development.rb +22 -18
  100. data/spec/dummy/config/environments/production.rb +46 -34
  101. data/spec/dummy/config/environments/test.rb +21 -14
  102. data/spec/dummy/config/initializers/enju_leaf.rb +6 -0
  103. data/spec/dummy/db/schema.rb +13 -1
  104. data/spec/models/withdraw_spec.rb +2 -0
  105. data/spec/spec_helper.rb +1 -1
  106. data/spec/views/accepts/index.html.erb_spec.rb +1 -0
  107. data/spec/views/budget_types/index.html.erb_spec.rb +1 -0
  108. data/spec/views/budget_types/show.html.erb_spec.rb +1 -0
  109. data/spec/views/libraries/show.html.erb_spec.rb +2 -1
  110. data/spec/views/library_groups/edit.html.erb_spec.rb +1 -0
  111. data/spec/views/library_groups/show.html.erb_spec.rb +2 -0
  112. data/spec/views/withdraws/index.html.erb_spec.rb +2 -0
  113. metadata +52 -105
  114. data/app/models/enju_library/ability.rb +0 -72
  115. data/lib/enju_library/item.rb +0 -39
  116. data/spec/dummy/app/models/ability.rb +0 -68
@@ -100,7 +100,7 @@ describe LibrariesController do
100
100
 
101
101
  it "assigns the requested library as @library" do
102
102
  get :new
103
- assigns(:library).should_not be_valid
103
+ assigns(:library).should be_nil
104
104
  end
105
105
  end
106
106
 
@@ -109,7 +109,7 @@ describe LibrariesController do
109
109
 
110
110
  it "should not assign the requested library as @library" do
111
111
  get :new
112
- assigns(:library).should_not be_valid
112
+ assigns(:library).should be_nil
113
113
  response.should be_forbidden
114
114
  end
115
115
  end
@@ -117,7 +117,7 @@ describe LibrariesController do
117
117
  describe "When not logged in" do
118
118
  it "should not assign the requested library as @library" do
119
119
  get :new
120
- assigns(:library).should_not be_valid
120
+ assigns(:library).should be_nil
121
121
  response.should redirect_to(new_user_session_url)
122
122
  end
123
123
  end
@@ -208,7 +208,7 @@ describe LibrariesController do
208
208
  describe "with valid params" do
209
209
  it "assigns a newly created library as @library" do
210
210
  post :create, :library => @attrs
211
- assigns(:library).should be_valid
211
+ assigns(:library).should be_nil
212
212
  end
213
213
 
214
214
  it "should be forbidden" do
@@ -220,7 +220,7 @@ describe LibrariesController do
220
220
  describe "with invalid params" do
221
221
  it "assigns a newly created but unsaved library as @library" do
222
222
  post :create, :library => @invalid_attrs
223
- assigns(:library).should_not be_valid
223
+ assigns(:library).should be_nil
224
224
  end
225
225
 
226
226
  it "should be forbidden" do
@@ -236,7 +236,7 @@ describe LibrariesController do
236
236
  describe "with valid params" do
237
237
  it "assigns a newly created library as @library" do
238
238
  post :create, :library => @attrs
239
- assigns(:library).should be_valid
239
+ assigns(:library).should be_nil
240
240
  end
241
241
 
242
242
  it "should be forbidden" do
@@ -248,7 +248,7 @@ describe LibrariesController do
248
248
  describe "with invalid params" do
249
249
  it "assigns a newly created but unsaved library as @library" do
250
250
  post :create, :library => @invalid_attrs
251
- assigns(:library).should_not be_valid
251
+ assigns(:library).should be_nil
252
252
  end
253
253
 
254
254
  it "should be forbidden" do
@@ -262,7 +262,7 @@ describe LibrariesController do
262
262
  describe "with valid params" do
263
263
  it "assigns a newly created library as @library" do
264
264
  post :create, :library => @attrs
265
- assigns(:library).should be_valid
265
+ assigns(:library).should be_nil
266
266
  end
267
267
 
268
268
  it "should be redirected to new session url" do
@@ -274,7 +274,7 @@ describe LibrariesController do
274
274
  describe "with invalid params" do
275
275
  it "assigns a newly created but unsaved library as @library" do
276
276
  post :create, :library => @invalid_attrs
277
- assigns(:library).should_not be_valid
277
+ assigns(:library).should be_nil
278
278
  end
279
279
 
280
280
  it "should be redirected to new session url" do
@@ -16,8 +16,8 @@ describe LibraryGroupsController do
16
16
  describe "When not logged in" do
17
17
  it "assigns all library_groups as @library_groups" do
18
18
  get :index
19
- assigns(:library_groups).should_not be_empty
20
- response.should be_success
19
+ assigns(:library_groups).should be_nil
20
+ response.should redirect_to(new_user_session_url)
21
21
  end
22
22
  end
23
23
  end
@@ -36,7 +36,7 @@ describe LibraryGroupsController do
36
36
  it "assigns the requested library_group as @library_group" do
37
37
  get :show, :id => 1
38
38
  assigns(:library_group).should eq(LibraryGroup.find(1))
39
- response.should be_success
39
+ response.should redirect_to(new_user_session_url)
40
40
  end
41
41
  end
42
42
  end
@@ -19,7 +19,7 @@ describe RequestStatusTypesController do
19
19
 
20
20
  it "assigns all request_status_types as @request_status_types" do
21
21
  get :index
22
- assigns(:request_status_types).should eq(RequestStatusType.all)
22
+ assigns(:request_status_types).should eq(RequestStatusType.order(:position))
23
23
  end
24
24
  end
25
25
 
@@ -28,7 +28,7 @@ describe RequestStatusTypesController do
28
28
 
29
29
  it "assigns all request_status_types as @request_status_types" do
30
30
  get :index
31
- assigns(:request_status_types).should eq(RequestStatusType.all)
31
+ assigns(:request_status_types).should eq(RequestStatusType.order(:position))
32
32
  end
33
33
  end
34
34
 
@@ -37,7 +37,7 @@ describe RequestStatusTypesController do
37
37
 
38
38
  it "should not assign request_status_types as @request_status_types" do
39
39
  get :index
40
- assigns(:request_status_types).should be_empty
40
+ assigns(:request_status_types).should be_nil
41
41
  response.should be_forbidden
42
42
  end
43
43
  end
@@ -45,7 +45,7 @@ describe RequestStatusTypesController do
45
45
  describe "When not logged in" do
46
46
  it "should not assign request_status_types as @request_status_types" do
47
47
  get :index
48
- assigns(:request_status_types).should be_empty
48
+ assigns(:request_status_types).should be_nil
49
49
  response.should redirect_to(new_user_session_url)
50
50
  end
51
51
  end
@@ -97,7 +97,7 @@ describe RequestStatusTypesController do
97
97
 
98
98
  it "assigns the requested request_status_type as @request_status_type" do
99
99
  get :new
100
- assigns(:request_status_type).should_not be_valid
100
+ assigns(:request_status_type).should be_nil
101
101
  response.should be_forbidden
102
102
  end
103
103
  end
@@ -107,7 +107,7 @@ describe RequestStatusTypesController do
107
107
 
108
108
  it "should not assign the requested request_status_type as @request_status_type" do
109
109
  get :new
110
- assigns(:request_status_type).should_not be_valid
110
+ assigns(:request_status_type).should be_nil
111
111
  response.should be_forbidden
112
112
  end
113
113
  end
@@ -117,7 +117,7 @@ describe RequestStatusTypesController do
117
117
 
118
118
  it "should not assign the requested request_status_type as @request_status_type" do
119
119
  get :new
120
- assigns(:request_status_type).should_not be_valid
120
+ assigns(:request_status_type).should be_nil
121
121
  response.should be_forbidden
122
122
  end
123
123
  end
@@ -125,7 +125,7 @@ describe RequestStatusTypesController do
125
125
  describe "When not logged in" do
126
126
  it "should not assign the requested request_status_type as @request_status_type" do
127
127
  get :new
128
- assigns(:request_status_type).should_not be_valid
128
+ assigns(:request_status_type).should be_nil
129
129
  response.should redirect_to(new_user_session_url)
130
130
  end
131
131
  end
@@ -183,7 +183,7 @@ describe RequestStatusTypesController do
183
183
  describe "with valid params" do
184
184
  it "assigns a newly created request_status_type as @request_status_type" do
185
185
  post :create, :request_status_type => @attrs
186
- assigns(:request_status_type).should be_valid
186
+ assigns(:request_status_type).should be_nil
187
187
  end
188
188
 
189
189
  it "should be forbidden" do
@@ -195,7 +195,7 @@ describe RequestStatusTypesController do
195
195
  describe "with invalid params" do
196
196
  it "assigns a newly created but unsaved request_status_type as @request_status_type" do
197
197
  post :create, :request_status_type => @invalid_attrs
198
- assigns(:request_status_type).should_not be_valid
198
+ assigns(:request_status_type).should be_nil
199
199
  end
200
200
 
201
201
  it "should be forbidden" do
@@ -211,7 +211,7 @@ describe RequestStatusTypesController do
211
211
  describe "with valid params" do
212
212
  it "assigns a newly created request_status_type as @request_status_type" do
213
213
  post :create, :request_status_type => @attrs
214
- assigns(:request_status_type).should be_valid
214
+ assigns(:request_status_type).should be_nil
215
215
  end
216
216
 
217
217
  it "should be forbidden" do
@@ -223,7 +223,7 @@ describe RequestStatusTypesController do
223
223
  describe "with invalid params" do
224
224
  it "assigns a newly created but unsaved request_status_type as @request_status_type" do
225
225
  post :create, :request_status_type => @invalid_attrs
226
- assigns(:request_status_type).should_not be_valid
226
+ assigns(:request_status_type).should be_nil
227
227
  end
228
228
 
229
229
  it "should be forbidden" do
@@ -239,7 +239,7 @@ describe RequestStatusTypesController do
239
239
  describe "with valid params" do
240
240
  it "assigns a newly created request_status_type as @request_status_type" do
241
241
  post :create, :request_status_type => @attrs
242
- assigns(:request_status_type).should be_valid
242
+ assigns(:request_status_type).should be_nil
243
243
  end
244
244
 
245
245
  it "should be forbidden" do
@@ -251,7 +251,7 @@ describe RequestStatusTypesController do
251
251
  describe "with invalid params" do
252
252
  it "assigns a newly created but unsaved request_status_type as @request_status_type" do
253
253
  post :create, :request_status_type => @invalid_attrs
254
- assigns(:request_status_type).should_not be_valid
254
+ assigns(:request_status_type).should be_nil
255
255
  end
256
256
 
257
257
  it "should be forbidden" do
@@ -265,7 +265,7 @@ describe RequestStatusTypesController do
265
265
  describe "with valid params" do
266
266
  it "assigns a newly created request_status_type as @request_status_type" do
267
267
  post :create, :request_status_type => @attrs
268
- assigns(:request_status_type).should be_valid
268
+ assigns(:request_status_type).should be_nil
269
269
  end
270
270
 
271
271
  it "should be forbidden" do
@@ -277,7 +277,7 @@ describe RequestStatusTypesController do
277
277
  describe "with invalid params" do
278
278
  it "assigns a newly created but unsaved request_status_type as @request_status_type" do
279
279
  post :create, :request_status_type => @invalid_attrs
280
- assigns(:request_status_type).should_not be_valid
280
+ assigns(:request_status_type).should be_nil
281
281
  end
282
282
 
283
283
  it "should be forbidden" do
@@ -19,7 +19,7 @@ describe RequestTypesController do
19
19
 
20
20
  it "assigns all request_types as @request_types" do
21
21
  get :index
22
- assigns(:request_types).should eq(RequestType.all)
22
+ assigns(:request_types).should eq(RequestType.order(:position))
23
23
  end
24
24
  end
25
25
 
@@ -28,7 +28,7 @@ describe RequestTypesController do
28
28
 
29
29
  it "assigns all request_types as @request_types" do
30
30
  get :index
31
- assigns(:request_types).should eq(RequestType.all)
31
+ assigns(:request_types).should eq(RequestType.order(:position))
32
32
  end
33
33
  end
34
34
 
@@ -37,7 +37,7 @@ describe RequestTypesController do
37
37
 
38
38
  it "should not assign request_types as @request_types" do
39
39
  get :index
40
- assigns(:request_types).should be_empty
40
+ assigns(:request_types).should be_nil
41
41
  response.should be_forbidden
42
42
  end
43
43
  end
@@ -45,7 +45,7 @@ describe RequestTypesController do
45
45
  describe "When not logged in" do
46
46
  it "should not assign request_types as @request_types" do
47
47
  get :index
48
- assigns(:request_types).should be_empty
48
+ assigns(:request_types).should be_nil
49
49
  response.should redirect_to(new_user_session_url)
50
50
  end
51
51
  end
@@ -97,7 +97,7 @@ describe RequestTypesController do
97
97
 
98
98
  it "assigns the requested request_type as @request_type" do
99
99
  get :new
100
- assigns(:request_type).should_not be_valid
100
+ assigns(:request_type).should be_nil
101
101
  response.should be_forbidden
102
102
  end
103
103
  end
@@ -107,7 +107,7 @@ describe RequestTypesController do
107
107
 
108
108
  it "should not assign the requested request_type as @request_type" do
109
109
  get :new
110
- assigns(:request_type).should_not be_valid
110
+ assigns(:request_type).should be_nil
111
111
  response.should be_forbidden
112
112
  end
113
113
  end
@@ -117,7 +117,7 @@ describe RequestTypesController do
117
117
 
118
118
  it "should not assign the requested request_type as @request_type" do
119
119
  get :new
120
- assigns(:request_type).should_not be_valid
120
+ assigns(:request_type).should be_nil
121
121
  response.should be_forbidden
122
122
  end
123
123
  end
@@ -125,7 +125,7 @@ describe RequestTypesController do
125
125
  describe "When not logged in" do
126
126
  it "should not assign the requested request_type as @request_type" do
127
127
  get :new
128
- assigns(:request_type).should_not be_valid
128
+ assigns(:request_type).should be_nil
129
129
  response.should redirect_to(new_user_session_url)
130
130
  end
131
131
  end
@@ -183,7 +183,7 @@ describe RequestTypesController do
183
183
  describe "with valid params" do
184
184
  it "assigns a newly created request_type as @request_type" do
185
185
  post :create, :request_type => @attrs
186
- assigns(:request_type).should be_valid
186
+ assigns(:request_type).should be_nil
187
187
  end
188
188
 
189
189
  it "should be forbidden" do
@@ -195,7 +195,7 @@ describe RequestTypesController do
195
195
  describe "with invalid params" do
196
196
  it "assigns a newly created but unsaved request_type as @request_type" do
197
197
  post :create, :request_type => @invalid_attrs
198
- assigns(:request_type).should_not be_valid
198
+ assigns(:request_type).should be_nil
199
199
  end
200
200
 
201
201
  it "should be forbidden" do
@@ -211,7 +211,7 @@ describe RequestTypesController do
211
211
  describe "with valid params" do
212
212
  it "assigns a newly created request_type as @request_type" do
213
213
  post :create, :request_type => @attrs
214
- assigns(:request_type).should be_valid
214
+ assigns(:request_type).should be_nil
215
215
  end
216
216
 
217
217
  it "should be forbidden" do
@@ -223,7 +223,7 @@ describe RequestTypesController do
223
223
  describe "with invalid params" do
224
224
  it "assigns a newly created but unsaved request_type as @request_type" do
225
225
  post :create, :request_type => @invalid_attrs
226
- assigns(:request_type).should_not be_valid
226
+ assigns(:request_type).should be_nil
227
227
  end
228
228
 
229
229
  it "should be forbidden" do
@@ -239,7 +239,7 @@ describe RequestTypesController do
239
239
  describe "with valid params" do
240
240
  it "assigns a newly created request_type as @request_type" do
241
241
  post :create, :request_type => @attrs
242
- assigns(:request_type).should be_valid
242
+ assigns(:request_type).should be_nil
243
243
  end
244
244
 
245
245
  it "should be forbidden" do
@@ -251,7 +251,7 @@ describe RequestTypesController do
251
251
  describe "with invalid params" do
252
252
  it "assigns a newly created but unsaved request_type as @request_type" do
253
253
  post :create, :request_type => @invalid_attrs
254
- assigns(:request_type).should_not be_valid
254
+ assigns(:request_type).should be_nil
255
255
  end
256
256
 
257
257
  it "should be forbidden" do
@@ -265,7 +265,7 @@ describe RequestTypesController do
265
265
  describe "with valid params" do
266
266
  it "assigns a newly created request_type as @request_type" do
267
267
  post :create, :request_type => @attrs
268
- assigns(:request_type).should be_valid
268
+ assigns(:request_type).should be_nil
269
269
  end
270
270
 
271
271
  it "should be forbidden" do
@@ -277,7 +277,7 @@ describe RequestTypesController do
277
277
  describe "with invalid params" do
278
278
  it "assigns a newly created but unsaved request_type as @request_type" do
279
279
  post :create, :request_type => @invalid_attrs
280
- assigns(:request_type).should_not be_valid
280
+ assigns(:request_type).should be_nil
281
281
  end
282
282
 
283
283
  it "should be forbidden" do
@@ -19,7 +19,7 @@ describe SearchEnginesController do
19
19
 
20
20
  it "assigns all search_engines as @search_engines" do
21
21
  get :index
22
- assigns(:search_engines).should eq(SearchEngine.all)
22
+ assigns(:search_engines).should eq(SearchEngine.order(:position))
23
23
  end
24
24
  end
25
25
 
@@ -28,7 +28,7 @@ describe SearchEnginesController do
28
28
 
29
29
  it "assigns all search_engines as @search_engines" do
30
30
  get :index
31
- assigns(:search_engines).should eq(SearchEngine.all)
31
+ assigns(:search_engines).should eq(SearchEngine.order(:position))
32
32
  end
33
33
  end
34
34
 
@@ -37,7 +37,7 @@ describe SearchEnginesController do
37
37
 
38
38
  it "assigns all search_engines as @search_engines" do
39
39
  get :index
40
- assigns(:search_engines).should be_empty
40
+ assigns(:search_engines).should be_nil
41
41
  response.should be_forbidden
42
42
  end
43
43
  end
@@ -45,7 +45,7 @@ describe SearchEnginesController do
45
45
  describe "When not logged in" do
46
46
  it "assigns all search_engines as @search_engines" do
47
47
  get :index
48
- assigns(:search_engines).should be_empty
48
+ assigns(:search_engines).should be_nil
49
49
  response.should redirect_to(new_user_session_url)
50
50
  end
51
51
  end
@@ -107,7 +107,7 @@ describe SearchEnginesController do
107
107
 
108
108
  it "should not assign the requested search_engine as @search_engine" do
109
109
  get :new
110
- assigns(:search_engine).should_not be_valid
110
+ assigns(:search_engine).should be_nil
111
111
  response.should be_forbidden
112
112
  end
113
113
  end
@@ -117,7 +117,7 @@ describe SearchEnginesController do
117
117
 
118
118
  it "should not assign the requested search_engine as @search_engine" do
119
119
  get :new
120
- assigns(:search_engine).should_not be_valid
120
+ assigns(:search_engine).should be_nil
121
121
  response.should be_forbidden
122
122
  end
123
123
  end
@@ -125,7 +125,7 @@ describe SearchEnginesController do
125
125
  describe "When not logged in" do
126
126
  it "should not assign the requested search_engine as @search_engine" do
127
127
  get :new
128
- assigns(:search_engine).should_not be_valid
128
+ assigns(:search_engine).should be_nil
129
129
  response.should redirect_to(new_user_session_url)
130
130
  end
131
131
  end
@@ -211,7 +211,7 @@ describe SearchEnginesController do
211
211
  describe "with valid params" do
212
212
  it "assigns a newly created search_engine as @search_engine" do
213
213
  post :create, :search_engine => @attrs
214
- assigns(:search_engine).should be_valid
214
+ assigns(:search_engine).should be_nil
215
215
  end
216
216
 
217
217
  it "should be forbidden" do
@@ -223,7 +223,7 @@ describe SearchEnginesController do
223
223
  describe "with invalid params" do
224
224
  it "assigns a newly created but unsaved search_engine as @search_engine" do
225
225
  post :create, :search_engine => @invalid_attrs
226
- assigns(:search_engine).should_not be_valid
226
+ assigns(:search_engine).should be_nil
227
227
  end
228
228
 
229
229
  it "should be forbidden" do
@@ -239,7 +239,7 @@ describe SearchEnginesController do
239
239
  describe "with valid params" do
240
240
  it "assigns a newly created search_engine as @search_engine" do
241
241
  post :create, :search_engine => @attrs
242
- assigns(:search_engine).should be_valid
242
+ assigns(:search_engine).should be_nil
243
243
  end
244
244
 
245
245
  it "should be forbidden" do
@@ -251,7 +251,7 @@ describe SearchEnginesController do
251
251
  describe "with invalid params" do
252
252
  it "assigns a newly created but unsaved search_engine as @search_engine" do
253
253
  post :create, :search_engine => @invalid_attrs
254
- assigns(:search_engine).should_not be_valid
254
+ assigns(:search_engine).should be_nil
255
255
  end
256
256
 
257
257
  it "should be forbidden" do
@@ -265,7 +265,7 @@ describe SearchEnginesController do
265
265
  describe "with valid params" do
266
266
  it "assigns a newly created search_engine as @search_engine" do
267
267
  post :create, :search_engine => @attrs
268
- assigns(:search_engine).should be_valid
268
+ assigns(:search_engine).should be_nil
269
269
  end
270
270
 
271
271
  it "should be forbidden" do
@@ -277,7 +277,7 @@ describe SearchEnginesController do
277
277
  describe "with invalid params" do
278
278
  it "assigns a newly created but unsaved search_engine as @search_engine" do
279
279
  post :create, :search_engine => @invalid_attrs
280
- assigns(:search_engine).should_not be_valid
280
+ assigns(:search_engine).should be_nil
281
281
  end
282
282
 
283
283
  it "should be forbidden" do
@@ -93,7 +93,8 @@ describe ShelvesController do
93
93
 
94
94
  it "assigns the requested shelf as @shelf" do
95
95
  get :new
96
- assigns(:shelf).should_not be_valid
96
+ assigns(:shelf).should be_nil
97
+ response.should be_forbidden
97
98
  end
98
99
  end
99
100
 
@@ -102,7 +103,7 @@ describe ShelvesController do
102
103
 
103
104
  it "should not assign the requested shelf as @shelf" do
104
105
  get :new
105
- assigns(:shelf).should_not be_valid
106
+ assigns(:shelf).should be_nil
106
107
  response.should be_forbidden
107
108
  end
108
109
  end
@@ -110,7 +111,7 @@ describe ShelvesController do
110
111
  describe "When not logged in" do
111
112
  it "should not assign the requested shelf as @shelf" do
112
113
  get :new
113
- assigns(:shelf).should_not be_valid
114
+ assigns(:shelf).should be_nil
114
115
  response.should redirect_to(new_user_session_url)
115
116
  end
116
117
  end
@@ -196,7 +197,7 @@ describe ShelvesController do
196
197
  describe "with valid params" do
197
198
  it "assigns a newly created shelf as @shelf" do
198
199
  post :create, :shelf => @attrs
199
- assigns(:shelf).should be_valid
200
+ assigns(:shelf).should be_nil
200
201
  end
201
202
 
202
203
  it "should be forbidden" do
@@ -208,7 +209,7 @@ describe ShelvesController do
208
209
  describe "with invalid params" do
209
210
  it "assigns a newly created but unsaved shelf as @shelf" do
210
211
  post :create, :shelf => @invalid_attrs
211
- assigns(:shelf).should_not be_valid
212
+ assigns(:shelf).should be_nil
212
213
  end
213
214
 
214
215
  it "should be forbidden" do
@@ -224,7 +225,7 @@ describe ShelvesController do
224
225
  describe "with valid params" do
225
226
  it "assigns a newly created shelf as @shelf" do
226
227
  post :create, :shelf => @attrs
227
- assigns(:shelf).should be_valid
228
+ assigns(:shelf).should be_nil
228
229
  end
229
230
 
230
231
  it "should be forbidden" do
@@ -236,7 +237,7 @@ describe ShelvesController do
236
237
  describe "with invalid params" do
237
238
  it "assigns a newly created but unsaved shelf as @shelf" do
238
239
  post :create, :shelf => @invalid_attrs
239
- assigns(:shelf).should_not be_valid
240
+ assigns(:shelf).should be_nil
240
241
  end
241
242
 
242
243
  it "should be forbidden" do
@@ -250,7 +251,7 @@ describe ShelvesController do
250
251
  describe "with valid params" do
251
252
  it "assigns a newly created shelf as @shelf" do
252
253
  post :create, :shelf => @attrs
253
- assigns(:shelf).should be_valid
254
+ assigns(:shelf).should be_nil
254
255
  end
255
256
 
256
257
  it "should be forbidden" do
@@ -262,7 +263,7 @@ describe ShelvesController do
262
263
  describe "with invalid params" do
263
264
  it "assigns a newly created but unsaved shelf as @shelf" do
264
265
  post :create, :shelf => @invalid_attrs
265
- assigns(:shelf).should_not be_valid
266
+ assigns(:shelf).should be_nil
266
267
  end
267
268
 
268
269
  it "should be forbidden" do
@@ -35,7 +35,7 @@ describe SubscribesController do
35
35
 
36
36
  it "should be forbidden" do
37
37
  get :index
38
- assigns(:subscribes).should be_empty
38
+ assigns(:subscribes).should be_nil
39
39
  response.should be_forbidden
40
40
  end
41
41
  end
@@ -43,7 +43,7 @@ describe SubscribesController do
43
43
  describe "When not logged in" do
44
44
  it "assigns all subscribes as @subscribes" do
45
45
  get :index
46
- assigns(:subscribes).should be_empty
46
+ assigns(:subscribes).should be_nil
47
47
  response.should redirect_to(new_user_session_url)
48
48
  end
49
49
  end
@@ -115,7 +115,7 @@ describe SubscribesController do
115
115
 
116
116
  it "should not assign the requested subscribe as @subscribe" do
117
117
  get :new
118
- assigns(:subscribe).should_not be_valid
118
+ assigns(:subscribe).should be_nil
119
119
  response.should be_forbidden
120
120
  end
121
121
  end
@@ -123,7 +123,7 @@ describe SubscribesController do
123
123
  describe "When not logged in" do
124
124
  it "should not assign the requested subscribe as @subscribe" do
125
125
  get :new
126
- assigns(:subscribe).should_not be_valid
126
+ assigns(:subscribe).should be_nil
127
127
  response.should redirect_to(new_user_session_url)
128
128
  end
129
129
  end
@@ -237,7 +237,7 @@ describe SubscribesController do
237
237
  describe "with valid params" do
238
238
  it "assigns a newly created subscribe as @subscribe" do
239
239
  post :create, :subscribe => @attrs
240
- assigns(:subscribe).should be_valid
240
+ assigns(:subscribe).should be_nil
241
241
  end
242
242
 
243
243
  it "should be forbidden" do
@@ -249,7 +249,7 @@ describe SubscribesController do
249
249
  describe "with invalid params" do
250
250
  it "assigns a newly created but unsaved subscribe as @subscribe" do
251
251
  post :create, :subscribe => @invalid_attrs
252
- assigns(:subscribe).should_not be_valid
252
+ assigns(:subscribe).should be_nil
253
253
  end
254
254
 
255
255
  it "should be forbidden" do
@@ -263,7 +263,7 @@ describe SubscribesController do
263
263
  describe "with valid params" do
264
264
  it "assigns a newly created subscribe as @subscribe" do
265
265
  post :create, :subscribe => @attrs
266
- assigns(:subscribe).should be_valid
266
+ assigns(:subscribe).should be_nil
267
267
  end
268
268
 
269
269
  it "should be forbidden" do
@@ -275,7 +275,7 @@ describe SubscribesController do
275
275
  describe "with invalid params" do
276
276
  it "assigns a newly created but unsaved subscribe as @subscribe" do
277
277
  post :create, :subscribe => @invalid_attrs
278
- assigns(:subscribe).should_not be_valid
278
+ assigns(:subscribe).should be_nil
279
279
  end
280
280
 
281
281
  it "should be forbidden" do