Load all shops that a user is associated with as a customer

Regardless of the presence of an order
This commit is contained in:
Rob Harrington
2018-06-22 15:34:17 +10:00
parent 5e6291bce3
commit ddb9ae1140
4 changed files with 20 additions and 2 deletions

View File

@@ -23,6 +23,18 @@ module Api
expect(json_response.length).to eq 1
expect(json_response.first[:id]).to eq customer1.id
end
context "when the accounts distributor id has been set" do
before do
Spree::Config.set(accounts_distributor_id: customer1.enterprise.id)
end
it "ignores the customer for that enterprise (if it exists)" do
spree_get :index
expect(response.status).to eq 200
expect(json_response.length).to eq 0
end
end
end
describe "#update" do