Sha256: 6f08327356495d5c2d4c50a8a126a1ceb3e915e66b8241be6b0e56c46993c684

Contents?: true

Size: 900 Bytes

Versions: 37

Compression:

Stored size: 900 Bytes

Contents

require 'spec_helper'

describe Spree::HomeController, type: :controller do
  it "provides current user to the searcher class" do
    user = mock_model(Spree.user_class, last_incomplete_spree_order: nil, spree_api_key: 'fake')
    allow(controller).to receive_messages try_spree_current_user: user
    expect_any_instance_of(Spree::Config.searcher_class).to receive(:current_user=).with(user)
    get :index
    expect(response.status).to eq(200)
  end

  context "layout" do
    it "renders default layout" do
      get :index
      expect(response).to render_template(layout: 'spree/layouts/spree_application')
    end

    context "different layout specified in config" do
      before { Spree::Config.layout = 'layouts/application' }

      it "renders specified layout" do
        get :index
        expect(response).to render_template(layout: 'layouts/application')
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
solidus_frontend-2.3.0.beta1 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-2.0.2 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-1.4.1 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-2.2.1 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-2.2.0 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-2.2.0.rc1 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-2.2.0.beta1 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-2.1.0 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-2.1.0.rc1 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-2.0.1 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-2.1.0.beta1 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-2.0.0 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-1.4.0 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-2.0.0.rc1 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-1.4.0.rc1 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-2.0.0.beta1 spec/controllers/spree/home_controller_spec.rb
solidus_frontend-1.4.0.beta1 spec/controllers/spree/home_controller_spec.rb