active-fedora 8.2.1 → 8.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/active-fedora.gemspec +1 -2
  3. data/lib/active_fedora/datastream_collections.rb +4 -8
  4. data/lib/active_fedora/datastreams.rb +7 -9
  5. data/lib/active_fedora/version.rb +1 -1
  6. data/spec/config_helper.rb +3 -3
  7. data/spec/integration/associations_spec.rb +76 -76
  8. data/spec/integration/auditable_spec.rb +7 -7
  9. data/spec/integration/autosave_association_spec.rb +3 -3
  10. data/spec/integration/base_spec.rb +51 -51
  11. data/spec/integration/belongs_to_association_spec.rb +27 -27
  12. data/spec/integration/bug_spec.rb +1 -1
  13. data/spec/integration/collection_association_spec.rb +2 -2
  14. data/spec/integration/complex_rdf_datastream_spec.rb +32 -32
  15. data/spec/integration/datastream_collections_spec.rb +42 -42
  16. data/spec/integration/datastream_spec.rb +19 -19
  17. data/spec/integration/datastreams_spec.rb +25 -25
  18. data/spec/integration/delete_all_spec.rb +5 -5
  19. data/spec/integration/fedora_solr_sync_spec.rb +1 -1
  20. data/spec/integration/full_featured_model_spec.rb +9 -9
  21. data/spec/integration/has_and_belongs_to_many_associations_spec.rb +46 -47
  22. data/spec/integration/has_many_associations_spec.rb +17 -17
  23. data/spec/integration/json_serialization_spec.rb +2 -2
  24. data/spec/integration/load_from_solr_spec.rb +1 -1
  25. data/spec/integration/model_spec.rb +9 -9
  26. data/spec/integration/nested_attribute_spec.rb +17 -17
  27. data/spec/integration/ntriples_datastream_spec.rb +43 -43
  28. data/spec/integration/om_datastream_spec.rb +37 -37
  29. data/spec/integration/persistence_spec.rb +1 -1
  30. data/spec/integration/rdf_nested_attributes_spec.rb +9 -9
  31. data/spec/integration/relation_delegation_spec.rb +7 -7
  32. data/spec/integration/relation_spec.rb +2 -2
  33. data/spec/integration/rels_ext_datastream_spec.rb +3 -3
  34. data/spec/integration/scoped_query_spec.rb +14 -14
  35. data/spec/integration/solr_service_spec.rb +24 -24
  36. data/spec/support/mock_fedora.rb +9 -10
  37. data/spec/unit/active_fedora_spec.rb +20 -20
  38. data/spec/unit/attributes_spec.rb +24 -24
  39. data/spec/unit/base_active_model_spec.rb +6 -6
  40. data/spec/unit/base_cma_spec.rb +2 -2
  41. data/spec/unit/base_datastream_management_spec.rb +7 -7
  42. data/spec/unit/base_extra_spec.rb +20 -20
  43. data/spec/unit/base_spec.rb +141 -141
  44. data/spec/unit/builder/has_and_belongs_to_many_spec.rb +1 -1
  45. data/spec/unit/callback_spec.rb +12 -12
  46. data/spec/unit/code_configurator_spec.rb +7 -7
  47. data/spec/unit/config_spec.rb +2 -2
  48. data/spec/unit/content_model_spec.rb +19 -20
  49. data/spec/unit/core_spec.rb +1 -1
  50. data/spec/unit/datastream_collections_spec.rb +101 -101
  51. data/spec/unit/datastream_spec.rb +12 -12
  52. data/spec/unit/datastreams_spec.rb +39 -39
  53. data/spec/unit/file_configurator_spec.rb +117 -117
  54. data/spec/unit/has_and_belongs_to_many_collection_spec.rb +16 -16
  55. data/spec/unit/has_many_collection_spec.rb +5 -5
  56. data/spec/unit/inheritance_spec.rb +5 -5
  57. data/spec/unit/model_spec.rb +5 -5
  58. data/spec/unit/nom_datastream_spec.rb +5 -5
  59. data/spec/unit/ntriples_datastream_spec.rb +56 -56
  60. data/spec/unit/om_datastream_spec.rb +99 -99
  61. data/spec/unit/persistence_spec.rb +2 -2
  62. data/spec/unit/predicates_spec.rb +28 -28
  63. data/spec/unit/property_spec.rb +5 -5
  64. data/spec/unit/qualified_dublin_core_datastream_spec.rb +10 -10
  65. data/spec/unit/query_spec.rb +66 -66
  66. data/spec/unit/rdf_datastream_spec.rb +10 -10
  67. data/spec/unit/rdf_resource_datastream_spec.rb +2 -2
  68. data/spec/unit/rdf_xml_writer_spec.rb +3 -3
  69. data/spec/unit/rdfxml_rdf_datastream_spec.rb +9 -9
  70. data/spec/unit/relationship_graph_spec.rb +31 -31
  71. data/spec/unit/reload_on_save_spec.rb +3 -3
  72. data/spec/unit/rels_ext_datastream_spec.rb +28 -28
  73. data/spec/unit/rspec_matchers/belong_to_associated_active_fedora_object_matcher_spec.rb +11 -11
  74. data/spec/unit/rspec_matchers/have_many_associated_active_fedora_objects_matcher_spec.rb +11 -11
  75. data/spec/unit/rspec_matchers/have_predicate_matcher_spec.rb +11 -11
  76. data/spec/unit/rspec_matchers/match_fedora_datastream_matcher_spec.rb +7 -7
  77. data/spec/unit/rubydora_connection_spec.rb +3 -3
  78. data/spec/unit/semantic_node_spec.rb +17 -17
  79. data/spec/unit/serializers_spec.rb +1 -1
  80. data/spec/unit/service_definitions_spec.rb +11 -11
  81. data/spec/unit/simple_datastream_spec.rb +6 -6
  82. data/spec/unit/solr_config_options_spec.rb +10 -10
  83. data/spec/unit/solr_digital_object_spec.rb +4 -4
  84. data/spec/unit/solr_service_spec.rb +41 -41
  85. data/spec/unit/unsaved_digital_object_spec.rb +8 -8
  86. data/spec/unit/validations_spec.rb +6 -6
  87. metadata +4 -4
@@ -31,8 +31,8 @@ describe ActiveFedora::Base do
31
31
  describe ".destroy_all" do
32
32
  it "should remove both and run callbacks" do
33
33
  SpecModel::Basic.destroy_all
34
- SpecModel::Basic.count.should == 0
35
- SpecModel::Basic.callback_counter.should == 2
34
+ expect(SpecModel::Basic.count).to eq(0)
35
+ expect(SpecModel::Basic.callback_counter).to eq(2)
36
36
  end
37
37
 
38
38
  describe "when a model is missing" do
@@ -48,7 +48,7 @@ describe ActiveFedora::Base do
48
48
  it "should be able to skip a missing model" do
49
49
  expect(ActiveFedora::Base.logger).to receive(:error).with("Although #{pid} was found in Solr, it doesn't seem to exist in Fedora. The index is out of synch.")
50
50
  SpecModel::Basic.destroy_all
51
- SpecModel::Basic.count.should == 1
51
+ expect(SpecModel::Basic.count).to eq(1)
52
52
  end
53
53
  end
54
54
  end
@@ -56,8 +56,8 @@ describe ActiveFedora::Base do
56
56
  describe ".delete_all" do
57
57
  it "should remove both and not run callbacks" do
58
58
  SpecModel::Basic.delete_all
59
- SpecModel::Basic.count.should == 0
60
- SpecModel::Basic.callback_counter.should == 0
59
+ expect(SpecModel::Basic.count).to eq(0)
60
+ expect(SpecModel::Basic.callback_counter).to eq(0)
61
61
  end
62
62
  end
63
63
  end
@@ -23,6 +23,6 @@ describe "fedora_solr_sync_issues" do
23
23
  it "should not go into an infinite loop" do
24
24
  subject.inner_object.delete
25
25
  parent.reload
26
- parent.things.should == []
26
+ expect(parent.things).to eq([])
27
27
  end
28
28
  end
@@ -108,16 +108,16 @@ describe ActiveFedora::Base do
108
108
  end
109
109
 
110
110
  it "should be an instance of ActiveFedora::Base" do
111
- @test_history.should be_kind_of(ActiveFedora::Base)
111
+ expect(@test_history).to be_kind_of(ActiveFedora::Base)
112
112
  end
113
113
 
114
114
 
115
115
  it "should create proxies to all the datastreams" do
116
116
  properties_ds = @test_history.datastreams["properties"]
117
117
  dublin_core_ds = @test_history.datastreams["dublin_core"]
118
- @test_history.properties.should be properties_ds
119
- @test_history.should respond_to(:properties)
120
- OralHistory.new.should respond_to(:properties)
118
+ expect(@test_history.properties).to be properties_ds
119
+ expect(@test_history).to respond_to(:properties)
120
+ expect(OralHistory.new).to respond_to(:properties)
121
121
  end
122
122
 
123
123
 
@@ -142,12 +142,12 @@ describe ActiveFedora::Base do
142
142
  @properties_sample_values.each_pair do |field, value|
143
143
  next if field == :hard_copy_availability #FIXME HYDRA-824
144
144
  next if field == :location #FIXME HYDRA-825
145
- (@solr_result[ActiveFedora::SolrService.solr_name(field, type: :string)] || @solr_result[ActiveFedora::SolrService.solr_name(field, type: :date)]).should == [::Solrizer::Extractor.format_node_value(value)]
145
+ expect(@solr_result[ActiveFedora::SolrService.solr_name(field, type: :string)] || @solr_result[ActiveFedora::SolrService.solr_name(field, type: :date)]).to eq([::Solrizer::Extractor.format_node_value(value)])
146
146
  end
147
147
 
148
148
  @dublin_core_sample_values.each_pair do |field, value|
149
149
  next if [:format, :type].include?(field) #format and type are methods declared on Object
150
- dublin_core_ds.send("#{field.to_s}").should == [value]
150
+ expect(dublin_core_ds.send("#{field.to_s}")).to eq([value])
151
151
  end
152
152
  end
153
153
 
@@ -158,19 +158,19 @@ describe ActiveFedora::Base do
158
158
  dublin_core_ds.subject = "My Subject Heading"
159
159
  dc_xml = REXML::Document.new(dublin_core_ds.to_xml)
160
160
 
161
- dc_xml.root.elements["dcterms:subject"].text.should == "My Subject Heading"
161
+ expect(dc_xml.root.elements["dcterms:subject"].text).to eq("My Subject Heading")
162
162
 
163
163
  end
164
164
 
165
165
  it "should support #find_with_conditions" do
166
166
  solr_result = OralHistory.find_with_conditions({})
167
- solr_result.should_not be_nil
167
+ expect(solr_result).not_to be_nil
168
168
  end
169
169
 
170
170
  describe '#new' do
171
171
  it "should support custom pids" do
172
172
  oh = OralHistory.new(:pid=>"uuid:blah-blah-blah")
173
- oh.pid.should == "uuid:blah-blah-blah"
173
+ expect(oh.pid).to eq("uuid:blah-blah-blah")
174
174
  end
175
175
  end
176
176
 
@@ -36,14 +36,14 @@ describe ActiveFedora::Base do
36
36
  end
37
37
  it "habtm should set and remove relationships bidirectionally" do
38
38
  @book.topics << @topic1
39
- @book.topics.should == [@topic1]
40
- @topic1.books.should == [@book]
41
- @topic1.reload.books.should == [@book]
39
+ expect(@book.topics).to eq([@topic1])
40
+ expect(@topic1.books).to eq([@book])
41
+ expect(@topic1.reload.books).to eq([@book])
42
42
 
43
43
  @book.topics.delete(@topic1)
44
44
  #@topic1.books.delete(@book)
45
- @book.topics.should == []
46
- @topic1.books.should == []
45
+ expect(@book.topics).to eq([])
46
+ expect(@topic1.books).to eq([])
47
47
  end
48
48
  it "Should allow for more than 10 items" do
49
49
 
@@ -51,16 +51,16 @@ describe ActiveFedora::Base do
51
51
  @book.topics << Topic.create
52
52
  end
53
53
  @book.save
54
- @book.topics.count.should == 12
54
+ expect(@book.topics.count).to eq(12)
55
55
  book2 = Book.find(@book.pid)
56
- book2.topics.count.should == 12
56
+ expect(book2.topics.count).to eq(12)
57
57
  end
58
58
 
59
59
  it "Should find inherited objects along with base objects" do
60
60
  @book.topics << @topic1
61
61
  @special_book.topics << @topic1
62
- @topic1.books.should == [@book, @special_book]
63
- @topic1.reload.books.should == [@book, @special_book]
62
+ expect(@topic1.books).to eq([@book, @special_book])
63
+ expect(@topic1.reload.books).to eq([@book, @special_book])
64
64
  end
65
65
 
66
66
  it "Should cast found books to the correct cmodel" do
@@ -83,20 +83,20 @@ describe ActiveFedora::Base do
83
83
  end
84
84
  it "should set relationships bidirectionally" do
85
85
  @book.topics << @topic1
86
- @book.topics.should == [@topic1]
87
- @book.relationships(:has_topic).should == [@topic1.internal_uri]
88
- @topic1.relationships(:has_topic).should == []
89
- @topic1.relationships(:is_topic_of).should == [@book.internal_uri]
90
- Topic.find(@topic1.pid).books.should == [@book] #Can't have saved it because @book isn't saved yet.
86
+ expect(@book.topics).to eq([@topic1])
87
+ expect(@book.relationships(:has_topic)).to eq([@topic1.internal_uri])
88
+ expect(@topic1.relationships(:has_topic)).to eq([])
89
+ expect(@topic1.relationships(:is_topic_of)).to eq([@book.internal_uri])
90
+ expect(Topic.find(@topic1.pid).books).to eq([@book]) #Can't have saved it because @book isn't saved yet.
91
91
  end
92
92
  it "should save new child objects" do
93
93
  @book.topics << Topic.new
94
- @book.topics.first.pid.should_not be_nil
94
+ expect(@book.topics.first.pid).not_to be_nil
95
95
  end
96
96
  it "should clear out the old associtions" do
97
97
  @book.topics = [@topic1]
98
98
  @book.topics = [@topic2]
99
- @book.topic_ids.should == [@topic2.pid]
99
+ expect(@book.topic_ids).to eq([@topic2.pid])
100
100
  end
101
101
  after do
102
102
  @book.delete
@@ -135,27 +135,27 @@ describe ActiveFedora::Base do
135
135
  end
136
136
 
137
137
  it "should have a collection" do
138
- book.relationships(:is_member_of_collection).should == [collection.internal_uri]
139
- book.collections.should == [collection]
138
+ expect(book.relationships(:is_member_of_collection)).to eq([collection.internal_uri])
139
+ expect(book.collections).to eq([collection])
140
140
  end
141
141
  it "habtm should not set foreign relationships if :inverse_of is not specified" do
142
- collection.relationships(:is_member_of_collection).should == []
142
+ expect(collection.relationships(:is_member_of_collection)).to eq([])
143
143
  end
144
144
  it "should load the collections" do
145
145
  reloaded = Book.find(book.pid)
146
- reloaded.collections.should == [collection]
146
+ expect(reloaded.collections).to eq([collection])
147
147
  end
148
148
 
149
149
  describe "#empty?" do
150
150
  subject { book.collections }
151
- its(:empty?) { should be_false }
151
+ its(:empty?) { is_expected.to be_falsey }
152
152
  end
153
153
  end
154
154
 
155
155
  context "when a book isn't in a collection" do
156
156
  describe "#empty?" do
157
157
  subject { book.collections }
158
- its(:empty?) { should be_true }
158
+ its(:empty?) { should be_truthy }
159
159
  end
160
160
  end
161
161
  end
@@ -191,23 +191,23 @@ describe ActiveFedora::Base do
191
191
  end
192
192
 
193
193
  it "delete should cause the entries to be removed from RELS-EXT, but not destroy the original record" do
194
- book.collections.should == [collection1, collection2]
194
+ expect(book.collections).to eq([collection1, collection2])
195
195
  book.collections.delete(collection1)
196
- book.collections.should == [collection2]
196
+ expect(book.collections).to eq([collection2])
197
197
  book.save!
198
198
  book.reload
199
- book.collections.should == [collection2]
200
- expect {Collection.find(collection1.pid)}.to_not be_nil
199
+ expect(book.collections).to eq([collection2])
200
+ expect(Collection.find(collection1.pid)).to_not be_nil
201
201
  end
202
202
 
203
203
  it "destroy should cause the entries to be removed from RELS-EXT, but not destroy the original record" do
204
- book.collections.should == [collection1, collection2]
204
+ expect(book.collections).to eq([collection1, collection2])
205
205
  book.collections.destroy(collection1)
206
- book.collections.should == [collection2]
206
+ expect(book.collections).to eq([collection2])
207
207
  book.save!
208
208
  book.reload
209
- book.collections.should == [collection2]
210
- expect {Collection.find(collection1.pid)}.to_not be_nil
209
+ expect(book.collections).to eq([collection2])
210
+ expect(Collection.find(collection1.pid)).to_not be_nil
211
211
  end
212
212
  end
213
213
 
@@ -240,25 +240,25 @@ describe ActiveFedora::Base do
240
240
  end
241
241
 
242
242
  it "destroy should cause the before_remove and after_remove callback to be triggered" do
243
- book.should_receive(:foo).with(collection)
244
- book.should_receive(:bar).with(collection)
243
+ expect(book).to receive(:foo).with(collection)
244
+ expect(book).to receive(:bar).with(collection)
245
245
  book.collections.destroy(collection)
246
246
  end
247
247
 
248
248
  it "delete should cause the before_remove and after_remove callback to be triggered" do
249
- book.should_receive(:foo).with(collection)
250
- book.should_receive(:bar).with(collection)
249
+ expect(book).to receive(:foo).with(collection)
250
+ expect(book).to receive(:bar).with(collection)
251
251
  book.collections.delete(collection)
252
252
  end
253
253
 
254
254
  it "should not remove if an exception is thrown in before_remove" do
255
- book.should_receive(:foo).with(collection).and_raise
256
- book.should_not_receive(:bar)
255
+ expect(book).to receive(:foo).with(collection).and_raise
256
+ expect(book).not_to receive(:bar)
257
257
  begin
258
258
  book.collections.delete(collection)
259
259
  rescue RuntimeError
260
260
  end
261
- book.collections.should == [collection]
261
+ expect(book.collections).to eq([collection])
262
262
  end
263
263
  end
264
264
 
@@ -287,25 +287,25 @@ describe ActiveFedora::Base do
287
287
  end
288
288
 
289
289
  it "shift should cause the before_add and after_add callback to be triggered" do
290
- book.should_receive(:foo).with(collection)
291
- book.should_receive(:bar).with(collection)
290
+ expect(book).to receive(:foo).with(collection)
291
+ expect(book).to receive(:bar).with(collection)
292
292
  book.collections << collection
293
293
  end
294
294
 
295
295
  it "assignment should cause the before_add and after_add callback to be triggered" do
296
- book.should_receive(:foo).with(collection)
297
- book.should_receive(:bar).with(collection)
296
+ expect(book).to receive(:foo).with(collection)
297
+ expect(book).to receive(:bar).with(collection)
298
298
  book.collections = [collection]
299
299
  end
300
300
 
301
301
  it "should not add if an exception is thrown in before_add" do
302
- book.should_receive(:foo).with(collection).and_raise
303
- book.should_not_receive(:bar)
302
+ expect(book).to receive(:foo).with(collection).and_raise
303
+ expect(book).not_to receive(:bar)
304
304
  begin
305
305
  book.collections << collection
306
306
  rescue RuntimeError
307
307
  end
308
- book.collections.should == []
308
+ expect(book.collections).to eq([])
309
309
  end
310
310
  end
311
311
 
@@ -341,7 +341,7 @@ describe "Autosave" do
341
341
 
342
342
  it "should save dependent records" do
343
343
  component.reload
344
- component.items.first.title.should == 'my title'
344
+ expect(component.items.first.title).to eq('my title')
345
345
  end
346
346
  end
347
347
  describe "From the has_many side" do
@@ -349,9 +349,8 @@ describe "Autosave" do
349
349
 
350
350
  it "should save dependent records" do
351
351
  item.reload
352
- item.components.first.description.should == 'my description'
352
+ expect(item.components.first.description).to eq('my description')
353
353
  end
354
354
  end
355
355
 
356
356
  end
357
-
@@ -21,7 +21,7 @@ describe "Collection members" do
21
21
  expect(library.books).not_to be_loaded
22
22
  expect(library.books.size).to eq(0)
23
23
  expect(library.books).to be_loaded
24
- expect(library.books.any?).to be_false
24
+ expect(library.books.any?).to be_falsey
25
25
  end
26
26
  end
27
27
  end
@@ -41,9 +41,9 @@ describe "Collection members" do
41
41
  end
42
42
 
43
43
  it "should cache the results" do
44
- expect(library.books.loaded?).to be_false
44
+ expect(library.books.loaded?).to be_falsey
45
45
  expect(library.books).to eq [book]
46
- expect(library.books.loaded?).to be_true
46
+ expect(library.books.loaded?).to be_truthy
47
47
  end
48
48
  it "should load from solr" do
49
49
  expect(library.books.load_from_solr.map {|r| r["id"]}).to eq([book.pid])
@@ -52,9 +52,9 @@ describe "Collection members" do
52
52
  expect(library.books.load_from_solr(rows: 0).size).to eq(0)
53
53
  end
54
54
  it "should respond to #any?" do
55
- expect(library.books.any?).to be_true
56
- expect(library.books.any? {|book| book.library == nil}).to be_false
57
- expect(library.books.any? {|book| book.library == library}).to be_true
55
+ expect(library.books.any?).to be_truthy
56
+ expect(library.books.any? {|book| book.library == nil}).to be_falsey
57
+ expect(library.books.any? {|book| book.library == library}).to be_truthy
58
58
  end
59
59
  end
60
60
  end
@@ -84,7 +84,7 @@ describe "After save callbacks" do
84
84
  let(:book) { Book.new(library: library) }
85
85
  it "should have the relationship available in after_save" do
86
86
  book.save!
87
- book.library_books.should include book
87
+ expect(book.library_books).to include book
88
88
  end
89
89
  end
90
90
 
@@ -115,8 +115,8 @@ describe "When two or more relationships share the same property" do
115
115
 
116
116
  it "Should only return relationships of the correct class" do
117
117
  @book.reload
118
- @book.people.should == [@person1, @person2]
119
- @book.collections.should == []
118
+ expect(@book.people).to eq([@person1, @person2])
119
+ expect(@book.collections).to eq([])
120
120
  end
121
121
  end
122
122
 
@@ -150,7 +150,7 @@ describe "When relationship is restricted to AF::Base" do
150
150
  end
151
151
  it "Should not restrict relationships " do
152
152
  @book.reload
153
- @book.attachments.should == [@image, @pdf]
153
+ expect(@book.attachments).to eq([@image, @pdf])
154
154
  end
155
155
  end
156
156
 
@@ -168,7 +168,7 @@ describe "When relationship is restricted to AF::Base" do
168
168
  it "Should not restrict relationships " do
169
169
  email.attachment_ids = [image.id, pdf.id]
170
170
  email.reload
171
- email.attachments.should == [image, pdf]
171
+ expect(email.attachments).to eq([image, pdf])
172
172
  end
173
173
  end
174
174
  end
@@ -194,12 +194,12 @@ describe "Deleting a dependent relationship" do
194
194
  it "should remove relationships" do
195
195
  component.item = item
196
196
  component.save!
197
- item.components.should == [component]
197
+ expect(item.components).to eq([component])
198
198
  item.components.delete(component)
199
199
  item.reload
200
200
  component.reload
201
- component.relationships(:is_part_of).should == []
202
- item.components.should == []
201
+ expect(component.relationships(:is_part_of)).to eq([])
202
+ expect(item.components).to eq([])
203
203
  end
204
204
 
205
205
  it "should remove the relationships that point at that object" do
@@ -207,7 +207,7 @@ describe "Deleting a dependent relationship" do
207
207
  component.save!
208
208
  item.delete
209
209
  component.reload
210
- component.relationships(:is_part_of).should == []
210
+ expect(component.relationships(:is_part_of)).to eq([])
211
211
  end
212
212
 
213
213
  it "should only try to delete objects that exist in the datastore (not cached objects)" do
@@ -254,7 +254,7 @@ describe "Autosave" do
254
254
 
255
255
  it "should save dependent records" do
256
256
  component.reload
257
- component.item.title.should == 'my title'
257
+ expect(component.item.title).to eq('my title')
258
258
  end
259
259
  end
260
260
  describe "From the has_many side" do
@@ -262,7 +262,7 @@ describe "Autosave" do
262
262
 
263
263
  it "should save dependent records" do
264
264
  item.reload
265
- item.components.first.description.should == 'my description'
265
+ expect(item.components.first.description).to eq('my description')
266
266
  end
267
267
  end
268
268
 
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe "Objects should be serialized to JSON" do
4
4
  it "should have json results" do
5
- ActiveFedora::Base.new.to_json.should == "{\"id\":null}"
5
+ expect(ActiveFedora::Base.new.to_json).to eq("{\"id\":null}")
6
6
  end
7
7
 
8
8
  describe "with a more interesting model" do
@@ -20,7 +20,7 @@ describe "Objects should be serialized to JSON" do
20
20
  Object.send(:remove_const, :Foo)
21
21
  end
22
22
  subject { Foo.new(foo: ["baz"], bar: 'quix') }
23
- before { subject.stub(pid: 'test:123') }
23
+ before { allow(subject).to receive_messages(pid: 'test:123') }
24
24
  it "should have to_json" do
25
25
  json = JSON.parse(subject.to_json)
26
26
  expect(json['id']).to eq "test:123"
@@ -52,7 +52,7 @@ describe "Loading from solr" do
52
52
  end
53
53
 
54
54
  it "should be able to get indexed properties without loading from fedora" do
55
- RdfTest.connection_for_pid('1').should_not_receive(:datastream_dissemination)
55
+ expect(RdfTest.connection_for_pid('1')).not_to receive(:datastream_dissemination)
56
56
  obj = RdfTest.load_instance_from_solr original.pid
57
57
  expect(obj.title).to eq "PLAN 9 FROM OUTER SPACE"
58
58
  expect(obj.date_uploaded).to eq [Date.parse('1959-01-01')]