mirror of
https://github.com/discourse/discourse.git
synced 2024-12-18 20:35:58 +08:00
493d437e79
* Remove outdated option
04078317ba
* Use the non-globally exposed RSpec syntax
https://github.com/rspec/rspec-core/pull/2803
* Use the non-globally exposed RSpec syntax, cont
https://github.com/rspec/rspec-core/pull/2803
* Comply to strict predicate matchers
See:
- https://github.com/rspec/rspec-expectations/pull/1195
- https://github.com/rspec/rspec-expectations/pull/1196
- https://github.com/rspec/rspec-expectations/pull/1277
37 lines
939 B
Ruby
37 lines
939 B
Ruby
# frozen_string_literal: true
|
|
require 'swagger_helper'
|
|
|
|
RSpec.describe 'user_badges' do
|
|
|
|
let(:admin) { Fabricate(:admin) }
|
|
|
|
before do
|
|
Jobs.run_immediately!
|
|
sign_in(admin)
|
|
end
|
|
|
|
path '/user-badges/{username}.json' do
|
|
|
|
get 'List badges for a user' do
|
|
tags 'Badges', 'Users'
|
|
operationId 'listUserBadges'
|
|
consumes 'application/json'
|
|
expected_request_schema = nil
|
|
parameter name: :username, in: :path, schema: { type: :string }
|
|
|
|
produces 'application/json'
|
|
response '200', 'success response' do
|
|
expected_response_schema = load_spec_schema('user_badges_response')
|
|
schema expected_response_schema
|
|
|
|
let(:username) { admin.username }
|
|
|
|
it_behaves_like "a JSON endpoint", 200 do
|
|
let(:expected_response_schema) { expected_response_schema }
|
|
let(:expected_request_schema) { expected_request_schema }
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|