Sha256: f6c1813506ed0e0ae49963a59c4ced3609b37a460def3f6fb4b7a7d1787f65c7

Contents?: true

Size: 507 Bytes

Versions: 17

Compression:

Stored size: 507 Bytes

Contents

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

17 entries across 17 versions & 1 rubygems

Version Path
solidus_api-2.5.2 spec/shared_examples/protect_product_actions.rb
solidus_api-2.5.1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.5.0 spec/shared_examples/protect_product_actions.rb
solidus_api-2.5.0.rc1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.5.0.beta2 spec/shared_examples/protect_product_actions.rb
solidus_api-2.5.0.beta1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.4.2 spec/shared_examples/protect_product_actions.rb
solidus_api-2.4.1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.3.1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.4.0 spec/shared_examples/protect_product_actions.rb
solidus_api-2.4.0.rc1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.4.0.beta1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.3.0 spec/shared_examples/protect_product_actions.rb
solidus_api-2.3.0.rc3 spec/shared_examples/protect_product_actions.rb
solidus_api-2.3.0.rc2 spec/shared_examples/protect_product_actions.rb
solidus_api-2.3.0.rc1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.3.0.beta1 spec/shared_examples/protect_product_actions.rb