Skip to content

Commit

Permalink
Rename reset items function for reusability
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenceisla committed Jun 15, 2022
1 parent 1fc7711 commit c17b954
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions test/spec/Feature/Query/DeleteSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ spec =
, { "id": 3, "name": "item-3" }
]|]

request methodPost "/rpc/reset_limited_items"
request methodPost "/rpc/reset_items_tables"
[("Prefer", "tx=commit")]
[json| {"tbl_name": "limited_delete_items"} |]
`shouldRespondWith` ""
Expand Down Expand Up @@ -175,7 +175,7 @@ spec =
, { "id": 3, "name": "item-3" }
]|]

request methodPost "/rpc/reset_limited_items"
request methodPost "/rpc/reset_items_tables"
[("Prefer", "tx=commit")]
[json| {"tbl_name": "limited_delete_items"} |]
`shouldRespondWith` ""
Expand Down Expand Up @@ -233,7 +233,7 @@ spec =
, { "id": 3, "name": "item-3" }
]|]

request methodPost "/rpc/reset_limited_items"
request methodPost "/rpc/reset_items_tables"
[("Prefer", "tx=commit")]
[json| {"tbl_name": "limited_delete_items_view"} |]
`shouldRespondWith` ""
Expand Down Expand Up @@ -265,7 +265,7 @@ spec =
, { "id": 3, "name": "item-3" }
]|]

request methodPost "/rpc/reset_limited_items"
request methodPost "/rpc/reset_items_tables"
[("Prefer", "tx=commit")]
[json| {"tbl_name": "limited_delete_items_cpk_view"} |]
`shouldRespondWith` ""
Expand Down Expand Up @@ -297,7 +297,7 @@ spec =
, { "id": 3, "name": "item-3" }
]|]

request methodPost "/rpc/reset_limited_items"
request methodPost "/rpc/reset_items_tables"
[("Prefer", "tx=commit")]
[json| {"tbl_name": "limited_delete_items_no_pk"} |]
`shouldRespondWith` ""
Expand Down
12 changes: 6 additions & 6 deletions test/spec/Feature/Query/UpdateSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ spec = do
, { "id": 3, "name": "item-3" }
]|]

request methodPost "/rpc/reset_limited_items"
request methodPost "/rpc/reset_items_tables"
[("Prefer", "tx=commit")]
[json| {"tbl_name": "limited_update_items"} |]
`shouldRespondWith` ""
Expand Down Expand Up @@ -460,7 +460,7 @@ spec = do
, { "id": 3, "name": "updated-item" }
]|]

request methodPost "/rpc/reset_limited_items"
request methodPost "/rpc/reset_items_tables"
[("Prefer", "tx=commit")]
[json| {"tbl_name": "limited_update_items"} |]
`shouldRespondWith` ""
Expand Down Expand Up @@ -493,7 +493,7 @@ spec = do
, { "id": 3, "name": "item-3" }
]|]

request methodPost "/rpc/reset_limited_items"
request methodPost "/rpc/reset_items_tables"
[("Prefer", "tx=commit")]
[json| {"tbl_name": "limited_update_items"} |]
`shouldRespondWith` ""
Expand Down Expand Up @@ -552,7 +552,7 @@ spec = do
, { "id": 3, "name": "item-3" }
]|]

request methodPost "/rpc/reset_limited_items"
request methodPost "/rpc/reset_items_tables"
[("Prefer", "tx=commit")]
[json| {"tbl_name": "limited_update_items_view"} |]
`shouldRespondWith` ""
Expand Down Expand Up @@ -585,7 +585,7 @@ spec = do
, { "id": 3, "name": "item-3" }
]|]

request methodPost "/rpc/reset_limited_items"
request methodPost "/rpc/reset_items_tables"
[("Prefer", "tx=commit")]
[json| {"tbl_name": "limited_update_items_cpk_view"} |]
`shouldRespondWith` ""
Expand Down Expand Up @@ -619,7 +619,7 @@ spec = do
, { "id": 3, "name": "item-3" }
]|]

request methodPost "/rpc/reset_limited_items"
request methodPost "/rpc/reset_items_tables"
[("Prefer", "tx=commit")]
[json| {"tbl_name": "limited_update_items_no_pk"} |]
`shouldRespondWith` ""
Expand Down
2 changes: 1 addition & 1 deletion test/spec/fixtures/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2528,7 +2528,7 @@ select *, 'static'::text as static from limited_delete_items;
create view limited_delete_items_cpk_view as
select * from limited_delete_items_cpk;

create function reset_limited_items(tbl_name text default '') returns void as $_$ begin
create function reset_items_tables(tbl_name text default '') returns void as $_$ begin
execute format(
$$
delete from %I;
Expand Down

0 comments on commit c17b954

Please sign in to comment.