spec/datastream_spec.rb in rubydora-0.1.4 vs spec/datastream_spec.rb in rubydora-0.1.5
- old
+ new
@@ -91,9 +91,16 @@
@mock_repository.should_receive(:modify_datastream).with(hash_including(:dsLabel => "New Label"))
@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