This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//top of steps file or in seperate factory file | |
require 'factory_girl' | |
Factory.define :user do |u| | |
u.login 'the_login' | |
u.email '[email protected]' | |
u.password 'password' | |
u.password_confirmation 'password' | |
# u.activated_at 'active' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Updater | |
def self.update_total_points(employee) | |
employee.total_points = employee.rocket_actions.sum(:points) | |
gateway.persist_employee_total(employee) | |
end | |
def gateway | |
if defined? Rails | |
rails gateway |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<shipping> | |
<date>19/12/2013</date> | |
<due_date>19/12/2013</due_date> | |
<loaded_at>10/10/2050</loaded_at> | |
<license_plate>00-AA-11</license_plate> | |
<client> | |
<name>Joao</name> | |
<code>Jony123</code> | |
<email>[email protected]</email> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn save! | |
"Persists an account" | |
[account] | |
(common/gateway-call :account-gateway :save! account)) | |
(defn find-by-id | |
"Find account by given id" | |
[id] | |
(common/gateway-call :account-gateway :find-by-id id)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn gateway-fn | |
"Retrieves a function given it's full name" | |
[gateway access method] | |
{:post [(not (nil? %))]} | |
(let [sym (symbol (str "project-namespace." (name gateway) "." (name access) "/" (name method)))] | |
(resolve sym))) | |
(defn gateway-call | |
"Dispatches to a function on the given provider" | |
[access method & args] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn save! | |
"Persists an account" | |
[account] | |
(-> (common/db) | |
(mc/save-and-return "accounts" account))) | |
(defn find-by-id | |
"Find account by given query" | |
[id] | |
(-> (common/db) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------------------------------- | |
Language files blank comment code | |
------------------------------------------------------------------------------- | |
Clojure Common 84 682 6 4425 | |
Clojure 1 3 0 13 | |
ClojureScript 1 5 0 10 | |
------------------------------------------------------------------------------- | |
SUM: 86 690 6 4448 | |
------------------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lein with-profile clj run | |
lein with-profile cljs-node cljsbuild test | |
lein with-profile cljs-browser cljsbuild test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns obb-rules.action-test | |
(:require | |
#?(:clj [clojure.test :refer [deftest testing is run-tests]] | |
:cljs [cljs.test :refer-macros [deftest testing is run-tests]]))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns obb-rules.evaluator-test | |
(:require | |
#?(:cljs [cljs.test.check :as tc]) | |
#?(:clj [clojure.test.check.generators :as gen] | |
:cljs [cljs.test.check.generators :as gen]) | |
#?(:clj [clojure.test.check.properties :as prop] | |
:cljs [cljs.test.check.properties :as prop :include-macros true]) | |
#?(:clj [clojure.test.check.clojure-test :refer [defspec]] | |
:cljs [cljs.test.check.cljs-test :refer-macros [defspec]]) | |
#?(:clj [clojure.test :refer [deftest testing is run-tests]] |
OlderNewer