enju_library 0.2.0 → 0.2.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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/enju_library/controller.rb +12 -3
  3. data/app/controllers/libraries_controller.rb +1 -0
  4. data/app/controllers/shelves_controller.rb +2 -1
  5. data/app/models/library.rb +1 -1
  6. data/app/models/library_group.rb +22 -17
  7. data/app/models/shelf.rb +1 -1
  8. data/app/views/libraries/_form.html.erb +1 -0
  9. data/app/views/library_groups/_color_fields.html.erb +0 -1
  10. data/app/views/library_groups/_form.html.erb +1 -4
  11. data/config/locales/translation_en.yml +1 -0
  12. data/config/locales/translation_ja.yml +1 -0
  13. data/config/routes.rb +1 -0
  14. data/lib/enju_library/version.rb +1 -1
  15. data/lib/tasks/enju_library_tasks.rake +2 -2
  16. data/spec/controllers/accepts_controller_spec.rb +96 -96
  17. data/spec/controllers/baskets_controller_spec.rb +126 -126
  18. data/spec/controllers/bookstores_controller_spec.rb +152 -152
  19. data/spec/controllers/budget_types_controller_spec.rb +48 -49
  20. data/spec/controllers/libraries_controller_spec.rb +183 -183
  21. data/spec/controllers/library_groups_controller_spec.rb +47 -47
  22. data/spec/controllers/request_status_types_controller_spec.rb +152 -152
  23. data/spec/controllers/request_types_controller_spec.rb +152 -152
  24. data/spec/controllers/search_engines_controller_spec.rb +152 -152
  25. data/spec/controllers/shelves_controller_spec.rb +152 -152
  26. data/spec/controllers/subscribes_controller_spec.rb +151 -151
  27. data/spec/controllers/subscriptions_controller_spec.rb +152 -152
  28. data/spec/controllers/user_export_files_controller_spec.rb +75 -75
  29. data/spec/controllers/user_groups_controller_spec.rb +108 -108
  30. data/spec/controllers/user_import_files_controller_spec.rb +73 -73
  31. data/spec/controllers/user_import_results_controller_spec.rb +33 -34
  32. data/spec/controllers/withdraws_controller_spec.rb +42 -45
  33. data/spec/fixtures/libraries.yml +1 -1
  34. data/spec/fixtures/library_groups.yml +22 -17
  35. data/spec/fixtures/shelves.yml +1 -1
  36. data/spec/models/library_group_spec.rb +22 -17
  37. data/spec/models/library_spec.rb +1 -1
  38. data/spec/models/shelf_spec.rb +1 -1
  39. data/spec/views/library_groups/edit.html.erb_spec.rb +8 -0
  40. metadata +11 -25
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba733672dc7240ef5d131dfde66ce76a8f17f2ae
4
- data.tar.gz: 99735387f747ab1c511873c7612afbb1e35bf5ed
3
+ metadata.gz: 711cb2a18f1e3b7d5b1a24895d3b813ba8a473fd
4
+ data.tar.gz: 53f08ee0f42d4ef78d765feebd194bff4f8021d7
5
5
  SHA512:
6
- metadata.gz: 978f436871aa085c0173f8494d01d068e9a115c187ab1fbafada166adba847d8987a77f75032017e21f2c78ae321a5732fb430be4dad9a47ec7206e82e9edd54
7
- data.tar.gz: 1537126f13484c10fe21aaeac07649c0fa66c99f66f7e744c44057bf07f96827fb779cf41e97c2ad41f7ebd9823a35124e176f27ed406fe23cbe20c3185a6db5
6
+ metadata.gz: f6c42ed7816ec5c125c5797b927d8f0569ad132cf84575a6dbccf3ba98c52fa6d6252fcdff13e253cd21330c2c27f412836aa0150bc3520186fe97d05077b970
7
+ data.tar.gz: 68a3820c1a175bd4c3a3ec1eea729443bba1853cfe0da0a3f878ef65ec05ff65fb59fc413d51a804526a87708b8139d43ff48566da815f3d3467dce13ee770ed
@@ -9,6 +9,7 @@ module EnjuLibrary
9
9
  #rescue_from ActiveRecord::RecordNotFound, with: :render_404
10
10
  rescue_from Errno::ECONNREFUSED, with: :render_500_nosolr
11
11
  #rescue_from ActionView::MissingTemplate, with: :render_404_invalid_format
12
+ helper_method :filtered_params
12
13
  end
13
14
 
14
15
  private
@@ -96,6 +97,7 @@ module EnjuLibrary
96
97
  I18n.locale = @locale = session[:locale] = I18n.default_locale
97
98
  end
98
99
  rescue InvalidLocaleError
100
+ reset_session
99
101
  @locale = I18n.default_locale
100
102
  end
101
103
 
@@ -137,7 +139,7 @@ module EnjuLibrary
137
139
  def convert_charset
138
140
  case params[:format]
139
141
  when 'csv'
140
- return unless LibraryGroup.site_config.settings[:csv_charset_conversion]
142
+ return unless LibraryGroup.site_config.csv_charset_conversion
141
143
  # TODO: 他の言語
142
144
  if @locale.to_sym == :ja
143
145
  headers["Content-Type"] = "text/csv; charset=Shift_JIS"
@@ -183,7 +185,7 @@ module EnjuLibrary
183
185
  def get_top_page_content
184
186
  if defined?(EnjuNews)
185
187
  @news_feeds = Rails.cache.fetch('news_feed_all'){NewsFeed.order(:position)}
186
- @news_posts = NewsPost.limit(LibraryGroup.site_config.settings[:news_post_number_top_page] || 10)
188
+ @news_posts = NewsPost.limit(LibraryGroup.site_config.news_post_number_top_page || 10)
187
189
  end
188
190
  @libraries = Library.real
189
191
  end
@@ -219,7 +221,7 @@ module EnjuLibrary
219
221
  end
220
222
 
221
223
  def store_current_location
222
- store_location_for(:user, request.url) unless request.xhr?
224
+ store_location_for(:user, request.url) if request.format == 'text/html'
223
225
  end
224
226
 
225
227
  def get_library_group
@@ -257,5 +259,12 @@ module EnjuLibrary
257
259
  authorize @subscription, :show?
258
260
  end
259
261
  end
262
+
263
+ def filtered_params
264
+ params.permit([:q, :query, :view, :format, :order, :sort_by, :page, :per_page])
265
+ end
266
+
267
+ class InvalidLocaleError < StandardError
268
+ end
260
269
  end
261
270
  end
@@ -53,6 +53,7 @@ class LibrariesController < ApplicationController
53
53
  # GET /libraries/new
54
54
  def new
55
55
  @library = Library.new
56
+ @library.library_group = LibraryGroup.first
56
57
  @library.country = LibraryGroup.site_config.country
57
58
  prepare_options
58
59
 
@@ -33,8 +33,9 @@ class ShelvesController < ApplicationController
33
33
  if library
34
34
  with(:library).equal_to library.name
35
35
  order_by :position, :asc
36
+ else
37
+ order_by sort[:sort_by], sort[:order]
36
38
  end
37
- order_by sort[:sort_by], sort[:order]
38
39
  facet :library
39
40
  end
40
41
  @shelves = search.results
@@ -111,7 +111,7 @@ end
111
111
  # note :text
112
112
  # call_number_rows :integer default(1), not null
113
113
  # call_number_delimiter :string default("|"), not null
114
- # library_group_id :integer default(1), not null
114
+ # library_group_id :integer not null
115
115
  # users_count :integer default(0), not null
116
116
  # position :integer
117
117
  # country_id :integer
@@ -68,21 +68,26 @@ end
68
68
  #
69
69
  # Table name: library_groups
70
70
  #
71
- # id :integer not null, primary key
72
- # name :string not null
73
- # display_name :text
74
- # short_name :string not null
75
- # my_networks :text
76
- # login_banner :text
77
- # note :text
78
- # country_id :integer
79
- # position :integer
80
- # created_at :datetime
81
- # updated_at :datetime
82
- # admin_networks :text
83
- # allow_bookmark_external_url :boolean default(FALSE), not null
84
- # url :string default("http://localhost:3000/")
85
- # settings :text
86
- # html_snippet :text
87
- # user_id :integer
71
+ # id :integer not null, primary key
72
+ # name :string not null
73
+ # display_name :text
74
+ # short_name :string not null
75
+ # my_networks :text
76
+ # login_banner :text
77
+ # note :text
78
+ # country_id :integer
79
+ # position :integer
80
+ # created_at :datetime
81
+ # updated_at :datetime
82
+ # admin_networks :text
83
+ # allow_bookmark_external_url :boolean default(FALSE), not null
84
+ # url :string default("http://localhost:3000/")
85
+ # settings :text
86
+ # html_snippet :text
87
+ # book_jacket_source :string
88
+ # max_number_of_results :integer default(500)
89
+ # family_name_first :boolean default(TRUE)
90
+ # screenshot_generator :string
91
+ # pub_year_facet_range_interval :integer default(10)
92
+ # user_id :integer
88
93
  #
data/app/models/shelf.rb CHANGED
@@ -55,7 +55,7 @@ end
55
55
  # name :string not null
56
56
  # display_name :text
57
57
  # note :text
58
- # library_id :integer default(1), not null
58
+ # library_id :integer not null
59
59
  # items_count :integer default(0), not null
60
60
  # position :integer
61
61
  # created_at :datetime
@@ -85,6 +85,7 @@
85
85
  <% end %>
86
86
 
87
87
  <div class="actions">
88
+ <%= f.hidden_field :library_group_id %>
88
89
  <%= f.submit %>
89
90
  </div>
90
91
  <%- end -%>
@@ -1,5 +1,4 @@
1
1
  <div class="nested-fields">
2
2
  <%= f.text_field :property, disabled: true %>
3
3
  <%= f.text_field :code %>
4
- <%= link_to_remove_association t('page.remove'), f, data: {confirm: t('page.are_you_sure')} %><br />
5
4
  </div>
@@ -45,7 +45,7 @@
45
45
  <% if defined?(EnjuManifestationViewer) %>
46
46
  <div class="field">
47
47
  <%= f.label :book_jacket_source -%>
48
- <%= f.select :book_jacket_source, [[t('book_jacket.google'), 'google'], [t('book_jacket.hanmotocom'), 'hanmotocom']] -%><br />
48
+ <%= f.select :book_jacket_source, [[t('book_jacket.google'), 'google'], [t('book_jacket.openbd'), 'openbd'], [t('book_jacket.hanmotocom'), 'hanmotocom']] -%><br />
49
49
  </div>
50
50
  <% end %>
51
51
 
@@ -54,9 +54,6 @@
54
54
  <%= f.fields_for :colors do |color_form| %>
55
55
  <%= render 'color_fields', f: color_form %>
56
56
  <% end %>
57
- <div class="links">
58
- <p><%= link_to_add_association t('page.add'), f, :colors %></p>
59
- </div>
60
57
  </div>
61
58
 
62
59
  <div class="field">
@@ -128,4 +128,5 @@ en:
128
128
  successfully_withdrawn: "This items was successfully withdrawn."
129
129
  book_jacket:
130
130
  google: Google Books
131
+ openbd: openBD
131
132
  hanmotocom: Hanmoto.com
@@ -128,4 +128,5 @@ ja:
128
128
  successfully_withdrawn: "この資料は正常に除籍されました。"
129
129
  book_jacket:
130
130
  google: Googleブックス
131
+ openbd: openBD
131
132
  hanmotocom: 版元ドットコム
data/config/routes.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  Rails.application.routes.draw do
2
+ resources :user_groups
2
3
  resources :withdraws, except: [:edit, :update]
3
4
  resources :libraries
4
5
  resources :shelves
@@ -1,3 +1,3 @@
1
1
  module EnjuLibrary
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -26,11 +26,11 @@ EOS
26
26
  Next-L Enju, an open-source integrated library system. You can edit this message after logging in as Administrator.
27
27
  EOS
28
28
  footer_ja = <<"EOS"
29
- [Next-L Enju Leaf #{EnjuLeaf::VERSION}](https://github.com/next-l/enju_leaf), オープンソース統合図書館システム
29
+ [Next-L Enju Leaf __VERSION__](https://github.com/next-l/enju_leaf), オープンソース統合図書館システム
30
30
  Developed by [Kosuke Tanabe](https://github.com/nabeta) and [Project Next-L](http://www.next-l.jp) \| [このシステムについて](/page/about) \| [不具合を報告する](https://github.com/next-l/enju_leaf/issues) \| [マニュアル](https://next-l.github.com/manual/1.2/)
31
31
  EOS
32
32
  footer_en = <<"EOS"
33
- [Next-L Enju Leaf #{EnjuLeaf::VERSION}](https://github.com/next-l/enju_leaf), an open source integrated library system
33
+ [Next-L Enju Leaf __VERSION__](https://github.com/next-l/enju_leaf), an open source integrated library system
34
34
  Developed by [Kosuke Tanabe](https://github.com/nabeta) and [Project Next-L](http://www.next-l.jp) \| [About this system](/page/about) \| [Report bugs](https://github.com/next-l/enju_leaf/issues) \| [Manual](https://next-l.github.com/manual/1.2/)
35
35
  EOS
36
36
  library_group.login_banner_ja = login_ja if library_group.login_banner_ja.blank?
@@ -3,53 +3,53 @@ require 'rails_helper'
3
3
  describe AcceptsController do
4
4
  fixtures :all
5
5
 
6
- def mock_user(stubs={})
6
+ def mock_user(stubs = {})
7
7
  (@mock_user ||= mock_model(Accept).as_null_object).tap do |user|
8
8
  user.stub(stubs) unless stubs.empty?
9
9
  end
10
10
  end
11
11
 
12
- describe "GET index" do
13
- describe "When logged in as Administrator" do
12
+ describe 'GET index' do
13
+ describe 'When logged in as Administrator' do
14
14
  login_fixture_admin
15
15
 
16
- it "assigns all accepts as @accepts" do
16
+ it 'assigns all accepts as @accepts' do
17
17
  get :index
18
18
  assigns(:accepts).should_not be_nil
19
19
  response.should be_success
20
20
  end
21
21
 
22
- describe "When basket_id is specified" do
23
- it "assigns all accepts as @accepts" do
24
- get :index, :basket_id => 10
22
+ describe 'When basket_id is specified' do
23
+ it 'assigns all accepts as @accepts' do
24
+ get :index, basket_id: 10
25
25
  assigns(:accepts).should eq baskets(:basket_00010).accepts.order('accepts.created_at DESC').page(1)
26
26
  response.should be_success
27
27
  end
28
28
  end
29
29
  end
30
30
 
31
- describe "When logged in as Librarian" do
31
+ describe 'When logged in as Librarian' do
32
32
  login_fixture_librarian
33
33
 
34
- it "assigns all accepts as @accepts" do
34
+ it 'assigns all accepts as @accepts' do
35
35
  get :index
36
36
  assigns(:accepts).should_not be_nil
37
37
  response.should be_success
38
38
  end
39
39
 
40
- describe "When basket_id is specified" do
41
- it "assigns all accepts as @accepts" do
42
- get :index, :basket_id => 9
40
+ describe 'When basket_id is specified' do
41
+ it 'assigns all accepts as @accepts' do
42
+ get :index, basket_id: 9
43
43
  assigns(:accepts).should eq baskets(:basket_00009).accepts.order('accepts.created_at DESC').page(1)
44
44
  response.should be_success
45
45
  end
46
46
  end
47
47
  end
48
48
 
49
- describe "When logged in as User" do
49
+ describe 'When logged in as User' do
50
50
  login_fixture_user
51
51
 
52
- it "should not assign all accepts as @accepts" do
52
+ it 'should not assign all accepts as @accepts' do
53
53
  get :index
54
54
  assigns(:accepts).should be_nil
55
55
  response.should be_forbidden
@@ -57,79 +57,79 @@ describe AcceptsController do
57
57
  end
58
58
  end
59
59
 
60
- describe "GET show" do
61
- describe "When logged in as Administrator" do
60
+ describe 'GET show' do
61
+ describe 'When logged in as Administrator' do
62
62
  login_fixture_admin
63
63
 
64
- it "assigns the requested accept as @accept" do
64
+ it 'assigns the requested accept as @accept' do
65
65
  accept = FactoryGirl.create(:accept)
66
- get :show, :id => accept.id
66
+ get :show, id: accept.id
67
67
  assigns(:accept).should eq(accept)
68
68
  end
69
69
  end
70
70
 
71
- describe "When logged in as Librarian" do
71
+ describe 'When logged in as Librarian' do
72
72
  login_fixture_librarian
73
73
 
74
- it "assigns the requested accept as @accept" do
74
+ it 'assigns the requested accept as @accept' do
75
75
  accept = FactoryGirl.create(:accept)
76
- get :show, :id => accept.id
76
+ get :show, id: accept.id
77
77
  assigns(:accept).should eq(accept)
78
78
  end
79
79
  end
80
80
 
81
- describe "When logged in as User" do
81
+ describe 'When logged in as User' do
82
82
  login_fixture_user
83
83
 
84
- it "assigns the requested accept as @accept" do
84
+ it 'assigns the requested accept as @accept' do
85
85
  accept = FactoryGirl.create(:accept)
86
- get :show, :id => accept.id
86
+ get :show, id: accept.id
87
87
  assigns(:accept).should eq(accept)
88
88
  response.should be_forbidden
89
89
  end
90
90
  end
91
91
 
92
- describe "When not logged in" do
93
- it "assigns the requested accept as @accept" do
92
+ describe 'When not logged in' do
93
+ it 'assigns the requested accept as @accept' do
94
94
  accept = FactoryGirl.create(:accept)
95
- get :show, :id => accept.id
95
+ get :show, id: accept.id
96
96
  assigns(:accept).should eq(accept)
97
97
  response.should redirect_to new_user_session_url
98
98
  end
99
99
  end
100
100
  end
101
101
 
102
- describe "GET new" do
103
- describe "When logged in as Administrator" do
102
+ describe 'GET new' do
103
+ describe 'When logged in as Administrator' do
104
104
  login_fixture_admin
105
105
 
106
- it "assigns the requested accept as @accept" do
106
+ it 'assigns the requested accept as @accept' do
107
107
  get :new
108
108
  assigns(:accept).should_not be_valid
109
109
  end
110
110
  end
111
111
 
112
- describe "When logged in as Librarian" do
112
+ describe 'When logged in as Librarian' do
113
113
  login_fixture_librarian
114
114
 
115
- it "assigns the requested accept as @accept" do
115
+ it 'assigns the requested accept as @accept' do
116
116
  get :new
117
117
  assigns(:accept).should_not be_valid
118
118
  end
119
119
  end
120
120
 
121
- describe "When logged in as User" do
121
+ describe 'When logged in as User' do
122
122
  login_fixture_user
123
123
 
124
- it "should not assign the requested accept as @accept" do
124
+ it 'should not assign the requested accept as @accept' do
125
125
  get :new
126
126
  assigns(:accept).should be_nil
127
127
  response.should be_forbidden
128
128
  end
129
129
  end
130
130
 
131
- describe "When not logged in" do
132
- it "should not assign the requested accept as @accept" do
131
+ describe 'When not logged in' do
132
+ it 'should not assign the requested accept as @accept' do
133
133
  get :new
134
134
  assigns(:accept).should be_nil
135
135
  response.should redirect_to(new_user_session_url)
@@ -137,156 +137,156 @@ describe AcceptsController do
137
137
  end
138
138
  end
139
139
 
140
- describe "POST create" do
140
+ describe 'POST create' do
141
141
  before(:each) do
142
- @attrs = {:item_identifier => '00003'}
143
- @invalid_attrs = {:item_identifier => 'invalid'}
142
+ @attrs = { item_identifier: '00003' }
143
+ @invalid_attrs = { item_identifier: 'invalid' }
144
144
  end
145
145
 
146
- describe "When logged in as Administrator" do
146
+ describe 'When logged in as Administrator' do
147
147
  login_fixture_admin
148
148
 
149
- describe "with valid params" do
150
- it "assigns a newly created accept as @accept" do
151
- post :create, :accept => @attrs
149
+ describe 'with valid params' do
150
+ it 'assigns a newly created accept as @accept' do
151
+ post :create, accept: @attrs
152
152
  assigns(:accept).should be_nil
153
153
  end
154
154
 
155
- it "should not create a new accept without basket_id" do
156
- post :create, :accept => @attrs
155
+ it 'should not create a new accept without basket_id' do
156
+ post :create, accept: @attrs
157
157
  response.should be_forbidden
158
158
  end
159
159
 
160
- describe "When basket_id is specified" do
161
- it "redirects to the created accept" do
162
- post :create, :accept => @attrs, :basket_id => 9
160
+ describe 'When basket_id is specified' do
161
+ it 'redirects to the created accept' do
162
+ post :create, accept: @attrs, basket_id: 9
163
163
  response.should redirect_to(accepts_url(basket_id: assigns(:accept).basket.id))
164
164
  assigns(:accept).item.circulation_status.name.should eq 'Available On Shelf'
165
165
  end
166
166
  end
167
167
  end
168
168
 
169
- describe "with invalid params" do
170
- it "assigns a newly created but unsaved accept as @accept" do
171
- post :create, :accept => @invalid_attrs
169
+ describe 'with invalid params' do
170
+ it 'assigns a newly created but unsaved accept as @accept' do
171
+ post :create, accept: @invalid_attrs
172
172
  assigns(:accept).should be_nil
173
173
  end
174
174
 
175
- it "should be forbidden" do
176
- post :create, :accept => @invalid_attrs
175
+ it 'should be forbidden' do
176
+ post :create, accept: @invalid_attrs
177
177
  response.should be_forbidden
178
178
  end
179
179
  end
180
180
 
181
- it "should not create accept without item_id" do
182
- post :create, :accept => {:item_identifier => nil}, :basket_id => 9
181
+ it 'should not create accept without item_id' do
182
+ post :create, accept: { item_identifier: nil }, basket_id: 9
183
183
  assigns(:accept).should_not be_valid
184
184
  response.should be_success
185
185
  end
186
186
  end
187
187
 
188
- describe "When logged in as Librarian" do
188
+ describe 'When logged in as Librarian' do
189
189
  login_fixture_librarian
190
190
 
191
- describe "with valid params" do
192
- it "assigns a newly created accept as @accept" do
193
- post :create, :accept => @attrs
191
+ describe 'with valid params' do
192
+ it 'assigns a newly created accept as @accept' do
193
+ post :create, accept: @attrs
194
194
  assigns(:accept).should be_nil
195
195
  end
196
196
 
197
- it "should not create a new accept without basket_id" do
198
- post :create, :accept => @attrs
197
+ it 'should not create a new accept without basket_id' do
198
+ post :create, accept: @attrs
199
199
  response.should be_forbidden
200
200
  end
201
201
  end
202
202
  end
203
203
 
204
- describe "When logged in as User" do
204
+ describe 'When logged in as User' do
205
205
  login_fixture_user
206
206
 
207
- describe "with valid params" do
208
- it "assigns a newly created accept as @accept" do
209
- post :create, :accept => @attrs
207
+ describe 'with valid params' do
208
+ it 'assigns a newly created accept as @accept' do
209
+ post :create, accept: @attrs
210
210
  assigns(:accept).should be_nil
211
211
  end
212
212
 
213
- it "should be forbidden" do
214
- post :create, :accept => @attrs
213
+ it 'should be forbidden' do
214
+ post :create, accept: @attrs
215
215
  response.should be_forbidden
216
216
  end
217
217
  end
218
218
  end
219
219
 
220
- describe "When not logged in" do
220
+ describe 'When not logged in' do
221
221
  before(:each) do
222
- @attrs = {:item_identifier => '00003'}
223
- @invalid_attrs = {:item_identifier => 'invalid'}
222
+ @attrs = { item_identifier: '00003' }
223
+ @invalid_attrs = { item_identifier: 'invalid' }
224
224
  end
225
225
 
226
- describe "with valid params" do
227
- it "assigns a newly created accept as @accept" do
228
- post :create, :accept => @attrs
226
+ describe 'with valid params' do
227
+ it 'assigns a newly created accept as @accept' do
228
+ post :create, accept: @attrs
229
229
  end
230
230
 
231
- it "should redirect to new session url" do
232
- post :create, :accept => @attrs
231
+ it 'should redirect to new session url' do
232
+ post :create, accept: @attrs
233
233
  response.should redirect_to new_user_session_url
234
234
  end
235
235
  end
236
236
  end
237
237
  end
238
238
 
239
- describe "DELETE destroy" do
239
+ describe 'DELETE destroy' do
240
240
  before(:each) do
241
241
  @accept = FactoryGirl.create(:accept)
242
242
  end
243
243
 
244
- describe "When logged in as Administrator" do
244
+ describe 'When logged in as Administrator' do
245
245
  login_fixture_admin
246
246
 
247
- it "destroys the requested accept" do
248
- delete :destroy, :id => @accept.id
247
+ it 'destroys the requested accept' do
248
+ delete :destroy, id: @accept.id
249
249
  end
250
250
 
251
- it "redirects to the accepts list" do
252
- delete :destroy, :id => @accept.id
251
+ it 'redirects to the accepts list' do
252
+ delete :destroy, id: @accept.id
253
253
  response.should redirect_to(accepts_url)
254
254
  end
255
255
  end
256
256
 
257
- describe "When logged in as Librarian" do
257
+ describe 'When logged in as Librarian' do
258
258
  login_fixture_librarian
259
259
 
260
- it "destroys the requested accept" do
261
- delete :destroy, :id => @accept.id
260
+ it 'destroys the requested accept' do
261
+ delete :destroy, id: @accept.id
262
262
  end
263
263
 
264
- it "redirects to the accepts list" do
265
- delete :destroy, :id => @accept.id
264
+ it 'redirects to the accepts list' do
265
+ delete :destroy, id: @accept.id
266
266
  response.should redirect_to(accepts_url)
267
267
  end
268
268
  end
269
269
 
270
- describe "When logged in as User" do
270
+ describe 'When logged in as User' do
271
271
  login_fixture_user
272
272
 
273
- it "destroys the requested accept" do
274
- delete :destroy, :id => @accept.id
273
+ it 'destroys the requested accept' do
274
+ delete :destroy, id: @accept.id
275
275
  end
276
276
 
277
- it "should be forbidden" do
278
- delete :destroy, :id => @accept.id
277
+ it 'should be forbidden' do
278
+ delete :destroy, id: @accept.id
279
279
  response.should be_forbidden
280
280
  end
281
281
  end
282
282
 
283
- describe "When not logged in" do
284
- it "destroys the requested accept" do
285
- delete :destroy, :id => @accept.id
283
+ describe 'When not logged in' do
284
+ it 'destroys the requested accept' do
285
+ delete :destroy, id: @accept.id
286
286
  end
287
287
 
288
- it "should be forbidden" do
289
- delete :destroy, :id => @accept.id
288
+ it 'should be forbidden' do
289
+ delete :destroy, id: @accept.id
290
290
  response.should redirect_to(new_user_session_url)
291
291
  end
292
292
  end