Commit 296c2626 authored by Sophie Daringer's avatar Sophie Daringer
Browse files

Create database, swagger, jbuilder files

parent 5fbc95d6
......@@ -3,7 +3,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.3'
ruby '2.6.5'
gem 'rails', '~> 6.0.1'
gem 'sassc-rails'
......
......@@ -84,6 +84,7 @@ GEM
diff-lcs (1.3)
erubi (1.9.0)
ffi (1.12.2)
ffi (1.12.2-x64-mingw32)
globalid (0.4.2)
activesupport (>= 4.2.0)
i18n (1.8.2)
......@@ -109,10 +110,14 @@ GEM
mini_portile2 (2.4.0)
minitest (5.14.0)
msgpack (1.3.3)
msgpack (1.3.3-x64-mingw32)
nio4r (2.5.2)
nokogiri (1.10.8)
mini_portile2 (~> 2.4.0)
nokogiri (1.10.8-x64-mingw32)
mini_portile2 (~> 2.4.0)
pg (1.2.2)
pg (1.2.2-x64-mingw32)
public_suffix (4.0.3)
puma (4.3.1)
nio4r (~> 2.0)
......@@ -182,6 +187,8 @@ GEM
rubyzip (2.2.0)
sassc (2.2.1)
ffi (~> 1.9)
sassc (2.2.1-x64-mingw32)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
......@@ -210,6 +217,8 @@ GEM
turbolinks-source (5.2.0)
tzinfo (1.2.6)
thread_safe (~> 0.1)
tzinfo-data (1.2019.3)
tzinfo (>= 1.0.0)
web-console (4.0.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
......@@ -234,6 +243,7 @@ GEM
PLATFORMS
ruby
x64-mingw32
DEPENDENCIES
bcrypt (~> 3.1.7)
......@@ -262,7 +272,7 @@ DEPENDENCIES
webpacker-react
RUBY VERSION
ruby 2.6.3p62
ruby 2.6.5p114
BUNDLED WITH
2.1.4
......@@ -14,3 +14,16 @@ technically, it is a rails app with some react added.
## Images Used under cc:
https://www.flickr.com/photos/zoliblog/3198088960
## Fragen
Wo sind die Tests gespeichert?
Im Verzeichnis /spec in verschiedenen Unterordner
Welche Arten von Test sind schon vorhanden?
- Controller Tests: testen die Controller
- Model Tests: testen das Model mit den zugehörigen Validations
- Request Tests: testen von der JSON Schnittstelle mit Hilfe von HTTP Requests
Welche Schritte sind notwendig um die mittels der Test definierte und Dokumentierte API zu implementieren?
Im Ordner app/view/users werden zwei jbuilder Dateien angelegt, die die JSON Schnittstelle beschreiben.
json.array! @users do |user|
json.extract! user, :id, :name, :email
end
\ No newline at end of file
json.extract! @user, :id, :name, :email
\ No newline at end of file
......@@ -10,6 +10,8 @@ development:
database: iou_development
pool: 5
timeout: 5000
username: postgres
password: admin
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
......@@ -20,6 +22,8 @@ test:
database: iou_test
pool: 5
timeout: 5000
username: postgres
password: admin
production:
......
This diff is collapsed.
---
swagger: '2.0'
info:
title: API V1
version: v1
description: This is the first version of my API
paths:
"/users.json":
get:
summary: list all the users
produces:
- abpplication/json
responses:
'200':
description: successful
schema:
type: array
items:
type: object
properties:
id:
type: integer
name:
type: string
email:
type: string
required:
- id
- name
- email
"/users/{id}.json":
get:
summary: show user
produces:
- application/json
parameters:
- name: id
in: path
type: string
required: true
responses:
'200':
description: successful
schema:
type: object
properties:
id:
type: integer
name:
type: string
email:
type: string
required:
- id
- name
- email
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment