Skip to content

Commit

Permalink
chore: ruby lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gratcliff committed May 30, 2024
1 parent 9ad41d5 commit ba5f0bd
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions packages/ruby/spec/readme/metrics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,38 +190,38 @@ def app

post '/api/foo'

expect(last_response.status).to eq 200
expect(last_response.status).to have_http_status(200)
end

it 'returns a response when the Payload raises an error' do
allow(Readme::Payload).to receive(:new).and_raise

post '/api/foo'

expect(last_response.status).to eq 200
expect(last_response.status).to have_http_status(200)
end

it 'returns a response when the Har::Serializer raises an error' do
allow(Readme::Har::Serializer).to receive(:new).and_raise

post '/api/foo'

expect(last_response.status).to eq 200
expect(last_response.status).to have_http_status(200)
end

it 'returns a response when the RequestQueue raises an error' do
allow_any_instance_of(Readme::RequestQueue).to receive(:push).and_raise

post '/api/foo'

expect(last_response.status).to eq 200
expect(last_response.status).to have_http_status(200)
end

it "doesn't send a request to Readme with an OPTIONS request" do
options 'api/foo'

expect(WebMock).not_to have_requested(:post, Readme::Metrics::ENDPOINT)
expect(last_response.status).to eq 200
expect(last_response.status).to have_http_status(200)
end

def app
Expand All @@ -244,7 +244,7 @@ def app
post '/api/foo', '[BODY]'

expect(WebMock).not_to have_requested(:post, Readme::Metrics::ENDPOINT)
expect(last_response.status).to eq 200
expect(last_response.status).to have_http_status(200)
end

it 'is not submitted to Readme with allow-only configured' do
Expand All @@ -256,7 +256,7 @@ def app
post '/api/foo', '[BODY]'

expect(WebMock).not_to have_requested(:post, Readme::Metrics::ENDPOINT)
expect(last_response.status).to eq 200
expect(last_response.status).to have_http_status(200)
end

it 'is submitted to Readme with no filter configured' do
Expand All @@ -268,7 +268,7 @@ def app
post '/api/foo', '[BODY]'

expect(WebMock).to have_requested(:post, Readme::Metrics::ENDPOINT)
expect(last_response.status).to eq 200
expect(last_response.status).to have_http_status(200)
end

it 'is submitted to Readme when the body is empty with allow-only configured' do
Expand All @@ -279,7 +279,7 @@ def app
get '/api/foo'

expect(WebMock).to have_requested(:post, Readme::Metrics::ENDPOINT)
expect(last_response.status).to eq 200
expect(last_response.status).to have_http_status(200)
end

it 'is submitted to Readme when the body is empty with reject_params configured' do
Expand All @@ -290,7 +290,7 @@ def app
get '/api/foo'

expect(WebMock).to have_requested(:post, Readme::Metrics::ENDPOINT)
expect(last_response.status).to eq 200
expect(last_response.status).to have_http_status(200)
end
end

Expand All @@ -308,7 +308,7 @@ def app
post '/api/foo'

expect(WebMock).to have_requested(:post, Readme::Metrics::ENDPOINT)
expect(last_response.status).to eq 200
expect(last_response.status).to have_http_status(200)
end

it 'is not submitted to Readme with an allow-only configured' do
Expand All @@ -319,7 +319,7 @@ def app
post '/api/foo'

expect(WebMock).not_to have_requested(:post, Readme::Metrics::ENDPOINT)
expect(last_response.status).to eq 200
expect(last_response.status).to have_http_status(200)
end

it 'is not submitted to Readme with reject_params configured' do
Expand All @@ -330,7 +330,7 @@ def app
post '/api/foo'

expect(WebMock).not_to have_requested(:post, Readme::Metrics::ENDPOINT)
expect(last_response.status).to eq 200
expect(last_response.status).to have_http_status(200)
end

it 'is submitted to Readme with reject_params configured for empty bodies' do
Expand All @@ -341,7 +341,7 @@ def app
post '/api/foo'

expect(WebMock).to have_requested(:post, Readme::Metrics::ENDPOINT)
expect(last_response.status).to eq 204
expect(last_response.status).to have_http_status(204)
end

it 'is submitted to Readme with allow_only configured for empty bodies' do
Expand All @@ -352,7 +352,7 @@ def app
post '/api/foo'

expect(WebMock).to have_requested(:post, Readme::Metrics::ENDPOINT)
expect(last_response.status).to eq 204
expect(last_response.status).to have_http_status(204)
end
end

Expand Down

0 comments on commit ba5f0bd

Please sign in to comment.