Sha256: 5e8f602634ba88777148ff530961c742062b56dfa956c846e4f5a25f84c4f7d6

Contents?: true

Size: 855 Bytes

Versions: 32

Compression:

Stored size: 855 Bytes

Contents

require 'spec_helper'
# This test exists in this file because in the standard admin/products_controller spec
# There is the stub_authorization call. This call is not triggered for this test because
# the load_resource filter in Spree::Admin::ResourceController is prepended to the filter chain
# this means this call is triggered before the authorize_admin call and in this case
# the load_resource filter halts the request meaning authorize_admin is not called at all.
describe Spree::Admin::ProductsController, type: :controller do
  stub_authorization!

  # Regression test for GH https://github.com/spree/spree/issues/538
  it "cannot find a non-existent product" do
    get :edit, params: { id: "non-existent-product" }
    expect(response).to redirect_to(spree.admin_products_path)
    expect(flash[:error]).to eql("Product is not found")
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
solidus_backend-2.5.2 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.5.1 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.5.0 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.5.0.rc1 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.5.0.beta2 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.5.0.beta1 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.4.2 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.4.1 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.3.1 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.2.2 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.1.1 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.0.3 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.4.0 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.4.0.rc1 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.4.0.beta1 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.3.0 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.3.0.rc3 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.3.0.rc2 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.3.0.rc1 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.3.0.beta1 spec/controllers/spree/admin/missing_products_controller_spec.rb