Sha256: 3d48834aeee4a4c4e95401397dc8bc9285414c5f34bc3fdb7c801eb84d8e3264
Contents?: true
Size: 832 Bytes
Versions: 17
Compression:
Stored size: 832 Bytes
Contents
require 'shared_examples/protect_product_actions' require 'spec_helper' module Spree describe Spree::Api::ProductsController, type: :request do 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 get spree.api_products_path 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
17 entries across 17 versions & 1 rubygems