enju_library 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/library_groups_controller.rb +23 -1
- data/app/models/library.rb +0 -3
- data/app/models/library_group.rb +25 -1
- data/app/policies/library_group_policy.rb +4 -0
- data/app/views/library_groups/_form.html.erb +8 -0
- data/app/views/library_groups/show.html.erb +6 -0
- data/config/locales/translation_en.yml +1 -0
- data/config/locales/translation_ja.yml +1 -0
- data/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +5 -0
- data/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +5 -0
- data/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb +5 -0
- data/lib/enju_library/engine.rb +1 -0
- data/lib/enju_library/version.rb +1 -1
- data/lib/generators/enju_library/setup/templates/db/fixtures/library_group/translations.yml +6 -10
- data/lib/generators/enju_library/setup/templates/db/fixtures/library_groups.yml +0 -1
- data/lib/generators/enju_library/update/update_generator.rb +9 -0
- data/spec/controllers/accepts_controller_spec.rb +5 -5
- data/spec/controllers/baskets_controller_spec.rb +1 -1
- data/spec/controllers/bookstores_controller_spec.rb +6 -6
- data/spec/controllers/budget_types_controller_spec.rb +1 -1
- data/spec/controllers/libraries_controller_spec.rb +6 -6
- data/spec/controllers/request_status_types_controller_spec.rb +6 -6
- data/spec/controllers/request_types_controller_spec.rb +6 -6
- data/spec/controllers/search_engines_controller_spec.rb +12 -12
- data/spec/controllers/shelves_controller_spec.rb +7 -7
- data/spec/controllers/subscribes_controller_spec.rb +12 -12
- data/spec/controllers/subscriptions_controller_spec.rb +11 -11
- data/spec/controllers/user_groups_controller_spec.rb +12 -12
- data/spec/controllers/user_import_files_controller_spec.rb +4 -4
- data/spec/controllers/withdraws_controller_spec.rb +1 -1
- data/spec/dummy/db/schema.rb +3 -2
- data/spec/factories/accepts.rb +4 -4
- data/spec/factories/basket.rb +2 -2
- data/spec/factories/bookstore.rb +1 -1
- data/spec/factories/budget_types.rb +1 -1
- data/spec/factories/checkout.rb +1 -1
- data/spec/factories/item.rb +2 -2
- data/spec/factories/library.rb +2 -2
- data/spec/factories/manifestation.rb +1 -1
- data/spec/factories/profile.rb +2 -2
- data/spec/factories/request_status_type.rb +1 -1
- data/spec/factories/request_type.rb +1 -1
- data/spec/factories/search_engine.rb +1 -1
- data/spec/factories/shelf.rb +2 -2
- data/spec/factories/subscribe.rb +3 -3
- data/spec/factories/subscription.rb +2 -2
- data/spec/factories/user.rb +1 -1
- data/spec/factories/user_group.rb +1 -1
- data/spec/factories/withdraw.rb +4 -4
- data/spec/fixtures/library_groups.yml +8 -2
- data/spec/models/accept_spec.rb +1 -1
- data/spec/models/budget_type_spec.rb +1 -1
- data/spec/models/library_group_spec.rb +7 -1
- data/spec/models/library_spec.rb +1 -1
- data/spec/models/user_import_file_spec.rb +4 -4
- data/spec/models/withdraw_spec.rb +1 -1
- data/spec/rails_helper.rb +3 -3
- data/spec/support/controller_macros.rb +3 -3
- data/spec/views/accepts/index.html.erb_spec.rb +1 -1
- data/spec/views/accepts/new.html.erb_spec.rb +1 -1
- data/spec/views/libraries/show.html.erb_spec.rb +1 -1
- data/spec/views/withdraws/edit.html.erb_spec.rb +1 -1
- data/spec/views/withdraws/index.html.erb_spec.rb +1 -1
- data/spec/views/withdraws/show.html.erb_spec.rb +1 -1
- metadata +16 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ec47a509dd7bd209791197d6c822b0b84c44b67
|
4
|
+
data.tar.gz: 32cdd9f4bde06623a6798d9dceba72c338d58f1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ade2ec7c7902f4d8351550652ff10ca1f6d594478b1c14b90fec4e2eae66fa68ded7686a6c251ef27f179401e9c0d72d112e99aa0300f757551e055403ea02f
|
7
|
+
data.tar.gz: 6d90d19cb810d5a1eb9f0d94b850854cf66f5837998b95d264664510ff19b16629fe71a15db6ec1a4ae67847cfcc9990d301e4b331a9d1b34f5487d2ead4aabc
|
@@ -19,6 +19,19 @@ class LibraryGroupsController < ApplicationController
|
|
19
19
|
respond_to do |format|
|
20
20
|
format.html # show.html.erb
|
21
21
|
format.json { render json: @library_group }
|
22
|
+
format.download {
|
23
|
+
if @library_group.header_logo.exists?
|
24
|
+
if ENV['ENJU_STORAGE'] == 's3'
|
25
|
+
file = Faraday.get(@library_group.header_logo.expiring_url(3600, :medium)).body.force_encoding('UTF-8')
|
26
|
+
send_data file, filename: File.basename(@library_group.header_logo_file_name), type: @library_group.header_logo_content_type, disposition: :inline
|
27
|
+
else
|
28
|
+
file = @library_group.header_logo.path(:medium)
|
29
|
+
if File.exist?(file) && File.file?(file)
|
30
|
+
send_file file, filename: File.basename(@library_group.header_logo_file_name), type: @library_group.header_logo_content_type, disposition: :inline
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
}
|
22
35
|
end
|
23
36
|
end
|
24
37
|
|
@@ -32,6 +45,10 @@ class LibraryGroupsController < ApplicationController
|
|
32
45
|
def update
|
33
46
|
respond_to do |format|
|
34
47
|
if @library_group.update_attributes(library_group_params)
|
48
|
+
if @library_group.delete_header_logo == '1'
|
49
|
+
@library_group.header_logo.destroy
|
50
|
+
end
|
51
|
+
|
35
52
|
format.html { redirect_to @library_group, notice: t('controller.successfully_updated', model: t('activerecord.models.library_group')) }
|
36
53
|
format.json { head :no_content }
|
37
54
|
else
|
@@ -45,7 +62,11 @@ class LibraryGroupsController < ApplicationController
|
|
45
62
|
private
|
46
63
|
def set_library_group
|
47
64
|
@library_group = LibraryGroup.find(params[:id])
|
48
|
-
|
65
|
+
if request.format == :download
|
66
|
+
authorize @library_group, :show_logo?
|
67
|
+
else
|
68
|
+
authorize @library_group
|
69
|
+
end
|
49
70
|
end
|
50
71
|
|
51
72
|
def check_policy
|
@@ -58,6 +79,7 @@ class LibraryGroupsController < ApplicationController
|
|
58
79
|
:login_banner, :note, :country_id, :admin_networks, :url,
|
59
80
|
:max_number_of_results, :footer_banner, :email,
|
60
81
|
:book_jacket_source, :screenshot_generator, :erms_url,
|
82
|
+
:header_logo, :delete_header_logo,
|
61
83
|
:allow_bookmark_external_url, # EnjuBookmark
|
62
84
|
{
|
63
85
|
:colors_attributes => [:id, :property, :code]
|
data/app/models/library.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
1
|
class Library < ActiveRecord::Base
|
3
2
|
include MasterModel
|
4
3
|
default_scope { order('libraries.position') }
|
@@ -32,8 +31,6 @@ class Library < ActiveRecord::Base
|
|
32
31
|
after_save :clear_all_cache
|
33
32
|
after_destroy :clear_all_cache
|
34
33
|
|
35
|
-
paginates_per 10
|
36
|
-
|
37
34
|
def self.all_cache
|
38
35
|
if Rails.env == 'production'
|
39
36
|
Rails.cache.fetch('library_all'){ Library.all }
|
data/app/models/library_group.rb
CHANGED
@@ -21,6 +21,24 @@ class LibraryGroup < ActiveRecord::Base
|
|
21
21
|
translates :login_banner, :footer_banner
|
22
22
|
globalize_accessors
|
23
23
|
|
24
|
+
if ENV['ENJU_STORAGE'] == 's3'
|
25
|
+
has_attached_file :header_logo, storage: :s3, styles: { medium: 'x80'},
|
26
|
+
s3_credentials: {
|
27
|
+
access_key: ENV['AWS_ACCESS_KEY_ID'],
|
28
|
+
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
|
29
|
+
bucket: ENV['S3_BUCKET_NAME'],
|
30
|
+
s3_host_name: ENV['S3_HOST_NAME'],
|
31
|
+
s3_region: ENV["S3_REGION"]
|
32
|
+
},
|
33
|
+
s3_permissions: :private
|
34
|
+
else
|
35
|
+
has_attached_file :header_logo, styles: { medium: 'x80'},
|
36
|
+
path: ":rails_root/private/system/:class/:attachment/:id_partition/:style/:filename"
|
37
|
+
end
|
38
|
+
|
39
|
+
validates_attachment_content_type :header_logo, content_type: /\Aimage\/.*\Z/
|
40
|
+
attr_accessor :delete_header_logo
|
41
|
+
|
24
42
|
def self.site_config
|
25
43
|
LibraryGroup.order(:created_at).first
|
26
44
|
end
|
@@ -67,7 +85,7 @@ end
|
|
67
85
|
# display_name :text
|
68
86
|
# short_name :string not null
|
69
87
|
# my_networks :text
|
70
|
-
#
|
88
|
+
# old_login_banner :text
|
71
89
|
# note :text
|
72
90
|
# country_id :integer
|
73
91
|
# position :integer
|
@@ -84,4 +102,10 @@ end
|
|
84
102
|
# screenshot_generator :string
|
85
103
|
# pub_year_facet_range_interval :integer default(10)
|
86
104
|
# user_id :integer
|
105
|
+
# csv_charset_conversion :boolean default(FALSE), not null
|
106
|
+
# header_logo_file_name :string
|
107
|
+
# header_logo_content_type :string
|
108
|
+
# header_logo_file_size :integer
|
109
|
+
# header_logo_updated_at :datetime
|
110
|
+
# header_logo_meta :text
|
87
111
|
#
|
@@ -11,6 +11,14 @@
|
|
11
11
|
<%= f.text_area :display_name, class: 'resource_textarea' -%>
|
12
12
|
</div>
|
13
13
|
|
14
|
+
<div class="field">
|
15
|
+
<%= f.label :header_logo -%><br />
|
16
|
+
<%= f.file_field :header_logo -%>
|
17
|
+
<br />
|
18
|
+
<%= f.check_box :delete_header_logo -%>
|
19
|
+
<%= t('page.destroy') %>
|
20
|
+
</div>
|
21
|
+
|
14
22
|
<div class="field">
|
15
23
|
<%= f.label :email -%><br />
|
16
24
|
<%= f.fields_for :user do |user_form| %>
|
@@ -13,6 +13,12 @@
|
|
13
13
|
<%= @library_group.display_name.localize -%>
|
14
14
|
</p>
|
15
15
|
|
16
|
+
<p>
|
17
|
+
<strong><%= t('activerecord.attributes.library_group.header_logo') -%>:</strong>
|
18
|
+
<br />
|
19
|
+
<%= image_tag(library_group_path(@library_group, format: :download), size: @library_group.header_logo.image_size(:medium)) if @library_group.header_logo.exists? -%>
|
20
|
+
</p>
|
21
|
+
|
16
22
|
<p>
|
17
23
|
<strong><%= t('activerecord.attributes.library_group.email') -%>:</strong>
|
18
24
|
<%= @library_group.user.email -%>
|
data/lib/enju_library/engine.rb
CHANGED
data/lib/enju_library/version.rb
CHANGED
@@ -1,16 +1,12 @@
|
|
1
1
|
library_group_00001_translations_ja:
|
2
2
|
locale: ja
|
3
|
-
|
4
|
-
[Next-L Enju Leaf __VERSION__](https://github.com/next-l/enju_leaf), オープンソース統合図書館システム | [このシステムについて](/page/about) | [不具合を報告する](https://github.com/next-l/enju_leaf/issues) | [マニュアル](https://next-l.github.io/manual/1.2/)<br/>\r\n\
|
5
|
-
Developed by [Kosuke Tanabe](https://github.com/nabeta) and [Project Next-L](http://www.next-l.jp)
|
6
|
-
</div>\r\n
|
7
|
-
"
|
3
|
+
login_banner: オープンソース図書館システム Next-L Enju です。このメッセージは管理者としてログインした後に変更することができます。
|
4
|
+
footer_banner: "[Next-L Enju Leaf __VERSION__](https://github.com/next-l/enju_leaf), オープンソース統合図書館システム | [このシステムについて](/page/about) | [不具合を報告する](https://github.com/next-l/enju_leaf/issues) | [マニュアル](https://next-l.github.io/manual/1.2/)<br/>\r\n\
|
5
|
+
Developed by [Kosuke Tanabe](https://github.com/nabeta) and [Project Next-L](http://www.next-l.jp)."
|
8
6
|
library_group_id: 1
|
9
7
|
library_group_00001_translations_en:
|
10
8
|
locale: en
|
11
|
-
|
12
|
-
[Next-L Enju Leaf __VERSION__](https://github.com/next-l/enju_leaf), an open source integrated library system | [About this system](/page/about) | [Report bugs](https://github.com/next-l/enju_leaf/issues) | [Manual](https://next-l.github.io/manual/1.2/)<br/>\r\n\
|
13
|
-
Developed by [Kosuke Tanabe](https://github.com/nabeta) and [Project Next-L](http://www.next-l.jp)
|
14
|
-
</div>\r\n
|
15
|
-
"
|
9
|
+
login_banner: Next-L Enju, an open-source integrated library system. You can edit this message after logging in as Administrator.
|
10
|
+
footer_banner: "[Next-L Enju Leaf __VERSION__](https://github.com/next-l/enju_leaf), an open source integrated library system | [About this system](/page/about) | [Report bugs](https://github.com/next-l/enju_leaf/issues) | [Manual](https://next-l.github.io/manual/1.2/)<br/>\r\n\
|
11
|
+
Developed by [Kosuke Tanabe](https://github.com/nabeta) and [Project Next-L](http://www.next-l.jp)."
|
16
12
|
library_group_id: 1
|
@@ -7,7 +7,6 @@ library_group_00001:
|
|
7
7
|
note:
|
8
8
|
my_networks: "0.0.0.0/0\r\n\
|
9
9
|
::/0"
|
10
|
-
login_banner: Next-L Enju, an open-source integrated library system. You can edit this message after logging in as Administrator.
|
11
10
|
admin_networks: "0.0.0.0/0\r\n\
|
12
11
|
::/0"
|
13
12
|
settings: "{\"max_number_of_results\":500, \"family_name_first\":true, \"skip_mobile_agents\":\"ipad\"}"
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class EnjuLibrary::UpdateGenerator < Rails::Generators::Base
|
2
|
+
source_root File.expand_path('../templates', __FILE__)
|
3
|
+
desc "Create files for updating Next-L Enju"
|
4
|
+
|
5
|
+
def copy_statesman_migration_files
|
6
|
+
generate('statesman:add_constraints_to_most_recent', 'UserImportFile', 'UserImportFileTransition')
|
7
|
+
generate('statesman:add_constraints_to_most_recent', 'UserExportFile', 'UserExportFileTransition')
|
8
|
+
end
|
9
|
+
end
|
@@ -62,7 +62,7 @@ describe AcceptsController do
|
|
62
62
|
login_fixture_admin
|
63
63
|
|
64
64
|
it 'assigns the requested accept as @accept' do
|
65
|
-
accept =
|
65
|
+
accept = FactoryBot.create(:accept)
|
66
66
|
get :show, id: accept.id
|
67
67
|
assigns(:accept).should eq(accept)
|
68
68
|
end
|
@@ -72,7 +72,7 @@ describe AcceptsController do
|
|
72
72
|
login_fixture_librarian
|
73
73
|
|
74
74
|
it 'assigns the requested accept as @accept' do
|
75
|
-
accept =
|
75
|
+
accept = FactoryBot.create(:accept)
|
76
76
|
get :show, id: accept.id
|
77
77
|
assigns(:accept).should eq(accept)
|
78
78
|
end
|
@@ -82,7 +82,7 @@ describe AcceptsController do
|
|
82
82
|
login_fixture_user
|
83
83
|
|
84
84
|
it 'assigns the requested accept as @accept' do
|
85
|
-
accept =
|
85
|
+
accept = FactoryBot.create(:accept)
|
86
86
|
get :show, id: accept.id
|
87
87
|
assigns(:accept).should eq(accept)
|
88
88
|
response.should be_forbidden
|
@@ -91,7 +91,7 @@ describe AcceptsController do
|
|
91
91
|
|
92
92
|
describe 'When not logged in' do
|
93
93
|
it 'assigns the requested accept as @accept' do
|
94
|
-
accept =
|
94
|
+
accept = FactoryBot.create(:accept)
|
95
95
|
get :show, id: accept.id
|
96
96
|
assigns(:accept).should eq(accept)
|
97
97
|
response.should redirect_to new_user_session_url
|
@@ -238,7 +238,7 @@ describe AcceptsController do
|
|
238
238
|
|
239
239
|
describe 'DELETE destroy' do
|
240
240
|
before(:each) do
|
241
|
-
@accept =
|
241
|
+
@accept = FactoryBot.create(:accept)
|
242
242
|
end
|
243
243
|
|
244
244
|
describe 'When logged in as Administrator' do
|
@@ -6,12 +6,12 @@ describe BookstoresController do
|
|
6
6
|
disconnect_sunspot
|
7
7
|
|
8
8
|
def valid_attributes
|
9
|
-
|
9
|
+
FactoryBot.attributes_for(:bookstore)
|
10
10
|
end
|
11
11
|
|
12
12
|
describe 'GET index' do
|
13
13
|
before(:each) do
|
14
|
-
|
14
|
+
FactoryBot.create(:bookstore)
|
15
15
|
end
|
16
16
|
|
17
17
|
describe 'When logged in as Administrator' do
|
@@ -53,7 +53,7 @@ describe BookstoresController do
|
|
53
53
|
|
54
54
|
describe 'GET show' do
|
55
55
|
before(:each) do
|
56
|
-
@bookstore =
|
56
|
+
@bookstore = FactoryBot.create(:bookstore)
|
57
57
|
end
|
58
58
|
|
59
59
|
describe 'When logged in as Administrator' do
|
@@ -133,7 +133,7 @@ describe BookstoresController do
|
|
133
133
|
|
134
134
|
describe 'GET edit' do
|
135
135
|
before(:each) do
|
136
|
-
@bookstore =
|
136
|
+
@bookstore = FactoryBot.create(:bookstore)
|
137
137
|
end
|
138
138
|
|
139
139
|
describe 'When logged in as Administrator' do
|
@@ -290,7 +290,7 @@ describe BookstoresController do
|
|
290
290
|
|
291
291
|
describe 'PUT update' do
|
292
292
|
before(:each) do
|
293
|
-
@bookstore =
|
293
|
+
@bookstore = FactoryBot.create(:bookstore)
|
294
294
|
@attrs = valid_attributes
|
295
295
|
@invalid_attrs = { name: '' }
|
296
296
|
end
|
@@ -391,7 +391,7 @@ describe BookstoresController do
|
|
391
391
|
|
392
392
|
describe 'DELETE destroy' do
|
393
393
|
before(:each) do
|
394
|
-
@bookstore =
|
394
|
+
@bookstore = FactoryBot.create(:bookstore)
|
395
395
|
end
|
396
396
|
|
397
397
|
describe 'When logged in as Administrator' do
|
@@ -26,7 +26,7 @@ describe BudgetTypesController do
|
|
26
26
|
# BudgetType. As you add validations to BudgetType, be sure to
|
27
27
|
# update the return value of this method accordingly.
|
28
28
|
def valid_attributes
|
29
|
-
|
29
|
+
FactoryBot.attributes_for(:budget_type)
|
30
30
|
end
|
31
31
|
|
32
32
|
describe 'GET index' do
|
@@ -128,7 +128,7 @@ describe LibrariesController do
|
|
128
128
|
login_fixture_admin
|
129
129
|
|
130
130
|
it 'assigns the requested library as @library' do
|
131
|
-
library =
|
131
|
+
library = FactoryBot.create(:library)
|
132
132
|
get :edit, id: library.id
|
133
133
|
assigns(:library).should eq(library)
|
134
134
|
end
|
@@ -138,7 +138,7 @@ describe LibrariesController do
|
|
138
138
|
login_fixture_librarian
|
139
139
|
|
140
140
|
it 'assigns the requested library as @library' do
|
141
|
-
library =
|
141
|
+
library = FactoryBot.create(:library)
|
142
142
|
get :edit, id: library.id
|
143
143
|
response.should be_forbidden
|
144
144
|
end
|
@@ -148,7 +148,7 @@ describe LibrariesController do
|
|
148
148
|
login_fixture_user
|
149
149
|
|
150
150
|
it 'assigns the requested library as @library' do
|
151
|
-
library =
|
151
|
+
library = FactoryBot.create(:library)
|
152
152
|
get :edit, id: library.id
|
153
153
|
response.should be_forbidden
|
154
154
|
end
|
@@ -156,7 +156,7 @@ describe LibrariesController do
|
|
156
156
|
|
157
157
|
describe 'When not logged in' do
|
158
158
|
it 'should not assign the requested library as @library' do
|
159
|
-
library =
|
159
|
+
library = FactoryBot.create(:library)
|
160
160
|
get :edit, id: library.id
|
161
161
|
response.should redirect_to(new_user_session_url)
|
162
162
|
end
|
@@ -165,7 +165,7 @@ describe LibrariesController do
|
|
165
165
|
|
166
166
|
describe 'POST create' do
|
167
167
|
before(:each) do
|
168
|
-
@attrs =
|
168
|
+
@attrs = FactoryBot.attributes_for(:library)
|
169
169
|
@invalid_attrs = { name: '' }
|
170
170
|
end
|
171
171
|
|
@@ -453,7 +453,7 @@ describe LibrariesController do
|
|
453
453
|
|
454
454
|
describe 'Library' do
|
455
455
|
before(:each) do
|
456
|
-
@library =
|
456
|
+
@library = FactoryBot.create(:library)
|
457
457
|
@library.shelves.first.destroy
|
458
458
|
end
|
459
459
|
|
@@ -6,12 +6,12 @@ describe RequestStatusTypesController do
|
|
6
6
|
disconnect_sunspot
|
7
7
|
|
8
8
|
def valid_attributes
|
9
|
-
|
9
|
+
FactoryBot.attributes_for(:request_status_type)
|
10
10
|
end
|
11
11
|
|
12
12
|
describe 'GET index' do
|
13
13
|
before(:each) do
|
14
|
-
|
14
|
+
FactoryBot.create(:request_status_type)
|
15
15
|
end
|
16
16
|
|
17
17
|
describe 'When logged in as Administrator' do
|
@@ -53,7 +53,7 @@ describe RequestStatusTypesController do
|
|
53
53
|
|
54
54
|
describe 'GET show' do
|
55
55
|
before(:each) do
|
56
|
-
@request_status_type =
|
56
|
+
@request_status_type = FactoryBot.create(:request_status_type)
|
57
57
|
end
|
58
58
|
|
59
59
|
describe 'When logged in as Administrator' do
|
@@ -133,7 +133,7 @@ describe RequestStatusTypesController do
|
|
133
133
|
|
134
134
|
describe 'GET edit' do
|
135
135
|
before(:each) do
|
136
|
-
@request_status_type =
|
136
|
+
@request_status_type = FactoryBot.create(:request_status_type)
|
137
137
|
end
|
138
138
|
|
139
139
|
describe 'When logged in as Administrator' do
|
@@ -290,7 +290,7 @@ describe RequestStatusTypesController do
|
|
290
290
|
|
291
291
|
describe 'PUT update' do
|
292
292
|
before(:each) do
|
293
|
-
@request_status_type =
|
293
|
+
@request_status_type = FactoryBot.create(:request_status_type)
|
294
294
|
@attrs = valid_attributes
|
295
295
|
@invalid_attrs = { name: '' }
|
296
296
|
end
|
@@ -391,7 +391,7 @@ describe RequestStatusTypesController do
|
|
391
391
|
|
392
392
|
describe 'DELETE destroy' do
|
393
393
|
before(:each) do
|
394
|
-
@request_status_type =
|
394
|
+
@request_status_type = FactoryBot.create(:request_status_type)
|
395
395
|
end
|
396
396
|
|
397
397
|
describe 'When logged in as Administrator' do
|
@@ -6,12 +6,12 @@ describe RequestTypesController do
|
|
6
6
|
disconnect_sunspot
|
7
7
|
|
8
8
|
def valid_attributes
|
9
|
-
|
9
|
+
FactoryBot.attributes_for(:request_status_type)
|
10
10
|
end
|
11
11
|
|
12
12
|
describe 'GET index' do
|
13
13
|
before(:each) do
|
14
|
-
|
14
|
+
FactoryBot.create(:request_type)
|
15
15
|
end
|
16
16
|
|
17
17
|
describe 'When logged in as Administrator' do
|
@@ -53,7 +53,7 @@ describe RequestTypesController do
|
|
53
53
|
|
54
54
|
describe 'GET show' do
|
55
55
|
before(:each) do
|
56
|
-
@request_type =
|
56
|
+
@request_type = FactoryBot.create(:request_type)
|
57
57
|
end
|
58
58
|
|
59
59
|
describe 'When logged in as Administrator' do
|
@@ -133,7 +133,7 @@ describe RequestTypesController do
|
|
133
133
|
|
134
134
|
describe 'GET edit' do
|
135
135
|
before(:each) do
|
136
|
-
@request_type =
|
136
|
+
@request_type = FactoryBot.create(:request_type)
|
137
137
|
end
|
138
138
|
|
139
139
|
describe 'When logged in as Administrator' do
|
@@ -290,7 +290,7 @@ describe RequestTypesController do
|
|
290
290
|
|
291
291
|
describe 'PUT update' do
|
292
292
|
before(:each) do
|
293
|
-
@request_type =
|
293
|
+
@request_type = FactoryBot.create(:request_type)
|
294
294
|
@attrs = valid_attributes
|
295
295
|
@invalid_attrs = { name: '' }
|
296
296
|
end
|
@@ -391,7 +391,7 @@ describe RequestTypesController do
|
|
391
391
|
|
392
392
|
describe 'DELETE destroy' do
|
393
393
|
before(:each) do
|
394
|
-
@request_type =
|
394
|
+
@request_type = FactoryBot.create(:request_type)
|
395
395
|
end
|
396
396
|
|
397
397
|
describe 'When logged in as Administrator' do
|
@@ -6,12 +6,12 @@ describe SearchEnginesController do
|
|
6
6
|
disconnect_sunspot
|
7
7
|
|
8
8
|
def valid_attributes
|
9
|
-
|
9
|
+
FactoryBot.attributes_for(:search_engine)
|
10
10
|
end
|
11
11
|
|
12
12
|
describe 'GET index' do
|
13
13
|
before(:each) do
|
14
|
-
|
14
|
+
FactoryBot.create(:search_engine)
|
15
15
|
end
|
16
16
|
|
17
17
|
describe 'When logged in as Administrator' do
|
@@ -56,7 +56,7 @@ describe SearchEnginesController do
|
|
56
56
|
login_fixture_admin
|
57
57
|
|
58
58
|
it 'assigns the requested search_engine as @search_engine' do
|
59
|
-
search_engine =
|
59
|
+
search_engine = FactoryBot.create(:search_engine)
|
60
60
|
get :show, id: search_engine.id
|
61
61
|
assigns(:search_engine).should eq(search_engine)
|
62
62
|
end
|
@@ -66,7 +66,7 @@ describe SearchEnginesController do
|
|
66
66
|
login_fixture_librarian
|
67
67
|
|
68
68
|
it 'assigns the requested search_engine as @search_engine' do
|
69
|
-
search_engine =
|
69
|
+
search_engine = FactoryBot.create(:search_engine)
|
70
70
|
get :show, id: search_engine.id
|
71
71
|
assigns(:search_engine).should eq(search_engine)
|
72
72
|
end
|
@@ -76,7 +76,7 @@ describe SearchEnginesController do
|
|
76
76
|
login_fixture_user
|
77
77
|
|
78
78
|
it 'assigns the requested search_engine as @search_engine' do
|
79
|
-
search_engine =
|
79
|
+
search_engine = FactoryBot.create(:search_engine)
|
80
80
|
get :show, id: search_engine.id
|
81
81
|
assigns(:search_engine).should eq(search_engine)
|
82
82
|
end
|
@@ -84,7 +84,7 @@ describe SearchEnginesController do
|
|
84
84
|
|
85
85
|
describe 'When not logged in' do
|
86
86
|
it 'assigns the requested search_engine as @search_engine' do
|
87
|
-
search_engine =
|
87
|
+
search_engine = FactoryBot.create(:search_engine)
|
88
88
|
get :show, id: search_engine.id
|
89
89
|
assigns(:search_engine).should eq(search_engine)
|
90
90
|
end
|
@@ -136,7 +136,7 @@ describe SearchEnginesController do
|
|
136
136
|
login_fixture_admin
|
137
137
|
|
138
138
|
it 'assigns the requested search_engine as @search_engine' do
|
139
|
-
search_engine =
|
139
|
+
search_engine = FactoryBot.create(:search_engine)
|
140
140
|
get :edit, id: search_engine.id
|
141
141
|
assigns(:search_engine).should eq(search_engine)
|
142
142
|
end
|
@@ -146,7 +146,7 @@ describe SearchEnginesController do
|
|
146
146
|
login_fixture_librarian
|
147
147
|
|
148
148
|
it 'assigns the requested search_engine as @search_engine' do
|
149
|
-
search_engine =
|
149
|
+
search_engine = FactoryBot.create(:search_engine)
|
150
150
|
get :edit, id: search_engine.id
|
151
151
|
response.should be_forbidden
|
152
152
|
end
|
@@ -156,7 +156,7 @@ describe SearchEnginesController do
|
|
156
156
|
login_fixture_user
|
157
157
|
|
158
158
|
it 'assigns the requested search_engine as @search_engine' do
|
159
|
-
search_engine =
|
159
|
+
search_engine = FactoryBot.create(:search_engine)
|
160
160
|
get :edit, id: search_engine.id
|
161
161
|
response.should be_forbidden
|
162
162
|
end
|
@@ -164,7 +164,7 @@ describe SearchEnginesController do
|
|
164
164
|
|
165
165
|
describe 'When not logged in' do
|
166
166
|
it 'should not assign the requested search_engine as @search_engine' do
|
167
|
-
search_engine =
|
167
|
+
search_engine = FactoryBot.create(:search_engine)
|
168
168
|
get :edit, id: search_engine.id
|
169
169
|
response.should redirect_to(new_user_session_url)
|
170
170
|
end
|
@@ -290,7 +290,7 @@ describe SearchEnginesController do
|
|
290
290
|
|
291
291
|
describe 'PUT update' do
|
292
292
|
before(:each) do
|
293
|
-
@search_engine =
|
293
|
+
@search_engine = FactoryBot.create(:search_engine)
|
294
294
|
@attrs = valid_attributes
|
295
295
|
@invalid_attrs = { name: '' }
|
296
296
|
end
|
@@ -391,7 +391,7 @@ describe SearchEnginesController do
|
|
391
391
|
|
392
392
|
describe 'DELETE destroy' do
|
393
393
|
before(:each) do
|
394
|
-
@search_engine =
|
394
|
+
@search_engine = FactoryBot.create(:search_engine)
|
395
395
|
end
|
396
396
|
|
397
397
|
describe 'When logged in as Administrator' do
|