Sha256: a13ec1683d0c7e488d66e99ee2dd30d999b3db1b1a3e0011ce88d9ce67e5b6b2
Contents?: true
Size: 640 Bytes
Versions: 5
Compression:
Stored size: 640 Bytes
Contents
require 'spec_helper' describe Sufia::GenericFile::ReloadOnSave, :type => :model do let(:user) { FactoryGirl.find_or_create(:jill) } let(:file) { GenericFile.new.tap { |f| f.apply_depositor_metadata(user); f.save! } } it 'defaults to not call reload' do expect(file).not_to receive(:reload) file.save end it 'can be set to call reload' do file.reload_on_save = true expect(file).to receive(:reload) file.save end it 'allows reload to be turned off and on' do file.reload_on_save = true expect(file).to receive(:reload).once file.save file.reload_on_save = false file.save end end
Version data entries
5 entries across 5 versions & 1 rubygems