Sha256: da40ff7a5c8b75a1b10b2cc19ea253f09467cee8dbfc4330d3ac50348546a439

Contents?: true

Size: 768 Bytes

Versions: 16

Compression:

Stored size: 768 Bytes

Contents

require 'spec_helper'

describe Spree::Admin::RootController do

  context "unauthorized request" do

    before :each do
      allow(controller).to receive(:spree_current_user).and_return(nil)
    end

    it "redirects to orders path by default" do
      get :index

      expect(response).to redirect_to '/admin/orders'
    end
  end

  context "authorized request" do
    stub_authorization!

    it "redirects to orders path by default" do
      get :index

      expect(response).to redirect_to '/admin/orders'
    end

    it "redirects to wherever admin_root_redirects_path tells it to" do
      expect(controller).to receive(:admin_root_redirect_path).and_return('/grooot')

      get :index

      expect(response).to redirect_to '/grooot'
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
spree_backend-3.1.5 spec/controllers/spree/admin/root_controller_spec.rb
spree_backend-3.1.4 spec/controllers/spree/admin/root_controller_spec.rb
spree_backend-3.1.3 spec/controllers/spree/admin/root_controller_spec.rb
spree_backend-3.1.2 spec/controllers/spree/admin/root_controller_spec.rb
spree_backend-3.0.10 spec/controllers/spree/admin/root_controller_spec.rb
spree_backend-3.1.1 spec/controllers/spree/admin/root_controller_spec.rb
spree_backend-3.1.0 spec/controllers/spree/admin/root_controller_spec.rb
spree_backend-3.1.0.rc4 spec/controllers/spree/admin/root_controller_spec.rb
spree_backend-3.0.9 spec/controllers/spree/admin/root_controller_spec.rb
spree_backend-3.1.0.rc3 spec/controllers/spree/admin/root_controller_spec.rb
spree_backend-3.1.0.rc2 spec/controllers/spree/admin/root_controller_spec.rb
spree_backend-3.1.0.rc1 spec/controllers/spree/admin/root_controller_spec.rb
spree_backend-3.0.8 spec/controllers/spree/admin/root_controller_spec.rb
spree_backend-3.0.7 spec/controllers/spree/admin/root_controller_spec.rb
spree_backend-3.0.6.1 spec/controllers/spree/admin/root_controller_spec.rb
spree_backend-3.0.6 spec/controllers/spree/admin/root_controller_spec.rb