Skip to content

Instantly share code, notes, and snippets.

it "should authenticate with matching email and password" do
user = Factory(:user, :email => "[email protected]", :plain_password => "secret")
User.authenticate("[email protected]", "secret").should == user
end
module Salesforce
class LeadConvert
include DataMapper::Resource
# set the adapter
def self.default_repository_name
:salesforce
end
# standard fields
# =============================================================================
# ENVIRONMENTS
# =============================================================================
task :dev do
desc "Deploys to the development server specifically"
puts "*** Deploying to the \033[1;42m DEVELOPMENT \033[0m server!"
set :rails_env, "development"
role :web, "dev.#{domain}"
%: rvm install ree-1.8.7-head
info: Installing Ruby from source to: /usr/local/rvm/rubies/ree-1.8.7-head
info: Pulling from git://github.com/FooBarWidget/rubyenterpriseedition187.git, this may take a while depending on your connection...
From git://github.com/FooBarWidget/rubyenterpriseedition187
* branch master -> FETCH_HEAD
Already up-to-date.
info: Copying from repo to src path...
[2010-06-17 22:16:58] ./configure --prefix=/usr/local/rvm/rubies/ree-1.8.7-head --dont-install-useful-gems
configure: error: unrecognized option: --dont-install-useful-gems
Try `./configure --help' for more information.
# CIJOE
# setup Continuous Integration
`git config --remove-section cijoe`
`git config --add cijoe.runner "RAILS_ENV=test rake -s test"`
`git config --add cijoe.branch development`
`git config --add cijoe.buildallfile tmp/cijoe.txt`
# copy build-failed hook
`cp lib/hooks/* .git/hooks && chmod +x .git/hooks/*`
#!/bin/sh
# CIJOE
#
# Put this file to $PROJECT/.git/hooks/ for after pull changes.
#
rm -rf /data/Woople_CI/current/config/database.yml
ln -s /data/Woople_CI/shared/config/database.yml /data/Woople_CI/current/config/database.yml
rake db:create:all
#!/bin/sh
# CIJOE
#
# Put this file to $PROJECT/.git/hooks/ for email notifications.
#
# Do not forget: chmod +x build-failed
RAILS_ENV=staging rake woople:continuous_integration RECIPIENT=[your_email_address] STATUS="Failed" SHA=$SHA AUTHOR=$AUTHOR MESSAGE=$MESSAGE OUTPUT=$OUTPUT
namespace :woople do
desc "Continuous Integration Notification"
task :continuous_integration => :environment do
# CIJOE
# inline class
class CIMailer < MadMimiMailer
def mimi_blank_template(recipient, subject, message)
from "Woople Notifications <notifications@#{MAIN_HOST}>"
recipients recipient
# CIJOE
# Example CI Joe rackup config. Drop a cijoe.ru file
# in your projects direct
require 'cijoe'
# set the $project_path global
$project_path = `pwd`.gsub(/\n/, '')
# setup middleware
use Rack::CommonLogger