common_repository_model 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. data/common_repository_model.gemspec +3 -1
  2. data/config/README.md +5 -0
  3. data/config/solrconfig.xml +1858 -0
  4. data/lib/common_repository_model/area.rb +2 -1
  5. data/lib/common_repository_model/area_serializer.rb +4 -0
  6. data/lib/common_repository_model/collection.rb +10 -0
  7. data/lib/common_repository_model/collection_serializer.rb +4 -0
  8. data/lib/common_repository_model/data.rb +2 -2
  9. data/lib/common_repository_model/data_serializer.rb +5 -0
  10. data/lib/common_repository_model/persistence_base.rb +16 -0
  11. data/lib/common_repository_model/persistence_base_serializer.rb +6 -0
  12. data/lib/common_repository_model/railtie.rb +6 -1
  13. data/lib/common_repository_model/test_support.rb +19 -0
  14. data/lib/common_repository_model/version.rb +1 -1
  15. data/lib/generators/common_repository_model/collection/USAGE +7 -4
  16. data/lib/generators/common_repository_model/collection/collection_generator.rb +24 -1
  17. data/lib/generators/common_repository_model/collection/templates/collection_factory.rb.erb +13 -0
  18. data/lib/generators/common_repository_model/collection/templates/collection_serializer.rb.erb +9 -0
  19. data/lib/generators/common_repository_model/collection/templates/collection_serializer_spec.rb.erb +12 -0
  20. data/lib/generators/common_repository_model/collection/templates/collection_spec.rb.erb +6 -1
  21. data/spec/common_respository_model/area_serializer_spec.rb +13 -0
  22. data/spec/common_respository_model/area_spec.rb +2 -2
  23. data/spec/common_respository_model/collection_serializer_spec.rb +15 -0
  24. data/spec/common_respository_model/collection_spec.rb +17 -2
  25. data/spec/common_respository_model/data_serializer_spec.rb +15 -0
  26. data/spec/common_respository_model/data_spec.rb +7 -7
  27. data/spec/common_respository_model/integration_spec.rb +1 -1
  28. data/spec/common_respository_model/persistence_base_serializer_spec.rb +12 -0
  29. data/spec/common_respository_model/test_support_spec.rb +12 -0
  30. data/spec/factories/common_repository_model/area_factory.rb +8 -0
  31. data/spec/factories/common_repository_model/collection_factory.rb +7 -0
  32. data/spec/factories/common_repository_model/data_factory.rb +10 -0
  33. data/spec/spec_helper.rb +2 -8
  34. metadata +63 -7
  35. data/spec/factories/common_repository_model_factories.rb +0 -17
@@ -0,0 +1,7 @@
1
+ require_relative '../../../lib/common_repository_model/data'
2
+
3
+ FactoryGirl.define do
4
+ factory :common_repository_model_collection, class: CommonRepositoryModel::Collection do
5
+ area { CommonRepositoryModel::Area.all.first }
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ require_relative '../../../lib/common_repository_model/data'
2
+
3
+ FactoryGirl.define do
4
+ factory :common_repository_model_data, class: CommonRepositoryModel::Data do
5
+ collection { FactoryGirl.build(:common_repository_model_collection) }
6
+ sequence(:slot_name) { |n| "Slot Name #{n}" }
7
+ sequence(:md5_checksum) { |n| "#{n}abc"}
8
+ end
9
+ end
10
+
data/spec/spec_helper.rb CHANGED
@@ -9,15 +9,9 @@ ActiveFedora.init(
9
9
  environment: :test
10
10
  )
11
11
 
12
-
12
+ require 'common_repository_model/test_support'
13
13
  class MiniTest::Unit::TestCase
14
-
15
- def with_persisted_area
16
- area = FactoryGirl.create(:area)
17
- yield(area)
18
- ensure
19
- area.delete
20
- end
14
+ include CommonRepositoryModel::TestSupport
21
15
 
22
16
  def assert_rels_ext(subject, predicate, objects = [])
23
17
  assert_equal objects.count, subject.relationships(predicate).count
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: common_repository_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-20 00:00:00.000000000 Z
12
+ date: 2012-11-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -60,7 +60,7 @@ dependencies:
60
60
  - !ruby/object:Gem::Version
61
61
  version: '3.0'
62
62
  - !ruby/object:Gem::Dependency
63
- name: minitest
63
+ name: morphine
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
@@ -76,7 +76,7 @@ dependencies:
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  - !ruby/object:Gem::Dependency
79
- name: minitest-matchers
79
+ name: active_model_serializers
80
80
  requirement: !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements:
@@ -92,7 +92,23 @@ dependencies:
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  - !ruby/object:Gem::Dependency
95
- name: active-fedora
95
+ name: minitest
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: minitest-matchers
96
112
  requirement: !ruby/object:Gem::Requirement
97
113
  none: false
98
114
  requirements:
@@ -107,6 +123,22 @@ dependencies:
107
123
  - - ! '>='
108
124
  - !ruby/object:Gem::Version
109
125
  version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: active-fedora
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - '='
132
+ - !ruby/object:Gem::Version
133
+ version: 5.0.0.rc3
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - '='
140
+ - !ruby/object:Gem::Version
141
+ version: 5.0.0.rc3
110
142
  - !ruby/object:Gem::Dependency
111
143
  name: factory_girl
112
144
  requirement: !ruby/object:Gem::Requirement
@@ -137,29 +169,46 @@ files:
137
169
  - README.md
138
170
  - Rakefile
139
171
  - common_repository_model.gemspec
172
+ - config/README.md
173
+ - config/solrconfig.xml
140
174
  - lib/common_repository_model.rb
141
175
  - lib/common_repository_model/area.rb
176
+ - lib/common_repository_model/area_serializer.rb
142
177
  - lib/common_repository_model/collection.rb
178
+ - lib/common_repository_model/collection_serializer.rb
143
179
  - lib/common_repository_model/data.rb
180
+ - lib/common_repository_model/data_serializer.rb
144
181
  - lib/common_repository_model/file_datastream.rb
145
182
  - lib/common_repository_model/persistence_base.rb
183
+ - lib/common_repository_model/persistence_base_serializer.rb
146
184
  - lib/common_repository_model/railtie.rb
185
+ - lib/common_repository_model/test_support.rb
147
186
  - lib/common_repository_model/version.rb
148
187
  - lib/generators/common_repository_model/collection/USAGE
149
188
  - lib/generators/common_repository_model/collection/collection_generator.rb
150
189
  - lib/generators/common_repository_model/collection/templates/collection.rb.erb
190
+ - lib/generators/common_repository_model/collection/templates/collection_factory.rb.erb
191
+ - lib/generators/common_repository_model/collection/templates/collection_serializer.rb.erb
192
+ - lib/generators/common_repository_model/collection/templates/collection_serializer_spec.rb.erb
151
193
  - lib/generators/common_repository_model/collection/templates/collection_spec.rb.erb
152
194
  - lib/tasks/common_repository_model.tasks
195
+ - spec/common_respository_model/area_serializer_spec.rb
153
196
  - spec/common_respository_model/area_spec.rb
197
+ - spec/common_respository_model/collection_serializer_spec.rb
154
198
  - spec/common_respository_model/collection_spec.rb
199
+ - spec/common_respository_model/data_serializer_spec.rb
155
200
  - spec/common_respository_model/data_spec.rb
156
201
  - spec/common_respository_model/file_datastream_spec.rb
157
202
  - spec/common_respository_model/integration_spec.rb
203
+ - spec/common_respository_model/persistence_base_serializer_spec.rb
158
204
  - spec/common_respository_model/persistence_base_spec.rb
205
+ - spec/common_respository_model/test_support_spec.rb
159
206
  - spec/config/fedora.yml
160
207
  - spec/config/predicate_mappings.yml
161
208
  - spec/config/solr.yml
162
- - spec/factories/common_repository_model_factories.rb
209
+ - spec/factories/common_repository_model/area_factory.rb
210
+ - spec/factories/common_repository_model/collection_factory.rb
211
+ - spec/factories/common_repository_model/data_factory.rb
163
212
  - spec/spec_helper.rb
164
213
  homepage: https://github.com/ndlib/common_repository_model
165
214
  licenses: []
@@ -186,14 +235,21 @@ signing_key:
186
235
  specification_version: 3
187
236
  summary: Notre Dame's Common Fedora Repository Model
188
237
  test_files:
238
+ - spec/common_respository_model/area_serializer_spec.rb
189
239
  - spec/common_respository_model/area_spec.rb
240
+ - spec/common_respository_model/collection_serializer_spec.rb
190
241
  - spec/common_respository_model/collection_spec.rb
242
+ - spec/common_respository_model/data_serializer_spec.rb
191
243
  - spec/common_respository_model/data_spec.rb
192
244
  - spec/common_respository_model/file_datastream_spec.rb
193
245
  - spec/common_respository_model/integration_spec.rb
246
+ - spec/common_respository_model/persistence_base_serializer_spec.rb
194
247
  - spec/common_respository_model/persistence_base_spec.rb
248
+ - spec/common_respository_model/test_support_spec.rb
195
249
  - spec/config/fedora.yml
196
250
  - spec/config/predicate_mappings.yml
197
251
  - spec/config/solr.yml
198
- - spec/factories/common_repository_model_factories.rb
252
+ - spec/factories/common_repository_model/area_factory.rb
253
+ - spec/factories/common_repository_model/collection_factory.rb
254
+ - spec/factories/common_repository_model/data_factory.rb
199
255
  - spec/spec_helper.rb
@@ -1,17 +0,0 @@
1
- require 'common_repository_model/area'
2
- require 'common_repository_model/collection'
3
- require 'common_repository_model/data'
4
-
5
- FactoryGirl.define do
6
- factory :area, class: CommonRepositoryModel::Area do
7
- sequence(:name) { |n| "Area #{n}" }
8
- to_create { |instance| instance.send(:save!) }
9
- end
10
- factory :collection, class: CommonRepositoryModel::Collection do
11
- area { CommonRepositoryModel::Area.all.first }
12
- end
13
- factory :data, class: CommonRepositoryModel::Data do
14
- sequence(:slot_name) { |n| "Slot Name #{n}" }
15
- sequence(:md5_checksum) { |n| "#{n}abc"}
16
- end
17
- end