blacklight-spotlight 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,7 +37,7 @@ describe 'Adding custom metadata field data', type: :feature do
37
37
 
38
38
  click_on 'Edit'
39
39
 
40
- expect(page).to have_selector 'input[type=text][readonly]'
40
+ expect(page).to have_selector 'textarea[readonly]'
41
41
  end
42
42
  end
43
43
 
@@ -1 +1,2 @@
1
1
  gem 'thor', '~> 0.20'
2
+ gem 'i18n', '< 1.1' # pinned until Rails and i18n sort our compatibility https://github.com/rails/rails/pull/33574
@@ -7,19 +7,18 @@ describe 'spotlight/catalog/_edit_default.html.erb', type: :view do
7
7
 
8
8
  let(:document) { stub_model(::SolrDocument) }
9
9
 
10
- let(:exhibit) { stub_model(Spotlight::Exhibit) }
10
+ let(:exhibit) { FactoryBot.create(:exhibit) }
11
+ let(:custom_field) { FactoryBot.create(:custom_field, exhibit: exhibit) }
11
12
 
12
13
  before do
13
- allow(exhibit).to receive_messages(blacklight_config: blacklight_config)
14
14
 
15
15
  allow(view).to receive(:uploaded_field_label) do |config|
16
16
  "#{config.field_name} label"
17
17
  end
18
- allow(view).to receive_messages(exhibit_tags_path: 'autocomplete-path.json')
19
- allow(view).to receive_messages(blacklight_config: blacklight_config)
20
- allow(view).to receive_messages(current_exhibit: exhibit)
21
- allow(view).to receive_messages(document: document)
22
- allow(view).to receive(:can?).and_return(true)
18
+ expect(view).to receive_messages(exhibit_tags_path: 'autocomplete-path.json')
19
+ expect(view).to receive_messages(current_exhibit: exhibit)
20
+ expect(view).to receive_messages(document: document)
21
+ expect(view).to receive(:can?).at_least(:once).and_return(true)
23
22
  end
24
23
 
25
24
  it 'has a edit tag form' do
@@ -29,17 +28,33 @@ describe 'spotlight/catalog/_edit_default.html.erb', type: :view do
29
28
  end
30
29
  it 'does not have special metadata editing fields for non-uploaded resources' do
31
30
  render
32
- expect(rendered).to_not have_field 'title_field label'
31
+ expect(rendered).to_not have_field 'full_title_tesim label'
33
32
  expect(rendered).to_not have_field 'spotlight_upload_description_tesim label'
34
33
  expect(rendered).to_not have_field 'spotlight_upload_attribution_tesim label'
35
34
  expect(rendered).to_not have_field 'spotlight_upload_date_tesim label'
36
35
  end
37
36
  it 'has special metadata fields for an uploaded resource' do
38
- allow(document).to receive_messages(uploaded_resource?: true)
37
+ expect(document).to receive_messages(uploaded_resource?: true)
39
38
  render
40
- expect(rendered).to have_field 'title_field label'
39
+ expect(rendered).to have_field 'full_title_tesim label'
41
40
  expect(rendered).to have_field 'spotlight_upload_description_tesim label'
42
41
  expect(rendered).to have_field 'spotlight_upload_attribution_tesim label'
43
42
  expect(rendered).to have_field 'spotlight_upload_date_tesim label'
44
43
  end
44
+
45
+ it 'has an input for the custom field' do
46
+ custom_field.update(field_type: 'text')
47
+
48
+ render
49
+
50
+ expect(rendered).to have_field 'Some Field', type: 'textarea'
51
+ end
52
+
53
+ it 'has an single-line input for a vocab custom field' do
54
+ custom_field.update(field_type: 'vocab')
55
+
56
+ render
57
+
58
+ expect(rendered).to have_field 'Some Field', type: 'text'
59
+ end
45
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-06-27 00:00:00.000000000 Z
14
+ date: 2018-08-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -509,6 +509,20 @@ dependencies:
509
509
  - - ">="
510
510
  - !ruby/object:Gem::Version
511
511
  version: '0'
512
+ - !ruby/object:Gem::Dependency
513
+ name: i18n
514
+ requirement: !ruby/object:Gem::Requirement
515
+ requirements:
516
+ - - "<"
517
+ - !ruby/object:Gem::Version
518
+ version: '1.1'
519
+ type: :runtime
520
+ prerelease: false
521
+ version_requirements: !ruby/object:Gem::Requirement
522
+ requirements:
523
+ - - "<"
524
+ - !ruby/object:Gem::Version
525
+ version: '1.1'
512
526
  - !ruby/object:Gem::Dependency
513
527
  name: sqlite3
514
528
  requirement: !ruby/object:Gem::Requirement
@@ -1052,6 +1066,7 @@ files:
1052
1066
  - app/views/spotlight/catalog/_document_row.html.erb
1053
1067
  - app/views/spotlight/catalog/_document_visibility_control.html.erb
1054
1068
  - app/views/spotlight/catalog/_edit_default.html.erb
1069
+ - app/views/spotlight/catalog/_edit_sidecar.html.erb
1055
1070
  - app/views/spotlight/catalog/_index_compact_default.html.erb
1056
1071
  - app/views/spotlight/catalog/_reindex_progress_panel.html.erb
1057
1072
  - app/views/spotlight/catalog/_tophat_default.html.erb
@@ -1184,6 +1199,8 @@ files:
1184
1199
  - config/i18n-tasks.yml
1185
1200
  - config/locales/devise.en.yml
1186
1201
  - config/locales/spotlight.en.yml
1202
+ - config/locales/spotlight.it.yml
1203
+ - config/locales/spotlight.zh.yml
1187
1204
  - config/routes.rb
1188
1205
  - db/migrate/20131119213142_create_spotlight_pages.rb
1189
1206
  - db/migrate/20131120172811_create_spotlight_attachments.rb
@@ -1247,6 +1264,7 @@ files:
1247
1264
  - db/migrate/20180406212516_add_default_locale_reference_to_spotlight_pages.rb
1248
1265
  - db/migrate/20180529225807_change_spotlight_pages_content_column_to_medium_text.rb
1249
1266
  - lib/blacklight/spotlight.rb
1267
+ - lib/generators/spotlight/increase_paper_trail_column_size_generator.rb
1250
1268
  - lib/generators/spotlight/install_generator.rb
1251
1269
  - lib/generators/spotlight/scaffold_resource_generator.rb
1252
1270
  - lib/generators/spotlight/templates/catalog_controller.rb
@@ -1254,6 +1272,7 @@ files:
1254
1272
  - lib/generators/spotlight/templates/config/initializers/spotlight_initializer.rb
1255
1273
  - lib/generators/spotlight/templates/config/initializers/translation.rb
1256
1274
  - lib/generators/spotlight/templates/config/sitemap.rb
1275
+ - lib/generators/spotlight/templates/migrations/20180814221815_change_paper_trail_versions_object_column_to_medium_text.rb
1257
1276
  - lib/generators/spotlight/templates/solr/config/schema.xml
1258
1277
  - lib/generators/spotlight/templates/solr/config/solrconfig.xml
1259
1278
  - lib/generators/spotlight/templates/spotlight.js