Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Added missing ability for displaying Store(s) information

Damian Legawiecd4e2316984b3
diff --git a/api/spec/controllers/spree/api/v1/stores_controller_spec.rb b/api/spec/controllers/spree/api/v1/stores_controller_spec.rb
index 079af69b18..4f3cbb7ec6 100644
--- a/api/spec/controllers/spree/api/v1/stores_controller_spec.rb
+++ b/api/spec/controllers/spree/api/v1/stores_controller_spec.rb
@@ -129,14 +129,14 @@ module Spree
end
context 'as an user' do
- it 'I cannot list all the stores' do
+ it 'I can list all the stores' do
api_get :index
- expect(response.status).to eq(401)
+ expect(response.status).to eq(200)
end
- it 'I cannot get the store details' do
+ it 'I can get the store details' do
api_get :show, id: store.id
- expect(response.status).to eq(401)
+ expect(response.status).to eq(200)
end
it 'I cannot create a new store' do
diff --git a/core/app/models/spree/ability.rb b/core/app/models/spree/ability.rb
index a0d8deefee..dccc5ed85d 100644
--- a/core/app/models/spree/ability.rb
+++ b/core/app/models/spree/ability.rb
@@ -50,6 +50,7 @@ module Spree
can :create, Spree.user_class
can [:show, :update, :destroy], Spree.user_class, id: user.id
can :read, State
+ can :read, Store
can :read, Taxon
can :read, Taxonomy
can :read, Variant