mirror of
https://github.com/discourse/discourse.git
synced 2024-12-13 07:23:44 +08:00
493d437e79
* Remove outdated option
04078317ba
* Use the non-globally exposed RSpec syntax
https://github.com/rspec/rspec-core/pull/2803
* Use the non-globally exposed RSpec syntax, cont
https://github.com/rspec/rspec-core/pull/2803
* Comply to strict predicate matchers
See:
- https://github.com/rspec/rspec-expectations/pull/1195
- https://github.com/rspec/rspec-expectations/pull/1196
- https://github.com/rspec/rspec-expectations/pull/1277
27 lines
694 B
Ruby
27 lines
694 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe Jobs::UpdateAnimatedUploads do
|
|
let!(:upload) { Fabricate(:upload) }
|
|
let!(:gif_upload) { Fabricate(:upload, extension: "gif") }
|
|
|
|
before do
|
|
url = Discourse.store.path_for(gif_upload) || gif_upload.url
|
|
FastImage.expects(:animated?).with(url).returns(true).once
|
|
end
|
|
|
|
it "affects only GIF uploads" do
|
|
described_class.new.execute({})
|
|
|
|
expect(upload.reload.animated).to eq(nil)
|
|
expect(gif_upload.reload.animated).to eq(true)
|
|
end
|
|
|
|
it "works with uploads larger than current limits" do
|
|
SiteSetting.max_image_size_kb = 1
|
|
|
|
described_class.new.execute({})
|
|
|
|
expect(gif_upload.reload.animated).to eq(true)
|
|
end
|
|
end
|