enju_manifestation_viewer 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -0
- data/Rakefile +1 -1
- data/lib/enju_manifestation_viewer/version.rb +1 -1
- data/spec/dummy/app/assets/images/icons/book.png +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +1 -0
- data/spec/dummy/app/helpers/application_helper.rb +1 -0
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/config/initializers/assets.rb +1 -0
- data/spec/dummy/db/migrate/005_create_manifestations.rb +3 -3
- data/spec/dummy/db/migrate/20081025083323_create_countries.rb +6 -5
- data/spec/dummy/db/migrate/20081025083905_create_languages.rb +1 -0
- data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +1 -1
- data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +1 -0
- data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +1 -0
- data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +1 -0
- data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +1 -1
- data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +5 -0
- data/spec/dummy/db/migrate/20191219122214_create_custom_properties.rb +12 -0
- data/spec/dummy/db/schema.rb +12 -1
- data/spec/dummy/tmp/development_secret.txt +1 -0
- data/spec/factories/manifestation.rb +14 -0
- data/spec/fixtures/carrier_types.yml +54 -0
- data/spec/fixtures/content_types.yml +98 -0
- data/spec/fixtures/frequencies.yml +68 -0
- data/spec/fixtures/languages.yml +1900 -0
- data/spec/fixtures/libraries.yml +102 -0
- data/spec/fixtures/profiles.yml +78 -0
- data/spec/fixtures/roles.yml +21 -0
- data/spec/fixtures/user_groups.yml +45 -0
- data/spec/fixtures/user_has_roles.yml +40 -0
- data/spec/fixtures/users.yml +51 -0
- data/spec/models/manifestation_spec.rb +13 -0
- data/spec/rails_helper.rb +7 -0
- data/spec/support/devise.rb +2 -2
- data/spec/system/library_groups_spec.rb +21 -0
- data/spec/system/manifestations_spec.rb +39 -0
- metadata +296 -194
- data/README.rdoc +0 -10
@@ -0,0 +1,102 @@
|
|
1
|
+
---
|
2
|
+
library_00001:
|
3
|
+
name: web
|
4
|
+
short_display_name: Web
|
5
|
+
display_name: World Wide Web
|
6
|
+
fax_number:
|
7
|
+
updated_at: 2007-08-31 00:18:06.662349 +09:00
|
8
|
+
telephone_number_1:
|
9
|
+
telephone_number_2:
|
10
|
+
id: 1
|
11
|
+
zip_code:
|
12
|
+
region:
|
13
|
+
locality:
|
14
|
+
street:
|
15
|
+
created_at: 2007-08-13 18:10:00 +09:00
|
16
|
+
library_group_id: 1
|
17
|
+
call_number_delimiter: "|"
|
18
|
+
position: 1
|
19
|
+
library_00002:
|
20
|
+
name: kamata
|
21
|
+
short_display_name: 蒲田
|
22
|
+
display_name: Kamata Library
|
23
|
+
fax_number: ""
|
24
|
+
updated_at: 2007-08-31 00:18:06.662349 +09:00
|
25
|
+
telephone_number_1: 81-3-3732-5111
|
26
|
+
telephone_number_2: ""
|
27
|
+
id: 2
|
28
|
+
zip_code: 144-8535
|
29
|
+
region: Tokyo
|
30
|
+
locality:
|
31
|
+
street:
|
32
|
+
created_at: 2007-08-13 18:10:00 +09:00
|
33
|
+
library_group_id: 1
|
34
|
+
call_number_delimiter: "|"
|
35
|
+
position: 2
|
36
|
+
isil: "JP-0000000"
|
37
|
+
library_00003:
|
38
|
+
name: hachioji
|
39
|
+
short_display_name: 八王子
|
40
|
+
display_name: Hachioji Library
|
41
|
+
fax_number: 042-637-2116
|
42
|
+
updated_at: 2007-08-31 00:18:16.188285 +09:00
|
43
|
+
telephone_number_1: 042-637-2033
|
44
|
+
telephone_number_2: ""
|
45
|
+
id: 3
|
46
|
+
zip_code: 192-0982
|
47
|
+
region: Tokyo
|
48
|
+
locality: Hachioji
|
49
|
+
street:
|
50
|
+
created_at: 2007-08-14 16:37:00 +09:00
|
51
|
+
library_group_id: 1
|
52
|
+
call_number_delimiter: "|"
|
53
|
+
position: 3
|
54
|
+
library_00004:
|
55
|
+
name: mita
|
56
|
+
short_display_name: 三田
|
57
|
+
display_name: Mita Library
|
58
|
+
fax_number: ""
|
59
|
+
updated_at: 2007-08-31 00:18:20.043951 +09:00
|
60
|
+
telephone_number_1: ""
|
61
|
+
telephone_number_2: ""
|
62
|
+
id: 4
|
63
|
+
zip_code: 108-8345
|
64
|
+
region: Tokyo
|
65
|
+
locality: Minato
|
66
|
+
street:
|
67
|
+
created_at: 2007-08-23 19:51:00 +09:00
|
68
|
+
library_group_id: 1
|
69
|
+
call_number_delimiter: "|"
|
70
|
+
position: 4
|
71
|
+
|
72
|
+
# == Schema Information
|
73
|
+
#
|
74
|
+
# Table name: libraries
|
75
|
+
#
|
76
|
+
# id :integer not null, primary key
|
77
|
+
# name :string(255) not null
|
78
|
+
# display_name :text
|
79
|
+
# short_display_name :string(255) not null
|
80
|
+
# zip_code :string(255)
|
81
|
+
# street :text
|
82
|
+
# locality :text
|
83
|
+
# region :text
|
84
|
+
# telephone_number_1 :string(255)
|
85
|
+
# telephone_number_2 :string(255)
|
86
|
+
# fax_number :string(255)
|
87
|
+
# note :text
|
88
|
+
# call_number_rows :integer default(1), not null
|
89
|
+
# call_number_delimiter :string(255) default("|"), not null
|
90
|
+
# library_group_id :integer default(1), not null
|
91
|
+
# users_count :integer default(0), not null
|
92
|
+
# position :integer
|
93
|
+
# country_id :integer
|
94
|
+
# created_at :datetime not null
|
95
|
+
# updated_at :datetime not null
|
96
|
+
# deleted_at :datetime
|
97
|
+
# opening_hour :text
|
98
|
+
# latitude :float
|
99
|
+
# longitude :float
|
100
|
+
# isil :string(255)
|
101
|
+
#
|
102
|
+
|
@@ -0,0 +1,78 @@
|
|
1
|
+
---
|
2
|
+
profile_admin:
|
3
|
+
updated_at: 2008-05-31 13:16:30.163731 +09:00
|
4
|
+
user_group_id: 2
|
5
|
+
id: 1
|
6
|
+
user_id: 1
|
7
|
+
note:
|
8
|
+
library_id: 2
|
9
|
+
created_at: 2007-11-19 16:58:32.111941 +09:00
|
10
|
+
required_role_id: 4
|
11
|
+
user_number: "00001"
|
12
|
+
locale: "en"
|
13
|
+
profile_librarian1:
|
14
|
+
updated_at: 2008-05-31 12:41:16.337474 +09:00
|
15
|
+
user_group_id: 1
|
16
|
+
id: 2
|
17
|
+
user_id: 2
|
18
|
+
note:
|
19
|
+
library_id: 1
|
20
|
+
created_at: 2007-11-19 16:58:33.172441 +09:00
|
21
|
+
required_role_id: 1
|
22
|
+
user_number: "00002"
|
23
|
+
locale: "ja"
|
24
|
+
profile_user1:
|
25
|
+
updated_at: 2008-05-31 13:02:25.101261 +09:00
|
26
|
+
user_group_id: 1
|
27
|
+
id: 3
|
28
|
+
user_id: 3
|
29
|
+
note:
|
30
|
+
library_id: 2
|
31
|
+
created_at: 2007-11-19 16:58:34.637413 +09:00
|
32
|
+
required_role_id: 3
|
33
|
+
user_number: "00003"
|
34
|
+
locale: "ja"
|
35
|
+
profile_librarian2:
|
36
|
+
updated_at: 2008-05-31 12:42:23.340575 +09:00
|
37
|
+
user_group_id: 1
|
38
|
+
id: 4
|
39
|
+
user_id: 4
|
40
|
+
note:
|
41
|
+
library_id: 2
|
42
|
+
created_at: 2008-01-18 12:24:04.222344 +09:00
|
43
|
+
required_role_id: 1
|
44
|
+
user_number: "00004"
|
45
|
+
locale: "ja"
|
46
|
+
profile_user2:
|
47
|
+
updated_at: 2008-05-31 12:42:44.711117 +09:00
|
48
|
+
user_group_id: 1
|
49
|
+
id: 5
|
50
|
+
user_id: 5
|
51
|
+
note:
|
52
|
+
library_id: 1
|
53
|
+
created_at: 2008-01-18 13:29:06.922728 +09:00
|
54
|
+
required_role_id: 2
|
55
|
+
# user_number: '00005'
|
56
|
+
locale: "ja"
|
57
|
+
profile_user3:
|
58
|
+
updated_at: 2008-05-31 13:02:25.101261 +09:00
|
59
|
+
user_group_id: 1
|
60
|
+
id: 6
|
61
|
+
user_id: 6
|
62
|
+
note:
|
63
|
+
library_id: 2
|
64
|
+
created_at: 2007-11-19 16:58:34.637413 +09:00
|
65
|
+
required_role_id: 3
|
66
|
+
user_number: "00006"
|
67
|
+
locale: "ja"
|
68
|
+
profile_user4:
|
69
|
+
updated_at: 2008-05-31 13:02:25.101261 +09:00
|
70
|
+
user_group_id: 1
|
71
|
+
id: 7
|
72
|
+
user_id: 7
|
73
|
+
note:
|
74
|
+
library_id: 2
|
75
|
+
created_at: 2007-11-19 16:58:34.637413 +09:00
|
76
|
+
required_role_id: 3
|
77
|
+
user_number: "00007"
|
78
|
+
locale: "ja"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
role_00001:
|
3
|
+
name: Guest
|
4
|
+
display_name: Guest
|
5
|
+
id: 1
|
6
|
+
note:
|
7
|
+
role_00002:
|
8
|
+
name: User
|
9
|
+
display_name: User
|
10
|
+
id: 2
|
11
|
+
note:
|
12
|
+
role_00003:
|
13
|
+
name: Librarian
|
14
|
+
display_name: Librarian
|
15
|
+
id: 3
|
16
|
+
note:
|
17
|
+
role_00004:
|
18
|
+
name: Administrator
|
19
|
+
display_name: Administrator
|
20
|
+
id: 4
|
21
|
+
note:
|
@@ -0,0 +1,45 @@
|
|
1
|
+
---
|
2
|
+
user_group_00001:
|
3
|
+
name: not_specified
|
4
|
+
display_name: (not specified)
|
5
|
+
updated_at: 2007-12-13 21:00:51.564542 +09:00
|
6
|
+
id: 1
|
7
|
+
note: ""
|
8
|
+
created_at: 2007-12-13 21:00:01.674976 +09:00
|
9
|
+
position: 1
|
10
|
+
valid_period_for_new_user: 0
|
11
|
+
user_group_00002:
|
12
|
+
name: user
|
13
|
+
display_name: User
|
14
|
+
updated_at: 2007-12-23 03:14:56.836548 +09:00
|
15
|
+
id: 2
|
16
|
+
note: ""
|
17
|
+
created_at: 2007-12-23 03:14:40.173954 +09:00
|
18
|
+
position: 2
|
19
|
+
valid_period_for_new_user: 365
|
20
|
+
user_group_00003:
|
21
|
+
name: faculty
|
22
|
+
display_name: Faculty
|
23
|
+
updated_at: 2007-12-23 03:15:05.134351 +09:00
|
24
|
+
id: 3
|
25
|
+
note: ""
|
26
|
+
created_at: 2007-12-23 03:15:05.126457 +09:00
|
27
|
+
position: 3
|
28
|
+
valid_period_for_new_user: 730
|
29
|
+
|
30
|
+
# == Schema Information
|
31
|
+
#
|
32
|
+
# Table name: user_groups
|
33
|
+
#
|
34
|
+
# id :integer not null, primary key
|
35
|
+
# name :string(255)
|
36
|
+
# display_name :text
|
37
|
+
# note :text
|
38
|
+
# position :integer
|
39
|
+
# created_at :datetime not null
|
40
|
+
# updated_at :datetime not null
|
41
|
+
# deleted_at :datetime
|
42
|
+
# valid_period_for_new_user :integer default(0), not null
|
43
|
+
# expired_at :datetime
|
44
|
+
#
|
45
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
2
|
+
|
3
|
+
admin:
|
4
|
+
user_id: 1
|
5
|
+
role_id: 4
|
6
|
+
|
7
|
+
librarian1:
|
8
|
+
user_id: 2
|
9
|
+
role_id: 3
|
10
|
+
|
11
|
+
user1:
|
12
|
+
user_id: 3
|
13
|
+
role_id: 2
|
14
|
+
|
15
|
+
librarian2:
|
16
|
+
user_id: 4
|
17
|
+
role_id: 3
|
18
|
+
|
19
|
+
user2:
|
20
|
+
user_id: 5
|
21
|
+
role_id: 2
|
22
|
+
|
23
|
+
user3:
|
24
|
+
user_id: 6
|
25
|
+
role_id: 2
|
26
|
+
|
27
|
+
user4:
|
28
|
+
user_id: 7
|
29
|
+
role_id: 2
|
30
|
+
|
31
|
+
# == Schema Information
|
32
|
+
#
|
33
|
+
# Table name: user_has_roles
|
34
|
+
#
|
35
|
+
# id :integer not null, primary key
|
36
|
+
# user_id :integer
|
37
|
+
# role_id :integer
|
38
|
+
# created_at :datetime
|
39
|
+
# updated_at :datetime
|
40
|
+
#
|
@@ -0,0 +1,51 @@
|
|
1
|
+
---
|
2
|
+
admin:
|
3
|
+
updated_at: 2008-05-31 13:16:30.163731 +09:00
|
4
|
+
encrypted_password: $2a$10$vHohD1WflnTIqAa8zMkF9evwAgIZRw3XuR4d3bi29M.jph/MB/AJi
|
5
|
+
id: 1
|
6
|
+
username: enjuadmin
|
7
|
+
email: tanabe@kamata.lib.teu.ac.jp
|
8
|
+
created_at: 2007-11-19 16:58:32.111941 +09:00
|
9
|
+
librarian1:
|
10
|
+
updated_at: 2008-05-31 12:41:16.337474 +09:00
|
11
|
+
encrypted_password: $2a$10$9O2VuTccN4gHq36ARg0QReSrb1D7WrBBhZZ759RM9moHbB0W5zCzS
|
12
|
+
id: 2
|
13
|
+
username: librarian1
|
14
|
+
email: librarian1@kamata.lib.teu.ac.jp
|
15
|
+
created_at: 2007-11-19 16:58:33.172441 +09:00
|
16
|
+
user1:
|
17
|
+
updated_at: 2008-05-31 13:02:25.101261 +09:00
|
18
|
+
encrypted_password: $2a$10$JthS59A0BNkDOoFpCXM0V.GhhffKaoWKbzpPahYp/vTFrOyM7h/uW
|
19
|
+
id: 3
|
20
|
+
username: user1
|
21
|
+
email: user1@kamata.lib.teu.ac.jp
|
22
|
+
created_at: 2007-11-19 16:58:34.637413 +09:00
|
23
|
+
librarian2:
|
24
|
+
updated_at: 2008-05-31 12:42:23.340575 +09:00
|
25
|
+
encrypted_password: $2a$10$YmmTGrYQ1Ir6oc7wXnp.GuNeO1eYLoP3sv8wMSIrTdaGw2BPwRrpS
|
26
|
+
id: 4
|
27
|
+
username: librarian2
|
28
|
+
email: librarian2@library.example.jp
|
29
|
+
created_at: 2008-01-18 12:24:04.222344 +09:00
|
30
|
+
user2:
|
31
|
+
updated_at: 2008-05-31 12:42:44.711117 +09:00
|
32
|
+
encrypted_password: $2a$10$i7UjJhLVrJM/J7qaTwW39OXw1NiwowUEbtNHVDV0sqMLjX9.UO9ca
|
33
|
+
id: 5
|
34
|
+
username: user2
|
35
|
+
email: user2@library.example.jp
|
36
|
+
created_at: 2008-01-18 13:29:06.922728 +09:00
|
37
|
+
user3:
|
38
|
+
updated_at: 2008-05-31 13:02:25.101261 +09:00
|
39
|
+
encrypted_password: cc53de0c2d9a1a228daa9a673ec824473747e17507a6c3c4f7e5eff8821f531d4b9e23616b3ddc66fe17006b2298a556fbd567ac080e87f00f37eef8cee6c417
|
40
|
+
id: 6
|
41
|
+
username: user3
|
42
|
+
email: user3@kamata.lib.teu.ac.jp
|
43
|
+
created_at: 2007-11-19 16:58:34.637413 +09:00
|
44
|
+
user4:
|
45
|
+
updated_at: 2008-05-31 13:02:25.101261 +09:00
|
46
|
+
encrypted_password: cc53de0c2d9a1a228daa9a673ec824473747e17507a6c3c4f7e5eff8821f531d4b9e23616b3ddc66fe17006b2298a556fbd567ac080e87f00f37eef8cee6c417
|
47
|
+
id: 7
|
48
|
+
username: user4
|
49
|
+
email: user4@kamata.lib.teu.ac.jp
|
50
|
+
created_at: 2007-11-19 16:58:34.637413 +09:00
|
51
|
+
locked_at: <%= 1.day.ago.to_s(:db) %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
describe Manifestation, solr: true do
|
4
|
+
fixtures :all
|
5
|
+
|
6
|
+
it "should get youtube_id" do
|
7
|
+
manifestations(:manifestation_00022).youtube_id.should eq 'BSHBzd9ftDE'
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should get nicovideo_id" do
|
11
|
+
manifestations(:manifestation_00023).nicovideo_id.should eq 'sm3015373'
|
12
|
+
end
|
13
|
+
end
|
data/spec/rails_helper.rb
CHANGED
@@ -12,6 +12,7 @@ require 'spec_helper'
|
|
12
12
|
require 'rspec/rails'
|
13
13
|
require 'capybara/rspec'
|
14
14
|
require 'pundit/rspec'
|
15
|
+
require 'factory_bot_rails'
|
15
16
|
# Add additional requires below this line. Rails is not loaded until this point!
|
16
17
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
17
18
|
|
@@ -57,5 +58,11 @@ RSpec.configure do |config|
|
|
57
58
|
# The different available types are documented in the features, such as in
|
58
59
|
# https://relishapp.com/rspec/rspec-rails/docs
|
59
60
|
config.infer_spec_type_from_file_location!
|
61
|
+
|
62
|
+
config.before(:each) do |example|
|
63
|
+
if example.metadata[:type] == :system
|
64
|
+
driven_by :selenium, using: :headless_chrome, screen_size: [1400, 1400]
|
65
|
+
end
|
66
|
+
end
|
60
67
|
end
|
61
68
|
|
data/spec/support/devise.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
RSpec.configure do |config|
|
2
|
-
config.include Devise::
|
3
|
-
config.include Devise::
|
2
|
+
config.include Devise::Test::ControllerHelpers, :type => :controller
|
3
|
+
config.include Devise::Test::ControllerHelpers, :type => :view
|
4
4
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe 'LibraryGroups', type: :system do
|
4
|
+
include Devise::Test::IntegrationHelpers
|
5
|
+
fixtures :all
|
6
|
+
|
7
|
+
describe 'When logged in as Librarian' do
|
8
|
+
before do
|
9
|
+
sign_in users(:admin)
|
10
|
+
end
|
11
|
+
|
12
|
+
it "renders selector for multilpe book jacket sources." do
|
13
|
+
visit edit_library_group_path(LibraryGroup.first.id)
|
14
|
+
expect(page).to have_selector "select#library_group_book_jacket_source"
|
15
|
+
expect(page).to have_selector "select#library_group_book_jacket_source option", minimum: 2
|
16
|
+
expect(page).to have_selector 'select#library_group_book_jacket_source option[value="google"]'
|
17
|
+
expect(page).to have_selector 'select#library_group_book_jacket_source option[value="openbd"]'
|
18
|
+
expect(page).to have_selector 'select#library_group_book_jacket_source option[value="hanmotocom"]'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
RSpec.describe 'Manifestations', type: :system do
|
4
|
+
include Devise::Test::IntegrationHelpers
|
5
|
+
fixtures :all
|
6
|
+
before do
|
7
|
+
@manifestation = FactoryBot.create(:manifestation)
|
8
|
+
CarrierType.find_by(name: 'volume').update(attachment: File.open("#{Rails.root.to_s}/app/assets/images/icons/book.png"))
|
9
|
+
end
|
10
|
+
|
11
|
+
describe 'When logged in as Librarian' do
|
12
|
+
before do
|
13
|
+
sign_in users(:librarian1)
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'should show default manifestation' do
|
17
|
+
visit manifestation_path(@manifestation.id)
|
18
|
+
expect(page).to have_content @manifestation.original_title
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'When logged in as User' do
|
23
|
+
before do
|
24
|
+
sign_in users(:user1)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should show default manifestation' do
|
28
|
+
visit manifestation_path(@manifestation.id)
|
29
|
+
expect(page).to have_content @manifestation.original_title
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe 'When not logged in' do
|
34
|
+
it 'should show default manifestation' do
|
35
|
+
visit manifestation_path(@manifestation.id)
|
36
|
+
expect(page).to have_content @manifestation.original_title
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|