This file contains 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
RSpec::Matchers.define :encrypt do |attribute| | |
encrypted_attribute = ('encrypted_' + attribute.to_s) | |
match do |model| | |
model.respond_to?(attribute) && model.respond_to?(encrypted_attribute.intern) && model.class.column_names.include?(encrypted_attribute) | |
end | |
failure_message_for_should do |model| | |
unless model.class.column_names.include?(encrypted_attribute) |
This file contains 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
var Mocha = require('mocha'), | |
fs = require('fs'), | |
_ = require('underscore'); | |
var mocha = new Mocha({reporter: 'spec', ui: 'bdd'}); | |
mocha.addPath = function(dir){ | |
fs.readdirSync(dir).filter(function(file){ | |
var fileArray = file.split('.'); | |
This file contains 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
Rails => Geddy | |
**Models** | |
User.new(params) => User.create(params); | |
----- | |
User.create(params) => var u = User.create(params); | |
// saves the user then calls the callback function | |
u.save(function (err, data) { // do things }); | |
----- |