From 28ceab5c07a3f176321c2475f2dbd2aad29cb315 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Mon, 18 Jan 2021 18:40:51 +0100 Subject: [PATCH] add test for fix in #704 --- spec/requests/provider_prefixes_spec.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/spec/requests/provider_prefixes_spec.rb b/spec/requests/provider_prefixes_spec.rb index e77528a00..86ad8bf88 100644 --- a/spec/requests/provider_prefixes_spec.rb +++ b/spec/requests/provider_prefixes_spec.rb @@ -177,6 +177,25 @@ expect(last_response.status).to eq(201) expect(json.dig("data", "id")).not_to be_nil + + sleep 2 + + get "/prefixes?state=unassigned", nil, headers + + expect(last_response.status).to eq(200) + expect(json.dig("meta", "total")).to eq(0) + + + delete "/provider-prefixes/#{provider_prefix.uid}", nil, headers + + expect(last_response.status).to eq(204) + + sleep 2 + + get "/prefixes?state=unassigned", nil, headers + + expect(last_response.status).to eq(200) + expect(json.dig("meta", "total")).to eq(1) end end