Sha256: 234111716656e377e72a571d6be25f5b75fe09bb44e0c0b2829642d1c4b073b8

Contents?: true

Size: 538 Bytes

Versions: 34

Compression:

Stored size: 538 Bytes

Contents

# frozen_string_literal: true

shared_examples "modifying product actions are restricted" do
  it "cannot create a new product if not an admin" do
    post spree.api_products_path, params: { product: { name: "Brand new product!" } }
    assert_unauthorized!
  end

  it "cannot update a product" do
    put spree.api_product_path(product), params: { product: { name: "I hacked your store!" } }
    assert_unauthorized!
  end

  it "cannot delete a product" do
    delete spree.api_product_path(product)
    assert_unauthorized!
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
solidus_api-2.10.5 spec/shared_examples/protect_product_actions.rb
solidus_api-2.10.3 spec/shared_examples/protect_product_actions.rb
solidus_api-2.10.2 spec/shared_examples/protect_product_actions.rb
solidus_api-2.9.6 spec/shared_examples/protect_product_actions.rb
solidus_api-2.8.6 spec/shared_examples/protect_product_actions.rb
solidus_api-2.10.1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.9.5 spec/shared_examples/protect_product_actions.rb
solidus_api-2.10.0 spec/shared_examples/protect_product_actions.rb
solidus_api-2.9.4 spec/shared_examples/protect_product_actions.rb
solidus_api-2.6.6 spec/shared_examples/protect_product_actions.rb
solidus_api-2.7.4 spec/shared_examples/protect_product_actions.rb
solidus_api-2.8.5 spec/shared_examples/protect_product_actions.rb
solidus_api-2.9.3 spec/shared_examples/protect_product_actions.rb
solidus_api-2.9.2 spec/shared_examples/protect_product_actions.rb
solidus_api-2.10.0.beta1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.7.3 spec/shared_examples/protect_product_actions.rb
solidus_api-2.6.5 spec/shared_examples/protect_product_actions.rb
solidus_api-2.9.1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.9.0 spec/shared_examples/protect_product_actions.rb
solidus_api-2.9.0.rc.1 spec/shared_examples/protect_product_actions.rb