Sha256: dcea3bd4d839f2a263790644bf4d0ff6404c317981f718c3da115244e9c50bd5

Contents?: true

Size: 886 Bytes

Versions: 47

Compression:

Stored size: 886 Bytes

Contents

# frozen_string_literal: true

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

47 entries across 47 versions & 2 rubygems

Version Path
solidus_backend-2.10.5 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.10.3 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.10.2 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.9.6 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.8.6 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.10.1 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.9.5 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.10.0 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.9.4 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.6.6 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.7.4 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.8.5 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.9.3 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.9.2 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.10.0.beta1 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.7.3 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.6.5 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.9.1 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.9.0 spec/controllers/spree/admin/missing_products_controller_spec.rb
solidus_backend-2.9.0.rc.1 spec/controllers/spree/admin/missing_products_controller_spec.rb