To add a collaborator to this project you will need to use the Relish gem to add the collaborator via a terminal command. Soon you'll be able to also add collaborators here!
More about adding a collaboratorschema scaffolding
- Scenarios
-
- scaffold a json schema for a "users/index" in request spec
-
- Given
-
a file named "spec/requests/users_spec.rb" with:
require "spec_helper" describe Api::V1::UsersController, :lurker do let!(:user) do User.where(name: 'razum2um').first_or_create! end let!(:bot) do User.where(name: 'bot').first_or_create! end it "lists all the users" do get "api/v1/users?limit=1" expect(response).to be_success expect(JSON.parse(response.body).size).to eq 1 end end
- When
-
I run
bin/rspec spec/requests/users_spec.rb
- Then
- the example should pass
- Then
- a file named "lurker/api/v1/users-GET.json.yml" should exist
- Then
-
the file "lurker/api/v1/users-GET.json.yml" should contain exactly:
--- description: user listing prefix: users management requestParameters: properties: limit: description: '' type: string example: '1' required: [] responseCodes: - status: 200 successful: true description: '' responseParameters: type: array items: description: '' type: object properties: id: description: '' type: integer example: 1 name: description: '' type: string example: razum2um required: [] extensions: method: GET path_info: "/api/v1/users" path_params: action: index controller: api/v1/users query_params: limit: '1' suffix: ''
Last published over 7 years ago by razum2um.