Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove order token authorization option from current order API documentation #4958

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion api/openapi/solidus-api.oas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ paths:
- Orders
security:
- api-key: []
- order-token: []
/countries:
get:
responses:
Expand Down
24 changes: 24 additions & 0 deletions api/spec/requests/spree/api/orders_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,30 @@ module Spree::Api
expect(current_api_user).to receive(:last_incomplete_spree_order).with(store: Spree::Store.default)
get spree.api_current_order_path(format: 'json')
end

context "when the current user is not present" do
let(:current_api_user) { nil }

before do
get spree.api_current_order_path(format: 'json'), params: { order_token: order_token }
end

context "when the spree guest token is not present" do
let(:order_token) { nil }

it "returns a 401" do
expect(response.status).to eq(401)
end
end

context "when the spree guest token is present" do
let(:order_token) { order.guest_token }

it "returns a 401" do
expect(response.status).to eq(401)
end
end
end
end

it "can view their own order" do
Expand Down