update postgresjson

This commit is contained in:
2019-08-27 12:33:32 +02:00
parent 67665350eb
commit ff76bd55ef
29 changed files with 139 additions and 119 deletions

View File

@@ -21,7 +21,7 @@ class FollowTest {
@Language("JSON")
private val followJson: String = """{
"id":"bae81585-d985-4d7a-9b58-3a13e911688a",
"citizen":{
"created_by":{
"id":"4a87ad24-187a-46a8-97ab-00b30a24e561",
"name":{
"first_name":"Jaque",
@@ -76,7 +76,7 @@ class FollowTest {
createdBy = citizen
)
val follow = Follow(
citizen = citizen,
createdBy = citizen,
target = article
)
follow.serialize().contains("""Hello world!""") shouldBe true

View File

@@ -36,7 +36,7 @@ Feature: Auth routes
When I send a POST request to "/login" with body:
"""
{
"name": "username1",
"name": "username-1",
"password": "azerty"
}
"""

View File

@@ -50,7 +50,7 @@ begin
select "comment"(
reference => 'article'::regclass,
target_id => (created_article->>'id')::uuid,
citizen_id => _citizen_id,
created_by_id => _citizen_id,
content => 'Ho my god !'::text
) into _comment_id;
assert (select count(*) = 1 from "comment"), 'comment must be inserted';
@@ -86,7 +86,7 @@ begin
select "comment"(
reference => 'article'::regclass,
target_id => (created_article->>'id')::uuid,
citizen_id => _citizen_id,
created_by_id => _citizen_id,
content => 'God not exist'::text,
parent_id => _comment_id::uuid
) into _comment_id_response;
@@ -94,7 +94,7 @@ begin
select "comment"(
reference => 'article'::regclass,
target_id => (created_article->>'id')::uuid,
citizen_id => _citizen_id,
created_by_id => _citizen_id,
content => 'are you really sure ?'::text,
parent_id => _comment_id_response::uuid
) into _comment_id_response2;

View File

@@ -41,7 +41,7 @@ begin
perform vote(
reference => 'article'::regclass,
_target_id => (created_article->>'id')::uuid,
_citizen_id => _citizen_id,
_created_by_id => _citizen_id,
_note => 1
);
assert (select count(*) = 1 from vote_for_article), 'vote must be inserted';
@@ -50,7 +50,7 @@ begin
perform vote(
reference => 'article'::regclass,
_target_id => (created_article->>'id')::uuid,
_citizen_id => _citizen_id,
_created_by_id => _citizen_id,
_note => -1
);
assert (select count(*) = 1 from vote_for_article), 'vote must be inserted';
@@ -60,7 +60,7 @@ begin
perform vote(
reference => 'article'::regclass,
_target_id => (created_article->>'id')::uuid,
_citizen_id => _citizen_id,
_created_by_id => _citizen_id,
_note => -10
);
assert false, 'vote must be throw exception if note is not -1, 0 or 1';