Sha256: 29728d467b8c874e7ee90fc3970d9a537e1089a5db5048d970a40c1cca7bb341
Contents?: true
Size: 839 Bytes
Versions: 26
Compression:
Stored size: 839 Bytes
Contents
require 'shared_examples/protect_product_actions' require 'spec_helper' module Spree describe Spree::Api::ProductsController, type: :controller 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 "retrieves a list of products" do api_get :index expect(json_response["products"].first).to have_attributes(attributes) expect(json_response["count"]).to eq(1) expect(json_response["current_page"]).to eq(1) expect(json_response["pages"]).to eq(1) end it_behaves_like "modifying product actions are restricted" end end end
Version data entries
26 entries across 26 versions & 1 rubygems