   )
 
 (fact "actions to remoter construction"
-      (let [cap (rconstruct redis-actions {:action :deploy :target "192.168.5.31"})]
+      (let [cap (rconstruct redis-deploy {:target "192.168.5.31"})]
         cap  => (contains  {:args ["deploy" "-s" "hostname=192.168.5.31"]
                             :src  "git://github.com/narkisr/cap-demo.git"})))
 

    [celestial.model :refer (rconstruct)]
    [celestial.persistency.actions :refer (validate-action)]
    [celestial.persistency :refer (type-exists?)]
    [celestial.fixtures.data :refer (redis-actions)] 
    [celestial.fixtures.core :refer (with-m?)] 
    remote.capistrano)
  (:use midje.sweet)

(fact "action validations"
      (with-redefs [type-exists? (fn [_] true)]

        (validate-action redis-deploy)  => truthy

        (validate-action (assoc-in redis-deploy [:capistrano :args] nil)) =>
        (throws ExceptionInfo (with-m? {:args '("must be present")})) 

        (validate-action (assoc-in redis-deploy [:actions :stop :supernal :args] nil)) => truthy

        )

      (fact "missing type" 
            (validate-action (assoc redis-deploy :operates-on "foo")) =>
            (throws ExceptionInfo (with-m? {:operates-on  '("type not found, create it first")})) 
            (provided 
              (type-exists? anything)  => false
