Sha256: 42b305274922972f400f82303ff6fcc86c04fa8d9123a77be0d855d3788b0fe6

Contents?: true

Size: 792 Bytes

Versions: 2

Compression:

Stored size: 792 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe Lcms::Engine::Admin::AdminController do
  describe '.host_engine_path' do
    let(:args) { { query: 'test', filter: '1' } }

    subject { described_class.host_engine_path(:root_path, args) }

    context 'with host redirect' do
      it 'builds correct path' do
        expect(subject).to eq "/admin?#{args.to_param}"
      end
    end

    context 'with engine redirect' do
      let(:settings) do
        settings = described_class.settings
        settings[:redirect].delete(:host)
        settings
      end

      before { allow(described_class).to receive(:settings).and_return(settings) }

      it 'builds correct path' do
        expect(subject).to eq "/lcms-engine/admin?#{args.to_param}"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lcms-engine-0.2.0 spec/controllers/admin/admin_controller_spec.rb
lcms-engine-0.1.2 spec/controllers/admin/admin_controller_spec.rb