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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<title>Test Page</title> | |
<script type="text/javascript" src="js/prototype-1.6.0.3.js"></script> | |
<script type="text/javascript" src="js/livepipe/livepipe.js"></script> | |
<script type="text/javascript" src="js/livepipe/window.js"></script> | |
<script type="text/javascript"> |
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
def make_friends(user, target) | |
transaction do | |
begin | |
Friend.find(:first, :conditions => {:inviter_id => user.id, :invited_id => target.id, :status => PENDING}).update_attribute(:status, ACCEPTED) | |
Friend.create!(:inviter_id => target.id, :invited_id => user.id, :status => ACCEPTED) | |
rescue Exception | |
return make_friends( target, user) if user.followed_by? target | |
return add_follower(user, target) | |
end | |
end |
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
include AASM | |
include AASM::Persistence | |
aasm_column :status | |
aasm_initial_state Proc.new { |task| task.assignments.empty? ? :not_started } | |
aasm_state :not_started | |
aasm_state :in_progress | |
aasm_state :completed | |
aasm_event :start_task do |
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
require "autotest/growl" | |
require "autotest/fsevent" | |
require 'autotest/restart' | |
Autotest.add_hook :initialize do |at| | |
at.unit_diff = 'cat' | |
end | |
Autotest.add_hook :ran_command do |at| |
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
Task.find(:all, :include => [{:assignments => :task}], :conditions => ["assignments.assignee_id = ? AND assignments.status = ?", u.id, "accepted"]) |
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
# visit.rb | |
Factory.define :visit do |f| | |
f.patient { |a| a.association(:patient) } | |
f.clinic { |a| a.association(:clinic) } | |
end | |
# patient.rb | |
# Defines a new sequence | |
Factory.sequence :email do |n| | |
"person#{n}@example.com" |
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
require File.join(File.dirname(__FILE__), "/load-diff-lcs") | |
require 'pp' | |
module Spec | |
module Expectations | |
module Differs | |
unless defined?(Default) | |
class Default | |
def initialize(options) | |
@options = options |
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
module Spec | |
module Expectations | |
module Differs | |
unless defined?(Spec::Expecations::Differs::Default) | |
class Default |
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
require 'rubygems' | |
require 'spork' | |
Spork.prefork do | |
# Loading more in this block will cause your tests to run faster. However, | |
# if you change any configuration or code from libraries loaded here, you'll | |
# need to restart spork for it take effect. | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.dirname(__FILE__) + "/../config/environment" |
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
--colour | |
--format progress | |
--loadby mtime | |
--reverse | |
--drb |
OlderNewer