Skip to content
Snippets Groups Projects
Commit 29bd2d1b authored by Allen Gilliland's avatar Allen Gilliland
Browse files

add in a couple quick authentication tests on /api/meta/table endpoints.

parent 8d094f5b
Branches
Tags
No related merge requests found
......@@ -3,12 +3,22 @@
(:require [expectations :refer :all]
[metabase.db :refer :all]
[metabase.http-client :as http]
[metabase.middleware.auth :as auth]
(metabase.models [field :refer [Field]]
[foreign-key :refer [ForeignKey]]
[table :refer [Table]])
[metabase.test-data :refer :all]
[metabase.test.util :refer [match-$ expect-eval-actual-first]]))
;; ## /api/org/* AUTHENTICATION Tests
;; We assume that all endpoints for a given context are enforced by the same middleware, so we don't run the same
;; authentication test on every single individual endpoint
(expect (get auth/response-unauthentic :body) (http/client :get 401 "meta/table"))
(expect (get auth/response-unauthentic :body) (http/client :get 401 (format "meta/table/%d" (table->id :users))))
;; ## GET /api/meta/table?org
;; These should come back in alphabetical order and include relevant metadata
(expect [{:description nil, :entity_type nil, :name "CATEGORIES", :rows 75, :entity_name nil, :active true, :id (table->id :categories), :db_id @db-id}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment