Sha256: 2e6ba7f4e50e1f6003db9846a68de4e2feb5a042d4f4b8182d11fb0c0be3c9e8

Contents?: true

Size: 802 Bytes

Versions: 22

Compression:

Stored size: 802 Bytes

Contents

require 'shared_examples/protect_product_actions'
require 'spec_helper'

module Spree
  describe Spree::Api::ProductsController do
    render_views

    let!(:product) { create(:product) }
    let(:attributes) { [:id, :name, :description, :price, :available_on, :slug, :meta_description, :meta_keywords, :taxon_ids] }

    context "without authentication" do
      before { Spree::Api::Config[:requires_authentication] = false }

      it "retreives a list of products" do
        api_get :index
        json_response["products"].first.should have_attributes(attributes)
        json_response["count"].should == 1
        json_response["current_page"].should == 1
        json_response["pages"].should == 1
      end

      it_behaves_like "modifying product actions are restricted"
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
spree_api-2.2.14 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.2.13 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.2.12 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.2.11 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.2.10 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.2.9 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.2.8 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.2.7 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.4.0.rc2 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.4.0.rc1 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.3.4 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.2.6 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.3.3 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.3.2 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.2.5 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.3.1 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.2.4 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.2.3 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.3.0 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
spree_api-2.2.2 spec/controllers/spree/api/unauthenticated_products_controller_spec.rb