Skip to content

Commit

Permalink
adding test
Browse files Browse the repository at this point in the history
  • Loading branch information
hudajkhan committed Nov 3, 2023
1 parent 6880aef commit be29976
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion spec/models/projection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
end
end

describe '#tile_dimensions' do
describe '#tiledimensions' do
subject { instance.send(:tile_dimensions) }

context "for an unrestricted image" do
Expand Down Expand Up @@ -112,6 +112,18 @@
expect(http_client).to have_received(:get).with(%r{/full/max/0/default.jpg})
end
end

context "best fit size" do
let(:options) { { size: '!850,700', region: 'full' } }

it 'returns original size when requested dimensions are larger' do
allow(HTTP).to receive(:use)
.and_return(http_client)
allow(http_client).to receive(:get).and_return(double(body: nil))
subject.response
expect(http_client).to have_received(:get).with(%r{/full/!800,600/0/default.jpg})
end
end
end

context 'for a restricted image' do
Expand Down

0 comments on commit be29976

Please sign in to comment.