Combine examples to reduce factories in specs (#33841)
This commit is contained in:
parent
aff2b11394
commit
23a0d91126
7 changed files with 10 additions and 42 deletions
|
@ -40,15 +40,11 @@ RSpec.describe Api::RateLimitHeaders do
|
|||
end
|
||||
end
|
||||
|
||||
it 'applies rate limiting limit header' do
|
||||
it 'provides rate limit information in headers' do
|
||||
expect(response.headers['X-RateLimit-Limit']).to eq '100'
|
||||
end
|
||||
|
||||
it 'applies rate limiting remaining header' do
|
||||
expect(response.headers['X-RateLimit-Remaining']).to eq '80'
|
||||
end
|
||||
|
||||
it 'applies rate limiting reset header' do
|
||||
expect(response.headers['X-RateLimit-Reset']).to eq (start_time + 10.seconds).iso8601(6)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -23,11 +23,9 @@ RSpec.describe Filters::StatusesController do
|
|||
get :index, params: { filter_id: filter }
|
||||
end
|
||||
|
||||
it 'returns http success' do
|
||||
it 'returns http success and private cache control headers' do
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
|
||||
it 'returns private cache control headers' do
|
||||
expect(response.headers['Cache-Control']).to include('private, no-store')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,11 +14,9 @@ RSpec.describe RelationshipsController do
|
|||
get :show, params: { page: 2, relationship: 'followed_by' }
|
||||
end
|
||||
|
||||
it 'returns http success' do
|
||||
it 'returns http success and private cache control headers' do
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
|
||||
it 'returns private cache control headers' do
|
||||
expect(response.headers['Cache-Control']).to include('private, no-store')
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue