Files
openfoodnetwork/spec/requests/api/routes_spec.rb
2026-03-11 14:52:11 +11:00

18 lines
543 B
Ruby

# frozen_string_literal: true
# test a single endpoint to make sure the redirects are working as intended.
RSpec.describe 'Orders Cycles endpoint' do
let(:distributor) { create(:distributor_enterprise) }
let(:order_cycle) { create(:order_cycle, distributors: [distributor]) }
context "requesting a specific API version" do
let(:path) { "/api/v0/order_cycles/#{order_cycle.id}/products?distributor=#{distributor.id}" }
it "does not redirect" do
get path
expect(response).to have_http_status(:ok)
end
end
end