From 8c847a682109e8305ff1ac14cd493255884d8675 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Tue, 14 Mar 2023 20:19:13 -0600 Subject: AƱade specs faltantes de CompaniesController MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/support/shared_examples/requests/get_index_request.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 spec/support/shared_examples/requests/get_index_request.rb (limited to 'spec/support/shared_examples/requests/get_index_request.rb') diff --git a/spec/support/shared_examples/requests/get_index_request.rb b/spec/support/shared_examples/requests/get_index_request.rb new file mode 100644 index 0000000..2875b28 --- /dev/null +++ b/spec/support/shared_examples/requests/get_index_request.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +RSpec.shared_examples 'a GET index request' do + it 'returns a 200 http status and the requested resources' do + get(route, headers:) + expect(response).to have_http_status(200) + resources = JSON.parse(response.body) + expect(resources['data'].length).to eq(pagination_size) + end +end \ No newline at end of file -- cgit v1.2.3