mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
66ba8e565c
Also: fix related bugs
32 lines
839 B
Ruby
32 lines
839 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'test_helper'
|
|
|
|
module OpenApi; end
|
|
|
|
class OpenApi::UsersTest < ActionDispatch::IntegrationTest
|
|
def setup
|
|
@token = OpenAPI::Client.find_by(name: 'minitest').token
|
|
end
|
|
|
|
test 'list all users' do
|
|
get '/open_api/v1/users', headers: open_api_headers(@token)
|
|
assert_response :success
|
|
end
|
|
|
|
test 'list all users with pagination' do
|
|
get '/open_api/v1/users?page=1&per_page=5', headers: open_api_headers(@token)
|
|
assert_response :success
|
|
end
|
|
|
|
test 'list all users filtering by IDs' do
|
|
get '/open_api/v1/users?user_id=[3,4,5]', headers: open_api_headers(@token)
|
|
assert_response :success
|
|
end
|
|
|
|
test 'list all users filtering by email' do
|
|
get '/open_api/v1/users?email=jean.dupond@gmail.com', headers: open_api_headers(@token)
|
|
assert_response :success
|
|
end
|
|
end
|