Skip to content

Commit

Permalink
Try to remove flakiness.
Browse files Browse the repository at this point in the history
  • Loading branch information
svogt0511 committed Mar 3, 2023
1 parent ed51c88 commit 78c7897
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions spec/requests/provider_prefixes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
require "rails_helper"

describe ProviderPrefixesController, type: :request, elasticsearch: true do
let(:consortium) { create(:provider, role_name: "ROLE_CONSORTIUM") }
let(:provider) do
let!(:consortium) { create(:provider, role_name: "ROLE_CONSORTIUM") }
let!(:provider) do
create(
:provider,
consortium: consortium,
role_name: "ROLE_CONSORTIUM_ORGANIZATION",
password_input: "12345",
)
end
let(:prefix) { create(:prefix) }
let!(:prefix) { create(:prefix) }
let!(:provider_prefixes) do
[
create(:provider_prefix, provider: provider, prefix: @prefix_pool[0]),
Expand All @@ -26,9 +26,9 @@
create(:provider_prefix, prefix: @prefix_pool[4])
]
end
let(:provider_prefix) { create(:provider_prefix, prefix: @prefix_pool[5]) }
let(:bearer) { User.generate_token(role_id: "staff_admin") }
let(:headers) do
let!(:provider_prefix) { create(:provider_prefix, prefix: @prefix_pool[5]) }
let!(:bearer) { User.generate_token(role_id: "staff_admin") }
let!(:headers) do
{
"HTTP_ACCEPT" => "application/vnd.api+json",
"HTTP_AUTHORIZATION" => "Bearer " + bearer,
Expand Down Expand Up @@ -111,7 +111,7 @@
get "/provider-prefixes?query=10.508", nil, headers

expect(last_response.status).to eq(200)
expect(json["data"].size).to eq(5)
expect(json["data"].size).to eq(6)
end
end

Expand All @@ -120,7 +120,7 @@
get "/provider-prefixes", nil, headers

expect(last_response.status).to eq(200)
expect(json["data"].size).to eq(5)
expect(json["data"].size).to eq(6)
end

it "returns correct paging links" do
Expand Down Expand Up @@ -200,7 +200,7 @@
get "/prefixes?state=unassigned", nil, headers

expect(last_response.status).to eq(200)
expect(json.dig("meta", "total")).to eq(@prefix_pool.length - 5)
expect(json.dig("meta", "total")).to eq(@prefix_pool.length - 6)


delete "/provider-prefixes/#{provider_prefix.uid}", nil, headers
Expand Down

0 comments on commit 78c7897

Please sign in to comment.