Sha256: b38e3e36cf60ca06ce24b9a425d6419b630e7890daeb5c61976336ee3cbf2233
Contents?: true
Size: 1.31 KB
Versions: 3
Compression:
Stored size: 1.31 KB
Contents
require 'spec_helper' require_relative '../../../lib/locomotive/steam/middlewares/concerns/helpers' describe Locomotive::Steam::Middlewares::Concerns::Helpers do let(:middleware) { Class.new { include Locomotive::Steam::Middlewares::Concerns::Helpers } } let(:instance) { middleware.new } describe '#make_local_path' do let(:mounted_on) { nil } let(:location) { '/foo/bar' } before { allow(instance).to receive(:mounted_on).and_return(mounted_on) } subject { instance.make_local_path(location) } it { is_expected.to eq '/foo/bar' } context 'mounted_on is not blank' do let(:mounted_on) { '/my_app' } it { is_expected.to eq '/foo/bar' } context 'path including mounted_on' do let(:location) { '/my_app/foo/bar' } it { is_expected.to eq '/foo/bar' } end end end describe '#redirect_to' do subject { instance.redirect_to(location)[1]['Location'] } context 'mounted_on is not blank' do before { allow(instance).to receive(:mounted_on).and_return('/my_app') } let(:location) { '/foo/bar' } it { is_expected.to eq '/my_app/foo/bar' } describe 'the location already includes mounted_on' do let(:location) { '/my_app/foo' } it { is_expected.to eq '/my_app/foo' } end end end end
Version data entries
3 entries across 3 versions & 1 rubygems