Sha256: 9c0a07eebf7baa6ebda0e2c27f16b4ea57965875e455040f26f6c1bbc0898cb6

Contents?: true

Size: 628 Bytes

Versions: 9

Compression:

Stored size: 628 Bytes

Contents

require 'rails_helper'

RSpec.describe Newsletter::Asset do
  before(:each) do
    Newsletter::AssetUploader.enable_processing = true
  end
  it "knows if it is an image" do
    asset = FactoryGirl.create(:asset)
    # default factory assumes image
    expect(asset.is_image?).to be true
  end
  it "knows if it is not an image" do
    asset = FactoryGirl.create(:asset,
      image: File.open(File.join(Rails.root, 
      '/spec/support/files/test.pdf'))
    )
    # default factory assumes image
    expect(asset.is_image?).to be false
  end
  after(:each) do
    Newsletter::AssetUploader.enable_processing = false
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
newsletter-3.2.25.1 spec/test_app/spec/models/newsletter/asset_spec.rb
newsletter-3.2.22.0 spec/test_app/spec/models/newsletter/asset_spec.rb
newsletter-3.2.7 spec/test_app/spec/models/newsletter/asset_spec.rb
newsletter-3.2.6 spec/test_app/spec/models/newsletter/asset_spec.rb
newsletter-3.2.5 spec/test_app/spec/models/newsletter/asset_spec.rb
newsletter-3.2.4 spec/test_app/spec/models/newsletter/asset_spec.rb
newsletter-3.2.2 spec/test_app/spec/models/newsletter/asset_spec.rb
newsletter-3.2.1 spec/test_app/spec/models/newsletter/asset_spec.rb
newsletter-3.2.0 spec/test_app/spec/models/newsletter/asset_spec.rb