Sha256: 6dc1ecd004fad709304fbeaa34bbbd21d7c766d24673f47c5544862d8e4cf133

Contents?: true

Size: 1.01 KB

Versions: 20

Compression:

Stored size: 1.01 KB

Contents

RSpec.shared_examples "an object that can have an intermediate file" do

  subject { described_class.new(title: [ "I Have An Intermediate File!" ]) }

  describe "save" do
    describe "when a new intermediate file is present" do
      context "and it's a new object" do
        before { subject.add_file file, "intermediateFile" }
        let(:file) { fixture_file_upload("imageA.jpg", "image/jpeg") }
        it "should generate derivatives" do
          expect_any_instance_of(Ddr::Managers::DerivativesManager).to receive(:update_derivatives)
          subject.save
        end
      end
      context "and it's an existing object with an intermediate file" do
        before { subject.upload! fixture_file_upload('imageA.jpg', 'image/jpeg') }
        let(:file) { fixture_file_upload("imageB.jpg", "image/jpeg") }
        it "should generate derivatives" do
          expect_any_instance_of(Ddr::Managers::DerivativesManager).to receive(:update_derivatives)
          subject.upload! file
        end
      end
    end
  end

end


Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ddr-models-2.11.0 spec/support/shared_examples_for_has_intermediate_file.rb
ddr-models-2.10.2 spec/support/shared_examples_for_has_intermediate_file.rb
ddr-models-2.10.1 spec/support/shared_examples_for_has_intermediate_file.rb
ddr-models-2.10.0 spec/support/shared_examples_for_has_intermediate_file.rb
ddr-models-2.10.0.rc2 spec/support/shared_examples_for_has_intermediate_file.rb
ddr-models-2.10.0.rc1 spec/support/shared_examples_for_has_intermediate_file.rb
ddr-models-2.9.2 spec/support/shared_examples_for_has_intermediate_spec.rb
ddr-models-2.9.1 spec/support/shared_examples_for_has_intermediate_spec.rb
ddr-models-2.9.0 spec/support/shared_examples_for_has_intermediate_spec.rb
ddr-models-2.9.0.rc1 spec/support/shared_examples_for_has_intermediate_spec.rb
ddr-models-2.8.0 spec/support/shared_examples_for_has_intermediate_spec.rb
ddr-models-2.8.0.rc1 spec/support/shared_examples_for_has_intermediate_spec.rb
ddr-models-2.7.6 spec/support/shared_examples_for_has_intermediate_spec.rb
ddr-models-2.7.5 spec/support/shared_examples_for_has_intermediate_spec.rb
ddr-models-2.7.4 spec/support/shared_examples_for_has_intermediate_spec.rb
ddr-models-2.7.3 spec/support/shared_examples_for_has_intermediate_spec.rb
ddr-models-2.7.2 spec/support/shared_examples_for_has_intermediate_spec.rb
ddr-models-2.7.1 spec/support/shared_examples_for_has_intermediate_spec.rb
ddr-models-2.7.0 spec/support/shared_examples_for_has_intermediate_spec.rb
ddr-models-2.7.0.rc1 spec/support/shared_examples_for_has_intermediate_spec.rb