Sha256: 7bba9f9c309fea1c564ecca63264f622a39b9b76337335254a265e79ff5c1add

Contents?: true

Size: 476 Bytes

Versions: 26

Compression:

Stored size: 476 Bytes

Contents

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

  it "cannot update a product" do
    api_put :update, id: product.to_param, product: { name: "I hacked your store!" }
    assert_unauthorized!
  end

  it "cannot delete a product" do
    api_delete :destroy, id: product.to_param
    assert_unauthorized!
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
solidus_api-2.2.2 spec/shared_examples/protect_product_actions.rb
solidus_api-2.1.1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.0.3 spec/shared_examples/protect_product_actions.rb
solidus_api-1.4.2 spec/shared_examples/protect_product_actions.rb
solidus_api-1.3.2 spec/shared_examples/protect_product_actions.rb
solidus_api-2.0.2 spec/shared_examples/protect_product_actions.rb
solidus_api-1.4.1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.2.1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.2.0 spec/shared_examples/protect_product_actions.rb
solidus_api-2.2.0.rc1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.2.0.beta1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.1.0 spec/shared_examples/protect_product_actions.rb
solidus_api-2.1.0.rc1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.0.1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.1.0.beta1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.0.0 spec/shared_examples/protect_product_actions.rb
solidus_api-1.4.0 spec/shared_examples/protect_product_actions.rb
solidus_api-2.0.0.rc1 spec/shared_examples/protect_product_actions.rb
solidus_api-1.4.0.rc1 spec/shared_examples/protect_product_actions.rb
solidus_api-2.0.0.beta1 spec/shared_examples/protect_product_actions.rb