            (d/refs-match? items
                           (search/find-refs
                             :collection
-                            {"science-keywords" {:0 {science-keyword value}}}))
+                            {:science-keywords {:0 {science-keyword value}}}))
            :category "Cat1" [coll1]
            :topic "Topic1" [coll1]
            :term "Term1" [coll1]

      (is (d/refs-match? [coll2]
                         (search/find-refs
                           :collection
                           {"science-keywords" {:0 {:category "Hurricane"
                                                    :topic "Popular"
                                                    :term "Extreme"}}}))))

    (testing "search by science keywords, multiple."
      (is (d/refs-match? [coll2 coll6]
                         (search/find-refs
                           :collection
                           {"science-keywords" {:0 {:category "Hurricane"
                                                    :topic "Popular"}
                                                :1 {:term "Extreme"}}}))))

    (testing "search by science keywords, ignore case"
      (are [items science-keyword value ignore-case]
           (d/refs-match? items
                          (search/find-refs
                            :collection
                            {"science-keywords" {:0 {science-keyword value}}
                             "options[science-keywords][ignore-case]" ignore-case}))

           [coll1] :category "Cat1" false


(deftest search-science-keywords-error-scenarios
  (testing "search by invalid format."
    (let [{:keys [status errors]} (search/find-refs :collection {:science-keywords {:0 {:and "true"}}})]
      (is (= 400 status))
      (is (re-find #"parameter \[and\] is not a valid science keyword search term." (first errors))))))
