active-fedora 13.1.2 → 13.2.4

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 (148) hide show
  1. checksums.yaml +4 -4
  2. data/.github_changelog_generator +2 -0
  3. data/CHANGELOG.md +3362 -0
  4. data/CONTRIBUTING.md +23 -1
  5. data/README.md +4 -0
  6. data/active-fedora.gemspec +13 -13
  7. data/config/fedora.yml +5 -5
  8. data/lib/active_fedora/core.rb +3 -0
  9. data/lib/active_fedora/indexing/descendant_fetcher.rb +7 -11
  10. data/lib/active_fedora/ldp_resource.rb +6 -0
  11. data/lib/active_fedora/orders/ordered_list.rb +2 -2
  12. data/lib/active_fedora/version.rb +3 -1
  13. data/lib/active_fedora/with_metadata/default_schema.rb +12 -1
  14. data/lib/generators/active_fedora/config/fedora/templates/fedora.yml +6 -6
  15. data/lib/generators/active_fedora/config/solr/templates/solr/conf/schema.xml +3 -3
  16. metadata +98 -214
  17. data/spec/config_helper.rb +0 -17
  18. data/spec/fixtures/dino.jpg +0 -0
  19. data/spec/fixtures/dino_jpg_no_file_ext +0 -0
  20. data/spec/fixtures/minivan.jpg +0 -0
  21. data/spec/fixtures/rails_root/config/fake_fedora.yml +0 -7
  22. data/spec/fixtures/rails_root/config/fedora.yml +0 -12
  23. data/spec/fixtures/rails_root/config/solr.yml +0 -15
  24. data/spec/fixtures/rails_root/config/solr_mappings.yml +0 -16
  25. data/spec/fixtures/rails_root/config/solr_mappings_af_0.1.yml +0 -9
  26. data/spec/fixtures/rails_root/config/solr_mappings_bl_2.4.yml +0 -17
  27. data/spec/integration/associations/rdf_spec.rb +0 -61
  28. data/spec/integration/associations_spec.rb +0 -680
  29. data/spec/integration/attached_files_spec.rb +0 -146
  30. data/spec/integration/attributes_spec.rb +0 -73
  31. data/spec/integration/autosave_association_spec.rb +0 -24
  32. data/spec/integration/base_spec.rb +0 -184
  33. data/spec/integration/basic_contains_association_spec.rb +0 -121
  34. data/spec/integration/belongs_to_association_spec.rb +0 -260
  35. data/spec/integration/caching_spec.rb +0 -59
  36. data/spec/integration/clean_connection_spec.rb +0 -21
  37. data/spec/integration/collection_association_spec.rb +0 -166
  38. data/spec/integration/date_time_properties_spec.rb +0 -41
  39. data/spec/integration/delete_all_spec.rb +0 -64
  40. data/spec/integration/direct_container_spec.rb +0 -250
  41. data/spec/integration/directly_contains_one_association_spec.rb +0 -96
  42. data/spec/integration/eradicate_spec.rb +0 -52
  43. data/spec/integration/fedora_solr_sync_spec.rb +0 -30
  44. data/spec/integration/file_fixity_spec.rb +0 -36
  45. data/spec/integration/file_spec.rb +0 -221
  46. data/spec/integration/generators/fedora_generator_spec.rb +0 -26
  47. data/spec/integration/generators/solr_generator_spec.rb +0 -23
  48. data/spec/integration/gone_spec.rb +0 -41
  49. data/spec/integration/has_and_belongs_to_many_associations_spec.rb +0 -414
  50. data/spec/integration/has_many_associations_spec.rb +0 -436
  51. data/spec/integration/has_subresource_spec.rb +0 -34
  52. data/spec/integration/indexing/descendant_fetcher_spec.rb +0 -64
  53. data/spec/integration/indexing_spec.rb +0 -110
  54. data/spec/integration/indirect_container_spec.rb +0 -290
  55. data/spec/integration/json_serialization_spec.rb +0 -32
  56. data/spec/integration/marshal_spec.rb +0 -39
  57. data/spec/integration/nested_attribute_spec.rb +0 -177
  58. data/spec/integration/nested_hash_resources_spec.rb +0 -43
  59. data/spec/integration/persistence_spec.rb +0 -37
  60. data/spec/integration/query_result_builder_spec.rb +0 -37
  61. data/spec/integration/rdf_nested_attributes_spec.rb +0 -85
  62. data/spec/integration/relation_delegation_spec.rb +0 -52
  63. data/spec/integration/relation_spec.rb +0 -117
  64. data/spec/integration/scoped_query_spec.rb +0 -134
  65. data/spec/integration/scoping_spec.rb +0 -48
  66. data/spec/integration/solr_hit_spec.rb +0 -32
  67. data/spec/integration/versionable_spec.rb +0 -256
  68. data/spec/integration/with_metadata_spec.rb +0 -111
  69. data/spec/lib/active_fedora/null_logger_spec.rb +0 -10
  70. data/spec/rcov.opts +0 -2
  71. data/spec/spec.opts +0 -5
  72. data/spec/spec_helper.rb +0 -106
  73. data/spec/support/an_active_model.rb +0 -29
  74. data/spec/unit/active_fedora/indexing/inserter_spec.rb +0 -35
  75. data/spec/unit/active_fedora_spec.rb +0 -118
  76. data/spec/unit/aggregation/list_source_spec.rb +0 -134
  77. data/spec/unit/aggregation/ordered_reader_spec.rb +0 -43
  78. data/spec/unit/association_hash_spec.rb +0 -64
  79. data/spec/unit/attached_files_spec.rb +0 -218
  80. data/spec/unit/attributes_spec.rb +0 -146
  81. data/spec/unit/base_active_model_spec.rb +0 -28
  82. data/spec/unit/base_cma_spec.rb +0 -15
  83. data/spec/unit/base_extra_spec.rb +0 -33
  84. data/spec/unit/base_spec.rb +0 -328
  85. data/spec/unit/builder/has_and_belongs_to_many_spec.rb +0 -8
  86. data/spec/unit/callback_spec.rb +0 -65
  87. data/spec/unit/change_set_spec.rb +0 -60
  88. data/spec/unit/checksum_spec.rb +0 -25
  89. data/spec/unit/code_configurator_spec.rb +0 -41
  90. data/spec/unit/collection_proxy_spec.rb +0 -25
  91. data/spec/unit/config_spec.rb +0 -18
  92. data/spec/unit/core/fedora_id_translator_spec.rb +0 -29
  93. data/spec/unit/core/fedora_uri_translator_spec.rb +0 -19
  94. data/spec/unit/core/logger_spec.rb +0 -18
  95. data/spec/unit/core_spec.rb +0 -242
  96. data/spec/unit/default_model_mapper_spec.rb +0 -39
  97. data/spec/unit/fedora_spec.rb +0 -31
  98. data/spec/unit/file/streaming_spec.rb +0 -33
  99. data/spec/unit/file_configurator_spec.rb +0 -295
  100. data/spec/unit/file_io_spec.rb +0 -137
  101. data/spec/unit/file_path_builder_spec.rb +0 -18
  102. data/spec/unit/file_spec.rb +0 -489
  103. data/spec/unit/files_hash_spec.rb +0 -52
  104. data/spec/unit/filter_spec.rb +0 -133
  105. data/spec/unit/finder_methods_spec.rb +0 -154
  106. data/spec/unit/fixity_service_spec.rb +0 -128
  107. data/spec/unit/forbidden_attributes_protection_spec.rb +0 -50
  108. data/spec/unit/has_and_belongs_to_many_association_spec.rb +0 -125
  109. data/spec/unit/has_many_association_spec.rb +0 -131
  110. data/spec/unit/indexers/global_indexer_spec.rb +0 -41
  111. data/spec/unit/indexing/map/index_object_spec.rb +0 -25
  112. data/spec/unit/indexing/map_spec.rb +0 -27
  113. data/spec/unit/indexing_service_spec.rb +0 -28
  114. data/spec/unit/indexing_spec.rb +0 -86
  115. data/spec/unit/inheritance_spec.rb +0 -60
  116. data/spec/unit/ldp_resource_spec.rb +0 -15
  117. data/spec/unit/loadable_from_json_spec.rb +0 -40
  118. data/spec/unit/logger_spec.rb +0 -19
  119. data/spec/unit/model_classifier_spec.rb +0 -49
  120. data/spec/unit/ordered_spec.rb +0 -367
  121. data/spec/unit/orders/list_node_spec.rb +0 -151
  122. data/spec/unit/orders/ordered_list_spec.rb +0 -335
  123. data/spec/unit/orders/reflection_spec.rb +0 -22
  124. data/spec/unit/pathing_spec.rb +0 -35
  125. data/spec/unit/persistence_spec.rb +0 -115
  126. data/spec/unit/property_predicate_spec.rb +0 -35
  127. data/spec/unit/property_spec.rb +0 -25
  128. data/spec/unit/query_result_builder_spec.rb +0 -31
  129. data/spec/unit/query_spec.rb +0 -307
  130. data/spec/unit/querying_spec.rb +0 -24
  131. data/spec/unit/rdf/indexing_service_spec.rb +0 -114
  132. data/spec/unit/rdf_vocab_spec.rb +0 -30
  133. data/spec/unit/readonly_spec.rb +0 -24
  134. data/spec/unit/reflection_spec.rb +0 -42
  135. data/spec/unit/rspec_matchers/belong_to_associated_active_fedora_object_matcher_spec.rb +0 -37
  136. data/spec/unit/rspec_matchers/have_many_associated_active_fedora_objects_matcher_spec.rb +0 -38
  137. data/spec/unit/rspec_matchers/have_predicate_matcher_spec.rb +0 -38
  138. data/spec/unit/schema_indexing_strategy_spec.rb +0 -68
  139. data/spec/unit/scoping_spec.rb +0 -67
  140. data/spec/unit/serializers_spec.rb +0 -19
  141. data/spec/unit/solr_config_options_spec.rb +0 -57
  142. data/spec/unit/solr_hit_spec.rb +0 -57
  143. data/spec/unit/solr_query_builder_spec.rb +0 -18
  144. data/spec/unit/solr_service_spec.rb +0 -165
  145. data/spec/unit/sparql_insert_spec.rb +0 -31
  146. data/spec/unit/validations_spec.rb +0 -92
  147. data/spec/unit/with_metadata/default_metadata_class_factory_spec.rb +0 -29
  148. data/spec/unit/with_metadata/metadata_node_spec.rb +0 -69
@@ -1,29 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ActiveFedora::WithMetadata::DefaultMetadataClassFactory do
4
- let(:parent) { class_double(ActiveFedora::File) }
5
- let(:object) { described_class.new }
6
-
7
- describe "default class attributes" do
8
- its(:metadata_base_class) { is_expected.to eq(ActiveFedora::WithMetadata::MetadataNode) }
9
- its(:file_metadata_schemas) { is_expected.to eq([ActiveFedora::WithMetadata::DefaultSchema]) }
10
- its(:file_metadata_strategy) { is_expected.to eq(ActiveFedora::WithMetadata::DefaultStrategy) }
11
- end
12
-
13
- describe "::build" do
14
- it "sets MetadataNode to the default schema using the default strategy" do
15
- expect(parent).to receive(:const_set)
16
- expect(parent).to receive(:delegate).with(:label, :label=, :label_changed?, to: :metadata_node)
17
- expect(parent).to receive(:delegate).with(:file_name, :file_name=, :file_name_changed?, to: :metadata_node)
18
- expect(parent).to receive(:delegate).with(:file_size, :file_size=, :file_size_changed?, to: :metadata_node)
19
- expect(parent).to receive(:delegate).with(:date_created, :date_created=, :date_created_changed?, to: :metadata_node)
20
- expect(parent).to receive(:delegate).with(:date_modified,
21
- :date_modified=,
22
- :date_modified_changed?,
23
- to: :metadata_node)
24
- expect(parent).to receive(:delegate).with(:byte_order, :byte_order=, :byte_order_changed?, to: :metadata_node)
25
- expect(parent).to receive(:delegate).with(:file_hash, :file_hash=, :file_hash_changed?, to: :metadata_node)
26
- object.class.build(parent)
27
- end
28
- end
29
- end
@@ -1,69 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ActiveFedora::WithMetadata::MetadataNode do
4
- let(:generated_schema) { Class.new(described_class) }
5
-
6
- let(:file) { ActiveFedora::File.new }
7
- let(:node) { generated_schema.new(file) }
8
- let(:book) { RDF::URI.new('http://example.com/ns/Book') }
9
-
10
- describe "#changed_attributes" do
11
- subject { node.changed_attributes }
12
-
13
- context "when type is not set" do
14
- it { is_expected.to eq({}) }
15
- end
16
-
17
- context "when type is set" do
18
- before do
19
- generated_schema.configure type: book
20
- end
21
-
22
- it { is_expected.to match('type' => be_truthy) }
23
- end
24
- end
25
-
26
- describe "changes_for_update" do
27
- subject { changes_for_update }
28
- let(:changes_for_update) { node.send(:changes_for_update) }
29
-
30
- context "when type is not set" do
31
- it { is_expected.to eq({}) }
32
- end
33
-
34
- context "when type is set" do
35
- before do
36
- generated_schema.configure type: book
37
- end
38
-
39
- it "is expected to have the rdf type statement" do
40
- expect(changes_for_update[::RDF.type]).to be_present
41
- end
42
- end
43
- end
44
-
45
- describe ".new" do
46
- it "does not make a request when parent file is new" do
47
- expect(file.ldp_source.client).not_to receive(:head)
48
- described_class.new(file)
49
- end
50
- end
51
-
52
- describe ".save" do
53
- it "resets metadata_uri" do
54
- expect(node.metadata_uri).to eq ::RDF::URI.new(nil)
55
- file.content = "test"
56
- file.save!
57
- node.save
58
- expect(node.metadata_uri).not_to eq ::RDF::URI.new(nil)
59
- end
60
-
61
- it "resets ldp_source" do
62
- expect(node.ldp_source.new?).to be_truthy
63
- file.content = "test"
64
- file.save!
65
- node.save
66
- expect(node.ldp_source.new?).to be_falsey
67
- end
68
- end
69
- end