Files
sx-fc/spec/requests/api/restaurant/seat_tables_spec.rb
2017-03-27 22:09:16 +06:30

26 lines
654 B
Ruby

require 'rails_helper'
RSpec.describe 'Seat Table API', type: :request do
# initialize test data
let!(:seat_table) { create_list(:seat_table, 10) }
let(:seat_table_id) { seat_tables.first.id }
# Test suite for GET /todos
describe 'GET /api/restaurant/seat_tables' do
# make HTTP get request before each example
before { get '/api/restaurant/seat_tables' }
it 'returns Seat Tables' 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