spec/datastream_spec.rb in rubydora-0.1.7 vs spec/datastream_spec.rb in rubydora-0.1.8
- old
+ new
@@ -62,11 +62,10 @@
@mock_repository.should_receive(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('asdf')
@datastream.content.should == "asdf"
end
it "should rewind IO-type contents" do
- @mock_repository.should_receive(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('asdf')
@mock_io = File.open('rubydora.gemspec')
@mock_io.should_receive(:rewind)
@datastream.content = @mock_io
@@ -103,18 +102,16 @@
@datastream.dsLabel = "New Label"
@datastream.save
end
it "should update the datastream when the content is changed" do
- @mock_repository.should_receive(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('asdf')
@mock_repository.should_receive(:modify_datastream).with(hash_including(:content => 'test'))
@datastream.content = "test"
@datastream.save
end
it "should be marked as changed when the content is updated" do
@datastream.changed?.should be_false
- @mock_repository.should_receive(:datastream_dissemination).with(hash_including(:pid => 'pid', :dsid => 'dsid')).and_return('test')
@datastream.content = "test"
@datastream.changed?.should be_true
end
end