Sha256: 7d6a6620cbfa307f583eda89ff49484e2ce79342422e4a0915c63f865d045420
Contents?: true
Size: 947 Bytes
Versions: 1
Compression:
Stored size: 947 Bytes
Contents
require 'spec_helper' describe LightResizer::Middleware::Path do let(:path) { described_class.new } context 'valid path methods' do before(:each) do path.request_path = '/resize_image/150x150/some_dir/image.png' end it { expect(path.image_path?).to eq(true) } it { expect(path.image_path).to eq('/some_dir/image.png') } it { expect(path.dimensions).to eq('150x150') } it { expect(path.prefix).to eq('150x150') } end context 'resize with crop' do before(:each) do path.request_path = '/resize_image_crop/150x150/some_dir/image.png' end it { expect(path.crop_path?).to be_true } it { expect(path.dimensions).to eq('150x150') } it { expect(path.prefix).to eq('150x150_crop') } end context 'wrong path methods' do before(:each) do path.request_path = '/asdada/123acad/some_dir/imdage.png' end it { expect(path.image_path?).to eq(false) } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
light_resizer-0.0.2 | spec/unit/middleware_path_spec.rb |