Sha256: 90b41fab001d8a0a8eb0df44bd246ff0a8996c86aba6b6f11b2d2a6e3f764d05

Contents?: true

Size: 495 Bytes

Versions: 138

Compression:

Stored size: 495 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

138 entries across 138 versions & 4 rubygems

Version Path
solidus_api-1.2.3 spec/shared_examples/protect_product_actions.rb
solidus_api-1.1.4 spec/shared_examples/protect_product_actions.rb
solidus_api-1.0.7 spec/shared_examples/protect_product_actions.rb
spree_api-3.1.5 spec/shared_examples/protect_product_actions.rb
spree_api-3.1.4 spec/shared_examples/protect_product_actions.rb
spree_api-3.1.3 spec/shared_examples/protect_product_actions.rb
spree_api-3.1.2 spec/shared_examples/protect_product_actions.rb
spree_api-3.0.10 spec/shared_examples/protect_product_actions.rb
spree_api-3.1.1 spec/shared_examples/protect_product_actions.rb
refinerycms-api-1.0.0.beta spec/shared_examples/protect_product_actions.rb
spree_api-3.1.0 spec/shared_examples/protect_product_actions.rb
spree_api-3.1.0.rc4 spec/shared_examples/protect_product_actions.rb
spree_api-3.0.9 spec/shared_examples/protect_product_actions.rb
spree_api-3.1.0.rc3 spec/shared_examples/protect_product_actions.rb
spree_api-3.1.0.rc2 spec/shared_examples/protect_product_actions.rb
spree_api-3.1.0.rc1 spec/shared_examples/protect_product_actions.rb
solidus_api-1.0.6 spec/shared_examples/protect_product_actions.rb
spree_api-3.0.8 spec/shared_examples/protect_product_actions.rb
solidus_api-1.2.2 spec/shared_examples/protect_product_actions.rb
spree_api-3.0.7 spec/shared_examples/protect_product_actions.rb