Skip to content
Snippets Groups Projects
Commit 3efaa4e2 authored by Cam Saul's avatar Cam Saul
Browse files

fix occasional test failure due to ambiguous ordering in test for GET /api/meta/db

parent b607a80e
No related branches found
No related tags found
No related merge requests found
......@@ -108,36 +108,36 @@
;; Test that we can get all the DBs for an Org, ordered by name
(let [db-name (str "A" (random-name))] ; make sure this name comes before "Test Database"
(expect-eval-actual-first
(filter identity
[(datasets/when-testing-dataset :generic-sql
(match-$ (sel :one Database :name db-name)
{:created_at $
:engine "postgres"
:id $
:details {:host "localhost", :port 5432, :dbname "fakedb", :user "cam"}
:updated_at $
:name $
:organization_id nil
:description nil}))
(datasets/when-testing-dataset :mongo
(match-$ @mongo-test-data/mongo-test-db
{:created_at $
:engine "mongo"
:id $
:details $
:updated_at $
:name "Test Database"
:organization_id nil
:description nil}))
(match-$ (db)
{:created_at $
:engine "h2"
:id $
:details $
:updated_at $
:name "Test Database"
:organization_id nil
:description nil})])
(set (filter identity
[(datasets/when-testing-dataset :generic-sql
(match-$ (sel :one Database :name db-name)
{:created_at $
:engine "postgres"
:id $
:details {:host "localhost", :port 5432, :dbname "fakedb", :user "cam"}
:updated_at $
:name $
:organization_id nil
:description nil}))
(datasets/when-testing-dataset :mongo
(match-$ @mongo-test-data/mongo-test-db
{:created_at $
:engine "mongo"
:id $
:details $
:updated_at $
:name "Test Database"
:organization_id nil
:description nil}))
(match-$ (db)
{:created_at $
:engine "h2"
:id $
:details $
:updated_at $
:name "Test Database"
:organization_id nil
:description nil})]))
(do
;; Delete all the randomly created Databases we've made so far
(cascade-delete Database :id [not-in (set (filter identity
......@@ -148,7 +148,7 @@
;; Add an extra DB so we have something to fetch besides the Test DB
(create-db db-name)
;; Now hit the endpoint
((user->client :rasta) :get 200 "meta/db"))))
(set ((user->client :rasta) :get 200 "meta/db")))))
;; # DB TABLES ENDPOINTS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment