mods_display 0.10.1 → 1.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -1
  3. data/.rubocop_todo.yml +433 -35
  4. data/README.md +0 -95
  5. data/app/components/mods_display/field_component.html.erb +13 -0
  6. data/app/components/mods_display/field_component.rb +27 -0
  7. data/app/components/mods_display/list_field_component.html.erb +11 -0
  8. data/app/components/mods_display/list_field_component.rb +10 -0
  9. data/app/components/mods_display/record_component.html.erb +5 -0
  10. data/app/components/mods_display/record_component.rb +39 -0
  11. data/app/helpers/mods_display/record_helper.rb +106 -0
  12. data/app/models/mods_display/record.rb +26 -0
  13. data/config/locales/en.yml +1 -1
  14. data/config.ru +9 -0
  15. data/lib/mods_display/engine.rb +13 -0
  16. data/lib/mods_display/fields/access_condition.rb +4 -0
  17. data/lib/mods_display/fields/contents.rb +14 -15
  18. data/lib/mods_display/fields/field.rb +13 -149
  19. data/lib/mods_display/fields/genre.rb +4 -0
  20. data/lib/mods_display/fields/imprint.rb +52 -3
  21. data/lib/mods_display/fields/name.rb +11 -20
  22. data/lib/mods_display/fields/nested_related_item.rb +7 -18
  23. data/lib/mods_display/fields/note.rb +4 -0
  24. data/lib/mods_display/fields/related_item.rb +4 -0
  25. data/lib/mods_display/fields/sub_title.rb +3 -3
  26. data/lib/mods_display/fields/subject.rb +13 -39
  27. data/lib/mods_display/fields/title.rb +4 -0
  28. data/lib/mods_display/fields/values.rb +4 -4
  29. data/lib/mods_display/html.rb +54 -107
  30. data/lib/mods_display/version.rb +1 -1
  31. data/lib/mods_display.rb +2 -23
  32. data/mods_display.gemspec +15 -9
  33. metadata +45 -105
  34. data/.github/workflows/ruby.yml +0 -24
  35. data/.gitignore +0 -21
  36. data/lib/mods_display/configuration/access_condition.rb +0 -21
  37. data/lib/mods_display/configuration/base.rb +0 -34
  38. data/lib/mods_display/configuration/genre.rb +0 -9
  39. data/lib/mods_display/configuration/imprint.rb +0 -13
  40. data/lib/mods_display/configuration/name.rb +0 -9
  41. data/lib/mods_display/configuration/note.rb +0 -9
  42. data/lib/mods_display/configuration/related_item.rb +0 -9
  43. data/lib/mods_display/configuration/subject.rb +0 -13
  44. data/lib/mods_display/configuration/title.rb +0 -9
  45. data/lib/mods_display/configuration.rb +0 -93
  46. data/lib/mods_display/controller_extension.rb +0 -32
  47. data/lib/mods_display/helpers/record_helper.rb +0 -131
  48. data/lib/mods_display/model_extension.rb +0 -22
  49. data/lib/mods_display/railtie.rb +0 -10
  50. data/spec/configuration/access_condition_spec.rb +0 -10
  51. data/spec/configuration/base_spec.rb +0 -39
  52. data/spec/fake_app.rb +0 -18
  53. data/spec/fields/abstract_spec.rb +0 -39
  54. data/spec/fields/access_condition_spec.rb +0 -107
  55. data/spec/fields/audience_spec.rb +0 -24
  56. data/spec/fields/cartographics_spec.rb +0 -38
  57. data/spec/fields/collection_spec.rb +0 -77
  58. data/spec/fields/contact_spec.rb +0 -23
  59. data/spec/fields/contents_spec.rb +0 -39
  60. data/spec/fields/description_spec.rb +0 -55
  61. data/spec/fields/extent_spec.rb +0 -31
  62. data/spec/fields/form_spec.rb +0 -49
  63. data/spec/fields/genre_spec.rb +0 -34
  64. data/spec/fields/geo_spec.rb +0 -40
  65. data/spec/fields/identifier_spec.rb +0 -61
  66. data/spec/fields/imprint_spec.rb +0 -289
  67. data/spec/fields/language_spec.rb +0 -51
  68. data/spec/fields/location_spec.rb +0 -81
  69. data/spec/fields/name_spec.rb +0 -166
  70. data/spec/fields/nested_related_item_spec.rb +0 -89
  71. data/spec/fields/note_spec.rb +0 -72
  72. data/spec/fields/related_item_spec.rb +0 -72
  73. data/spec/fields/resource_type_spec.rb +0 -34
  74. data/spec/fields/sub_title_spec.rb +0 -20
  75. data/spec/fields/subject_spec.rb +0 -113
  76. data/spec/fields/title_spec.rb +0 -82
  77. data/spec/fixtures/access_condition_fixtures.rb +0 -58
  78. data/spec/fixtures/cartographics_fixtures.rb +0 -52
  79. data/spec/fixtures/imprint_fixtures.rb +0 -349
  80. data/spec/fixtures/name_fixtures.rb +0 -398
  81. data/spec/fixtures/nested_realted_items_fixtures.rb +0 -64
  82. data/spec/fixtures/related_item_fixtures.rb +0 -107
  83. data/spec/fixtures/subjects_fixtures.rb +0 -115
  84. data/spec/fixtures/title_fixtures.rb +0 -115
  85. data/spec/helpers/record_helper_spec.rb +0 -241
  86. data/spec/integration/configuration_spec.rb +0 -57
  87. data/spec/integration/html_spec.rb +0 -87
  88. data/spec/integration/installation_spec.rb +0 -26
  89. data/spec/spec_helper.rb +0 -46
  90. data/spec/test_fr.yml +0 -3
@@ -1,72 +0,0 @@
1
- require 'spec_helper'
2
-
3
- def mods_display_note(mods_record)
4
- ModsDisplay::Note.new(mods_record, ModsDisplay::Configuration::Base.new, double('controller'))
5
- end
6
-
7
- describe ModsDisplay::Note do
8
- before(:all) do
9
- @note = Stanford::Mods::Record.new.from_str('<mods><note>Note Field</note></mods>', false).note
10
- @display_label = Stanford::Mods::Record.new.from_str(
11
- "<mods><note displayLabel='Special Label'>Note Field</note></mods>", false
12
- ).note
13
- @sor_label = Stanford::Mods::Record.new.from_str(
14
- "<mods><note type='statement of responsibility'>Note Field</note></mods>", false
15
- ).note
16
- @contact_note = Stanford::Mods::Record.new.from_str(
17
- "<mods><note type='contact'>jdoe@example.com</note><note>Note Field</note></mods>", false
18
- ).note
19
- @type_label = Stanford::Mods::Record.new.from_str(
20
- "<mods><note type='some other Type'>Note Field</note></mods>", false
21
- ).note
22
- @complex_label = Stanford::Mods::Record.new.from_str(
23
- "<mods>
24
- <note>Note Field</note><note>2nd Note Field</note>
25
- <note type='statement of responsibility'>SoR</note>
26
- <note>Another Note</note>
27
- </mods>", false
28
- ).note
29
- end
30
- describe 'label' do
31
- it 'should have a default label' do
32
- expect(mods_display_note(@note).fields.first.label).to eq('Note:')
33
- end
34
- it 'should use the displayLabel attribute when one is available' do
35
- expect(mods_display_note(@display_label).fields.first.label).to eq('Special Label:')
36
- end
37
- it 'should use get a label from a list of translations' do
38
- expect(mods_display_note(@sor_label).fields.first.label).to eq('Statement of responsibility:')
39
- end
40
- it 'should use use the capitalized type attribute if one is present' do
41
- expect(mods_display_note(@type_label).fields.first.label).to eq('Some other type:')
42
- end
43
- end
44
-
45
- describe 'fields' do
46
- it 'should handle single values' do
47
- fields = mods_display_note(@note).fields
48
- expect(fields.length).to eq(1)
49
- expect(fields.first.values).to eq(['Note Field'])
50
- end
51
- it 'should handle complex grouping' do
52
- fields = mods_display_note(@complex_label).fields
53
- expect(fields.length).to eq(3)
54
- expect(fields.first.label).to eq('Note:')
55
- expect(fields.first.values.length).to eq 2
56
- expect(fields.first.values).to eq(['Note Field', '2nd Note Field'])
57
-
58
- expect(fields[1].label).to eq 'Statement of responsibility:'
59
- expect(fields[1].values.length).to eq 1
60
- expect(fields[1].values).to eq(['SoR'])
61
-
62
- expect(fields.last.label).to eq('Note:')
63
- expect(fields.last.values.length).to eq 1
64
- expect(fields.last.values).to eq(['Another Note'])
65
- end
66
- it 'should not include any contact fields' do
67
- fields = mods_display_note(@contact_note).fields
68
- expect(fields.length).to eq(1)
69
- expect(fields.first.values).to eq(['Note Field'])
70
- end
71
- end
72
- end
@@ -1,72 +0,0 @@
1
- require 'spec_helper'
2
-
3
- def mods_display_item(mods_record)
4
- ModsDisplay::RelatedItem.new(mods_record, ModsDisplay::Configuration::Base.new, double('controller'))
5
- end
6
-
7
- describe ModsDisplay::RelatedItem do
8
- include RelatedItemFixtures
9
- include NestedRelatedItemFixtures
10
-
11
- before(:all) do
12
- @item = Stanford::Mods::Record.new.from_str(basic_related_item_fixture, false).related_item
13
- @linked_item = Stanford::Mods::Record.new.from_str(linked_related_item_fixture, false).related_item
14
- @collection = Stanford::Mods::Record.new.from_str(related_item_collection_fixture, false).related_item
15
- @display_label = Stanford::Mods::Record.new.from_str(related_item_display_label_fixture, false).related_item
16
- @location = Stanford::Mods::Record.new.from_str(related_item_location_fixture, false).related_item
17
- @reference = Stanford::Mods::Record.new.from_str(related_item_reference_fixture, false).related_item
18
- @blank_item = Stanford::Mods::Record.new.from_str(blank_related_item_fixture, false).related_item
19
- @multi_items = Stanford::Mods::Record.new.from_str(multi_related_item_fixture, false).related_item
20
- @constituent_items = Stanford::Mods::Record.new.from_str(multi_constituent_fixture, false).related_item
21
- end
22
-
23
- it 'excludes related items that will be rendered as a nested record' do
24
- expect(mods_display_item(@constituent_items).fields).to be_empty
25
- end
26
-
27
- describe 'label' do
28
- it 'should default to Related Item' do
29
- expect(mods_display_item(@item).fields.first.label).to eq('Related item:')
30
- end
31
- it 'should get the location label' do
32
- expect(mods_display_item(@location).fields.first.label).to eq('Location:')
33
- end
34
- it 'should get the reference label' do
35
- expect(mods_display_item(@reference).fields.first.label).to eq('Referenced by:')
36
- end
37
- it 'should get the displayLabel if available' do
38
- expect(mods_display_item(@display_label).fields.first.label).to eq('Special Item:')
39
- end
40
- end
41
- describe 'fields' do
42
- it 'should get a location if it is available' do
43
- fields = mods_display_item(@item).fields
44
- expect(fields.length).to eq(1)
45
- expect(fields.first.values).to eq(['A Related Item'])
46
- end
47
- it 'should return a link if there is a location/url present' do
48
- fields = mods_display_item(@linked_item).fields
49
- expect(fields.length).to eq(1)
50
- expect(fields.first.values).to eq(["<a href='http://library.stanford.edu/'>A Related Item</a>"])
51
- end
52
- it 'should not return any fields if the described related item is a collection' do
53
- expect(mods_display_item(@collection).fields).to eq([])
54
- end
55
- it 'should not return empty links when there is no title or link' do
56
- expect(mods_display_item(@blank_item).fields).to eq([])
57
- end
58
- it 'should concat the isReferencedBy related item title with other metadata' do
59
- fields = mods_display_item(@reference).fields
60
- expect(fields.length).to eq(1)
61
- expect(fields.first.values).to eq(['The title DATE 124'])
62
- end
63
- it 'should collapse labels down into the same record' do
64
- fields = mods_display_item(@multi_items).fields
65
- expect(fields.length).to eq(1)
66
- expect(fields.first.label).to eq('Related item:')
67
- expect(fields.first.values.length).to eq(2)
68
- expect(fields.first.values.first).to(match(%r{<a href=.*>Library</a>}))
69
- expect(fields.first.values.last).to(match(%r{<a href=.*>SDR</a>}))
70
- end
71
- end
72
- end
@@ -1,34 +0,0 @@
1
- require 'spec_helper'
2
-
3
- def mods_display_resource_type(mods_record)
4
- ModsDisplay::ResourceType.new(mods_record, ModsDisplay::Configuration::Base.new, double('controller'))
5
- end
6
-
7
- describe ModsDisplay::ResourceType do
8
- before(:all) do
9
- @type = Stanford::Mods::Record.new.from_str(
10
- '<mods><typeOfResource>Resource Type</typeOfResource></mods>', false
11
- ).typeOfResource
12
- @downcase = Stanford::Mods::Record.new.from_str(
13
- '<mods><typeOfResource>resource type</typeOfResource></mods>', false
14
- ).typeOfResource
15
- @display_label = Stanford::Mods::Record.new.from_str(
16
- "<mods><typeOfResource displayLabel='Special label'>Resource Type</typeOfResource></mods>", false
17
- ).typeOfResource
18
- end
19
- it "should default to a label of 'Type of resource'" do
20
- fields = mods_display_resource_type(@type).fields
21
- expect(fields.length).to eq(1)
22
- expect(fields.first.label).to eq('Type of resource:')
23
- end
24
- it 'should use the displayLabel attribute when present' do
25
- fields = mods_display_resource_type(@display_label).fields
26
- expect(fields.length).to eq(1)
27
- expect(fields.first.label).to eq('Special label:')
28
- end
29
- it 'passes the field value through' do
30
- fields = mods_display_resource_type(@downcase).fields
31
- expect(fields.length).to eq(1)
32
- expect(fields.first.values).to eq(['resource type'])
33
- end
34
- end
@@ -1,20 +0,0 @@
1
- require 'spec_helper'
2
-
3
- def mods_display_sub_title(mods_record)
4
- ModsDisplay::SubTitle.new(mods_record, ModsDisplay::Configuration::Base.new, double('controller'))
5
- end
6
-
7
- describe ModsDisplay::SubTitle do
8
- before(:all) do
9
- @title = Stanford::Mods::Record.new.from_str(
10
- '<mods><titleInfo><title>Main Title</title></titleInfo><titleInfo><title>Sub Title</title></titleInfo></mods>',
11
- false
12
- ).title_info
13
- end
14
- it 'omit the main title and only return sub titles' do
15
- fields = mods_display_sub_title(@title).fields
16
- expect(fields.length).to eq(1)
17
- expect(fields.first.label).to eq('Title:')
18
- expect(fields.first.values).to eq(['Sub Title'])
19
- end
20
- end
@@ -1,113 +0,0 @@
1
- require 'spec_helper'
2
- require 'fixtures/subjects_fixtures'
3
- include SubjectsFixtures
4
-
5
- def mods_display_subject(mods_record)
6
- config = ModsDisplay::Configuration::Subject.new do
7
- link :link_method, '%value%'
8
- end
9
- ModsDisplay::Subject.new(mods_record, config, TestController.new)
10
- end
11
-
12
- def mods_display_hierarchical_subject(mods_record)
13
- config = ModsDisplay::Configuration::Subject.new do
14
- hierarchical_link true
15
- link :link_method, '%value%'
16
- end
17
- ModsDisplay::Subject.new(mods_record, config, TestController.new)
18
- end
19
-
20
- describe ModsDisplay::Subject do
21
- before(:all) do
22
- @subject = Stanford::Mods::Record.new.from_str(subjects, false).subject
23
- @blank_subject = Stanford::Mods::Record.new.from_str(blank_subject, false).subject
24
- @emdash_subject = Stanford::Mods::Record.new.from_str(emdash_subjects, false).subject
25
- @geo_subject = Stanford::Mods::Record.new.from_str(hierarchical_geo_subjects, false).subject
26
- @name_subject = Stanford::Mods::Record.new.from_str(name_subjects, false).subject
27
- @blank_name_subject = Stanford::Mods::Record.new.from_str(blank_name_subject, false).subject
28
- @complex_subject = Stanford::Mods::Record.new.from_str(complex_subjects, false).subject
29
- @display_label = Stanford::Mods::Record.new.from_str(display_label_subjects, false).subject
30
- end
31
- describe 'fields' do
32
- it 'should split individual child elments of subject into separate parts' do
33
- fields = mods_display_subject(@subject).fields
34
- expect(fields.length).to eq(1)
35
- expect(fields.first.values).to eq([['Jazz', 'Japan', 'History and criticism']])
36
- end
37
- it 'should split horizontalized subjects split with an emdash into separate parts' do
38
- fields = mods_display_subject(@emdash_subject).fields
39
- expect(fields.length).to eq(1)
40
- expect(fields.first.values).to eq([['Jazz', 'Japan', 'History and criticism']])
41
- end
42
- it 'should handle hierarchicalGeogaphic subjects properly' do
43
- fields = mods_display_subject(@geo_subject).fields
44
- expect(fields.length).to eq(1)
45
- expect(fields.first.values).to eq([['United States', 'California', 'Stanford']])
46
- end
47
- it 'should handle display labels properly' do
48
- fields = mods_display_subject(@display_label).fields
49
- expect(fields.length).to eq(3)
50
- expect(fields.first.label).to eq('Subject:')
51
- expect(fields.first.values).to eq([['A Subject', 'Another Subject'], ['B Subject', 'Another B Subject']])
52
- expect(fields[1].label).to eq('Subject Heading:')
53
- expect(fields[1].values).to eq([['Jazz', 'Japan', 'History and criticism']])
54
- expect(fields.last.label).to eq('Subject:')
55
- expect(fields.last.values).to eq([['Bay Area', 'Stanford']])
56
- end
57
- it 'should handle blank subjects properly' do
58
- expect(mods_display_subject(@blank_subject).fields).to eq([])
59
- end
60
- it 'should handle blank name subjects properly' do
61
- expect(mods_display_subject(@blank_name_subject).fields).to eq([])
62
- end
63
- end
64
-
65
- describe 'name subjects' do
66
- it 'should handle name subjects properly' do
67
- fields = mods_display_subject(@name_subject).fields
68
- expect(fields.length).to eq(1)
69
- expect(fields.first.values.first.first).to be_a(ModsDisplay::Name::Person)
70
- expect(fields.first.values.first.first.name).to eq('John Doe')
71
- end
72
- it 'should link the name (and not the role) correctly' do
73
- html = mods_display_subject(@name_subject).to_html
74
- expect(html).to match(%r{<a href='.*\?John Doe'>John Doe</a>})
75
- expect(html).to match(%r{<a href='.*\?Anonymous People'>Anonymous People</a>})
76
- end
77
- it 'should linke the name (and not the role) correctly when linking hierarchicaly' do
78
- html = mods_display_hierarchical_subject(@name_subject).to_html
79
- expect(html).to match(%r{<a href='.*\?John Doe'>John Doe</a>})
80
- expect(html).to match(%r{<a href='.*\?John Doe Anonymous People'>Anonymous People</a>})
81
- end
82
- end
83
-
84
- describe 'to_html' do
85
- it 'should link the values when requested' do
86
- html = mods_display_subject(@subject).to_html
87
- expect(html).to match(%r{<a href='http://library.stanford.edu\?Jazz'>Jazz</a>})
88
- expect(html).to match(%r{<a href='http://library.stanford.edu\?Japan'>Japan</a>})
89
- expect(html).to match(%r{<a href='http://library.stanford.edu\?History and criticism'>History and criticism</a>})
90
- end
91
- it 'does something' do
92
- html = mods_display_hierarchical_subject(@subject).to_html
93
- expect(html).to match(%r{<a href='http://library.stanford.edu\?Jazz'>Jazz</a>})
94
- expect(html).to match(%r{<a href='http://library.stanford.edu\?Jazz Japan'>Japan</a>})
95
- expect(html).to match(
96
- %r{<a href='http://library.stanford.edu\?Jazz Japan History and criticism'>History and criticism</a>}
97
- )
98
- end
99
- it 'should collapse fields into the same label' do
100
- html = mods_display_subject(@complex_subject).to_html
101
- expect(html.scan(%r{<dt title='Subject'>Subject:</dt>}).length).to eq(1)
102
- expect(html.scan(/<dd>/).length).to eq(1)
103
- expect(html.scan(%r{<br/>}).length).to eq(1)
104
- expect(html.scan(/ &gt; /).length).to eq(3)
105
- end
106
- it 'should handle complex display labels' do
107
- html = mods_display_subject(@display_label).to_html
108
- expect(html.scan(%r{<dt title='Subject'>Subject:</dt>}).length).to eq 2
109
- expect(html.scan(%r{<dt title='Subject Heading'>Subject Heading:</dt>}).length).to eq 1
110
- expect(html.scan(/<dd>/).length).to eq(3)
111
- end
112
- end
113
- end
@@ -1,82 +0,0 @@
1
- require 'spec_helper'
2
-
3
- def mods_display_title(mods_record)
4
- ModsDisplay::Title.new(mods_record, ModsDisplay::Configuration::Base.new, double('controller'))
5
- end
6
-
7
- describe ModsDisplay::Title do
8
- include TitleFixtures
9
- before(:all) do
10
- @title = Stanford::Mods::Record.new.from_str(simple_title_fixture, false).title_info
11
- @title_parts = Stanford::Mods::Record.new.from_str(title_parts_fixture, false).title_info
12
- @reverse_title_parts = Stanford::Mods::Record.new.from_str(reverse_title_parts_fixture, false).title_info
13
- @display_label = Stanford::Mods::Record.new.from_str(display_label_fixture, false).title_info
14
- @display_form = Stanford::Mods::Record.new.from_str(display_form_fixture, false).title_info
15
- @multi_label = Stanford::Mods::Record.new.from_str(multi_label_fixture, false).title_info
16
- @alt_title = Stanford::Mods::Record.new.from_str(alt_title_fixture, false).title_info
17
- @title_punctuation = Stanford::Mods::Record.new.from_str(title_puncutation_fixture, false).title_info
18
- @ordered_title_fixture = Stanford::Mods::Record.new.from_str(ordered_title_fixture, false).title_info
19
- end
20
- describe 'labels' do
21
- it 'should return a default label of Title if nothing else is available' do
22
- expect(mods_display_title(@title).fields.first.label).to eq('Title:')
23
- end
24
- it 'should return an appropriate label from the type attribute' do
25
- expect(mods_display_title(@alt_title).fields.first.label).to eq('Alternative title:')
26
- end
27
- it 'should return the label held in the displayLabel attribute of the titleInfo element when available' do
28
- expect(mods_display_title(@display_label).fields.first.label).to eq('MyTitle:')
29
- end
30
- it 'should collapse adjacent identical labels' do
31
- fields = mods_display_title(@multi_label).fields
32
- expect(fields.length).to eq(4)
33
- expect(fields[0].label).to eq('Title:')
34
- expect(fields[1].label).to eq('Alternative title:')
35
- expect(fields[2].label).to eq('Uniform title:')
36
- expect(fields[3].label).to eq('Alternative title:')
37
- expect(fields[3].values).to eq(['Another Alt Title', 'Yet Another Alt Title'])
38
- end
39
- end
40
- describe 'fields' do
41
- it 'should return an array of label/value objects' do
42
- values = mods_display_title(@display_label).fields
43
- expect(values.length).to eq(1)
44
- expect(values.first).to be_a ModsDisplay::Values
45
- expect(values.first.label).to eq('MyTitle:')
46
- expect(values.first.values).to eq(['Title'])
47
- end
48
- end
49
- describe 'text' do
50
- it 'should construct all the elements in titleInfo' do
51
- expect(mods_display_title(@title_parts).fields.first.values).to include 'The Title : For. Something. Part 62'
52
- end
53
-
54
- it 'should use the correct delimiter in the case that a partNumber comes before a partName' do
55
- expect(mods_display_title(@reverse_title_parts).fields.first.values).to include(
56
- 'The Title : For. Part 62, Something'
57
- )
58
- end
59
-
60
- it 'should use the displayForm when available' do
61
- expect(mods_display_title(@display_form).fields.first.values).to include 'The Title of This Item'
62
- end
63
-
64
- it 'should return the basic text held in a sub element of titleInfo' do
65
- expect(mods_display_title(@title).fields.first.values).to include 'Title'
66
- end
67
-
68
- it 'should not duplicate delimiter punctuation' do
69
- values = mods_display_title(@title_punctuation).fields.first.values
70
- expect(values.length).to eq 1
71
- expect(values.first).not_to include '..'
72
- expect(values.first).to eq 'A title that ends in punctuation. 2015'
73
- end
74
-
75
- it 'combines the title parts in the order from the record' do
76
- values = mods_display_title(@ordered_title_fixture).fields.first.values
77
- expect(values.length).to eq 1
78
-
79
- expect(values.first).to eq 'The medium term expenditure framework (MTEF) for ... and the annual estimates for ... 016, Ministry of Tourism : expenditure to be met out of moneys granted and drawn from the consolidated fund, central government budget'
80
- end
81
- end
82
- end
@@ -1,58 +0,0 @@
1
- module AccessConditionFixtures
2
- def simple_access_condition_fixture
3
- <<-XML
4
- <mods>
5
- <accessCondition>Access Condition Note</accessCondition>
6
- </mods>
7
- XML
8
- end
9
-
10
- def restricted_access_fixture
11
- <<-XML
12
- <mods>
13
- <accessCondition type='restrictionOnAccess'>Restrict Access Note1</accessCondition>
14
- <accessCondition type='restriction on access'>Restrict Access Note2</accessCondition>
15
- </mods>
16
- XML
17
- end
18
-
19
- def copyright_access_fixture
20
- <<-XML
21
- <mods>
22
- <accessCondition type='copyright'>This is a (c) copyright Note. Single instances of (c) should also be replaced in these notes.</accessCondition>
23
- </mods>
24
- XML
25
- end
26
-
27
- def cc_license_fixture
28
- <<-XML
29
- <mods>
30
- <accessCondition type='license'>CC by-sa: This work is licensed under a Creative Commons Attribution-Noncommercial 3.0 Unported License</accessCondition>
31
- </mods>
32
- XML
33
- end
34
-
35
- def odc_license_fixture
36
- <<-XML
37
- <mods>
38
- <accessCondition type='license'>ODC pddl: This work is licensed under a Open Data Commons Public Domain Dedication and License (PDDL)</accessCondition>
39
- </mods>
40
- XML
41
- end
42
-
43
- def no_license_fixture
44
- <<-XML
45
- <mods>
46
- <accessCondition type='license'>Unknown something: This work is licensed under an Unknown License and will not be linked</accessCondition>
47
- </mods>
48
- XML
49
- end
50
-
51
- def garbage_license_fixture
52
- <<-XML
53
- <mods>
54
- <accessCondition type='license'>Unknown garbage that does not look like a license</accessCondition>
55
- </mods>
56
- XML
57
- end
58
- end
@@ -1,52 +0,0 @@
1
- module CartographicsFixtures
2
- def full_cartographic
3
- <<-MODS
4
- <mods>
5
- <subject>
6
- <cartographics>
7
- <scale>The scale</scale>
8
- <coordinates>the coordinates</coordinates>
9
- <projection>the projection</projection>
10
- </cartographics>
11
- </subject>
12
- </mods>
13
- MODS
14
- end
15
-
16
- def no_scale_cartographic
17
- <<-MODS
18
- <mods>
19
- <subject>
20
- <cartographics>
21
- <coordinates>the coordinates</coordinates>
22
- <projection>the projection</projection>
23
- </cartographics>
24
- </subject>
25
- </mods>
26
- MODS
27
- end
28
-
29
- def coordinates_only
30
- <<-MODS
31
- <mods>
32
- <subject>
33
- <cartographics>
34
- <coordinates>the coordinates</coordinates>
35
- </cartographics>
36
- </subject>
37
- </mods>
38
- MODS
39
- end
40
-
41
- def scale_only
42
- <<-MODS
43
- <mods>
44
- <subject>
45
- <cartographics>
46
- <scale>The scale</scale>
47
- </cartographics>
48
- </subject>
49
- </mods>
50
- MODS
51
- end
52
- end