choco14t / laravel-realworld Goto Github PK
View Code? Open in Web Editor NEWLaravelで作成したRealWorldのAPIです。
Home Page: https://github.com/gothinkster/realworld
Laravelで作成したRealWorldのAPIです。
Home Page: https://github.com/gothinkster/realworld
Run test in local succeed.
But in Scrutinizer fail.
There were 3 failures:
1) Tests\Feature\GetArticleTest::testFilterByTag
Expected status code 200 but received 500.
Failed asserting that false is true.
/home/scrutinizer/build/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:185
/home/scrutinizer/build/tests/Feature/GetArticleTest.php:23
2) Tests\Feature\GetArticleTest::testFilterByAuthor
Expected status code 200 but received 500.
Failed asserting that false is true.
/home/scrutinizer/build/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:185
/home/scrutinizer/build/tests/Feature/GetArticleTest.php:34
3) Tests\Feature\GetArticleTest::testFilterByFavorited
Expected status code 200 but received 500.
Failed asserting that false is true.
/home/scrutinizer/build/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:185
/home/scrutinizer/build/tests/Feature/GetArticleTest.php:45
FAILURES!
Tests: 5, Assertions: 5, Failures: 3.
Now, /api/articles
return incorrect response.
expected:
{
"articles":[{
"slug": "how-to-train-your-dragon",
"title": "How to train your dragon",
"description": "Ever wonder how?",
"body": "It takes a Jacobian",
"tagList": ["dragons", "training"],
"createdAt": "2016-02-18T03:22:56.637Z",
"updatedAt": "2016-02-18T03:48:35.824Z",
"favorited": false,
"favoritesCount": 0,
"author": {
"username": "jake",
"bio": "I work at statefarm",
"image": "https://i.stack.imgur.com/xHWG8.jpg",
"following": false
}
}],
"articlesCount": 1
}
actual:
{
"articles": [
{
"article": {
"slug": "accusamus-eaque-nostrum-quasi-quibusdam-facere-sed-odit",
"title": "Accusamus eaque nostrum quasi quibusdam facere sed odit.",
"description": "Sint nobis ut repellat similique nihil tempore vero deleniti tempora omnis omnis officiis.",
"body": "Iusto velit qui nulla fuga ut veniam. Fugit dolores voluptas voluptatibus. Aut quia ea officiis expedita. Harum et amet voluptatem quia earum sunt temporibus.",
"tagList": [],
"createdAt": "2020-03-12T10:18:57+00:00",
"updatedAt": "2020-03-12T10:18:57+00:00",
"favorited": false,
"favoritesCount": 0,
"author": {
"username": "reynolds.rozella",
"bio": "Nulla modi eius praesentium accusamus. Consequatur porro repudiandae ad esse. Consectetur modi eos totam officiis voluptatem quasi dolores. Animi culpa et quia sit eaque.",
"image": "https://lorempixel.com/120/120/?78485",
"following": false
}
}
}
],
"articlesCount": 1
}
Now, POST /api/users
, POST /api/users/login
return incorrect response.
expected:
{
"user": {
"email": "",
"token": "",
"username": "",
"bio": "",
"image": null
}
}
actual:
{
"user": {
"email": "",
"password": "",
"token": ""
}
}
https://github.com/gothinkster/realworld/blob/master/api/README.md#create-article
https://github.com/gothinkster/realworld/blob/master/api/README.md#feed-articles
GET /api/articles/feed
Can also take
limit
andoffset
query parameters like List ArticlesAuthentication required, will return multiple articles created by followed users, ordered by most recent first.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.