Skip to content

Commit

Permalink
ActiveRecord specs for dimensions with ImageProcessors included
Browse files Browse the repository at this point in the history
  • Loading branch information
artygus committed Oct 30, 2018
1 parent b149dcf commit 194c2ed
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions spec/orm/activerecord_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,30 @@ def reset_class(class_name)

expect(@event.reload.image).to be_blank
end

context "with CarrierWave::MiniMagick" do
before(:each) do
@uploader.send(:include, CarrierWave::MiniMagick)
end

it "has width and height" do
@event.image = stub_file('landscape.jpg')
expect(@event.image.width).to eq 640
expect(@event.image.height).to eq 480
end
end

context "with CarrierWave::MiniMagick" do
before(:each) do
@uploader.send(:include, CarrierWave::RMagick)
end

it "has width and height" do
@event.image = stub_file('landscape.jpg')
expect(@event.image.width).to eq 640
expect(@event.image.height).to eq 480
end
end
end

describe '#image=' do
Expand Down

0 comments on commit 194c2ed

Please # to comment.