Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
230ccc49
Commit
230ccc49
authored
7 years ago
by
Ryan Senior
Browse files
Options
Downloads
Patches
Plain Diff
Add a test for field values and sensitive visibility types
parent
a75fd042
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/metabase/api/field_test.clj
+8
-3
8 additions, 3 deletions
test/metabase/api/field_test.clj
with
8 additions
and
3 deletions
test/metabase/api/field_test.clj
+
8
−
3
View file @
230ccc49
...
...
@@ -171,6 +171,11 @@
{
:values
[]}
((
user->client
:rasta
)
:get
200
(
format
"field/%d/values"
(
id
:venues
:id
))))
;; Sensisitive fields do not have field values and should return empty
(
expect
{
:values
[]}
((
user->client
:rasta
)
:get
200
(
format
"field/%d/values"
(
id
:users
:password
))))
(
defn-
num->$
[
num-seq
]
(
mapv
(
fn
[
idx
]
(
vector
idx
(
apply
str
(
repeat
idx
\$
))))
...
...
@@ -247,10 +252,10 @@
;; Should throw when human readable values are present but not for every value
(
expect
clojure.lang.ExceptionInfo
"If remapped values are specified, they must be specified for all field values"
(
tt/with-temp*
[
Field
[{
field-id
:id
}
{
:name
"Field Test"
:base_type
:type/Integer
:special_type
:type/Category
}]]
[
((
user->client
:crowberto
)
:post
2
00
(
format
"field/%d/values"
field-id
)
{
:values
[[
1
"$"
]
[
2
"$$"
]
[
3
]
[
4
]]})
]
))
((
user->client
:crowberto
)
:post
4
00
(
format
"field/%d/values"
field-id
)
{
:values
[[
1
"$"
]
[
2
"$$"
]
[
3
]
[
4
]]})))
;; ## PUT /api/field/:id/dimension
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment