Inline hashes in tests

This commit is contained in:
Matt-Yorkley
2018-10-26 21:34:27 +01:00
parent 29492d61f9
commit b826beb0d7
2 changed files with 14 additions and 18 deletions

View File

@@ -127,6 +127,13 @@ module Api
it 'returns pagination data when query params contain :per_page]' do
get :index, per_page: 15, page: 1
pagination_data = {
'results' => 2,
'pages' => 1,
'page' => 1,
'per_page' => 15
}
expect(json_response['pagination']).to eq pagination_data
end
end
@@ -147,14 +154,5 @@ module Api
:distributor_name, :special_instructions, :payment_capture_path
]
end
def pagination_data
{
'results' => 2,
'pages' => 1,
'page' => 1,
'per_page' => 15
}
end
end
end

View File

@@ -22,16 +22,14 @@ describe SearchOrders do
let(:service) { SearchOrders.new(params, enterprise_user) }
it 'returns pagination data' do
pagination_data = {
results: 3,
pages: 1,
page: 1,
per_page: 15
}
expect(service.pagination_data).to eq pagination_data
end
end
def pagination_data
{
results: 3,
pages: 1,
page: 1,
per_page: 15
}
end
end