require 'rails_helper' RSpec.describe 'Zone API', type: :request do # initialize test data let!(:zone) { create_list(:zone, 10) } let(:zone_id) { zones.first.id } # Test suite for GET /todos describe 'GET /api/restaurant/zones' do # make HTTP get request before each example before { get '/api/restaurant/zones' } it 'returns zones' do # Note `json` is a custom helper to parse JSON responses expect(json).not_to be_empty expect(json.size).to eq(10) end it 'returns status code 200' do expect(response).to have_http_status(200) end end end