Skip to content

Commit

Permalink
spec: add deletion to db specs
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfaust committed Apr 10, 2019
1 parent 7399cd5 commit d4860a4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions db_spec/pg/repository/query_spec.cr
Expand Up @@ -174,4 +174,10 @@ describe "Repository(Postgres)#query" do
end
end
end

describe "#delete" do
it do
repo.query(post.delete.returning(:id)).first.id!.should eq post.id
end
end
end
7 changes: 7 additions & 0 deletions db_spec/sqlite3/repository/query_spec.cr
Expand Up @@ -161,4 +161,11 @@ describe "Repository(Postgres)#query" do
end
end
end

describe "#delete" do
it do
cursor = repo.exec(post.delete.returning(:id))
cursor.rows_affected.should eq 1
end
end
end

0 comments on commit d4860a4

Please sign in to comment.