Skip to content

Commit

Permalink
tweaks to unit tests after adding :parameters attribute to Card
Browse files Browse the repository at this point in the history
  • Loading branch information
agilliland committed Jun 15, 2016
1 parent bb026bf commit 4a12782
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/metabase/api/card_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
:id $
:display "table"
:visualization_settings {}
:parameters []
:public_perms 0
:created_at $
:database_id database-id ; these should be inferred from the dataset_query
Expand All @@ -200,7 +201,12 @@

;; updating a card that doesn't exist should give a 404
(expect "Not found."
((user->client :crowberto) :put 404 "card/12345"))
((user->client :crowberto) :put 404 "card/12345" {:name "Blah"
:display "table"
:public_perms 0
:parameters []
:dataset_query {}
:visualization_settings {}}))

;; Test that we can edit a Card
(let [updated-name (random-name)]
Expand All @@ -222,7 +228,13 @@
(with-temp-card [{:keys [id]}]
(let [archived? (fn [] (:archived (Card id)))
set-archived! (fn [archived]
((user->client :rasta) :put 200 (str "card/" id) {:archived archived})
((user->client :rasta) :put 200 (str "card/" id) {:archived archived
:name "Blah"
:display "table"
:public_perms 0
:parameters []
:dataset_query {}
:visualization_settings {}})
(archived?))]
[(archived?)
(set-archived! true)
Expand Down
1 change: 1 addition & 0 deletions test/metabase/api/dashboard_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
:query_type nil
:dataset_query {}
:visualization_settings {}
:parameters []
:archived false}
:series []}]
:organization_id nil}
Expand Down
1 change: 1 addition & 0 deletions test/metabase/api/dataset_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
(ql/aggregation (ql/count))))
(assoc :type "query")
(assoc-in [:query :aggregation] {:aggregation-type "count"}))
:parameters []
:visualization_settings {}
:created_at true
:updated_at true
Expand Down
1 change: 1 addition & 0 deletions test/metabase/api/pulse_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
:public_perms common/perms-readwrite
:display "table"
:dataset_query {}
:parameters []
:visualization_settings {}))

(defn- new-pulse! [& {:keys [name cards channels]
Expand Down
1 change: 1 addition & 0 deletions test/metabase/events/activity_feed_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
:dataset_query {:database (id)
:type :query
:query {:source_table (id :categories)}}
:parameters []
:visualization_settings {})
dashcard (db/insert! DashboardCard
:card_id (:id card)
Expand Down
2 changes: 2 additions & 0 deletions test/metabase/events/revision_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
:type "query"
:query {:aggregation ["rows"]
:source_table (id :categories)}}
:parameters []
:visualization_settings {}
:creator_id (user->id :crowberto))))

Expand All @@ -43,6 +44,7 @@
:id (:id card)
:display "table"
:visualization_settings {}
:parameters []
:public_perms 2
:archived false})

Expand Down
1 change: 1 addition & 0 deletions test/metabase/test/util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
:dataset_query {}
:display :table
:name (random-name)
:parameters []
:public_perms common/perms-none
:visualization_settings {}})})

Expand Down

0 comments on commit 4a12782

Please sign in to comment.