🙅♀️
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
# Dummy models that look and act like the real thing. | |
FactoryGirl.define do | |
# Basic account | |
factory :account do | |
password { "testtest" }.ignore | |
first_name { Faker::Name.first_name } | |
last_name { Faker::Name.last_name } | |
email { Faker::Internet.email } |
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 CrudHelper | |
def buttons(content=nil) | |
content ||= yield if block_given? | |
content_tag(:ul, content) | |
end | |
def button(text, url) | |
content_tag(:li, :class => "button") do | |
link_to text, url, 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
# WARNING WARNING WARNING WARNING WARNING WARNING | |
# | |
# This is only useful if you have tags that DON'T INCLUDE SPACES. | |
# | |
# If you have tags in your http://delicious.com/<yourusername> list that | |
# include spaces (such as "underwater basket weaving"), then this is NOT | |
# for you. | |
# | |
# If you just have tags like "underwater-basket-weaving", then this'll work fine. | |
# |
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 'spec_helper' | |
describe "FAQs" do | |
let(:account) { Factory(:account, :password => "password") } | |
before(:each) { sign_in account, "password" } | |
context "when creating a FAQ" do | |
let(:faq) { FactoryGirl.build(:faq) } | |
before(:each) 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 'spec_helper' | |
describe "Articles" do | |
let(:account) { Factory(:account, :password => "password") } | |
let(:business) { account.businesses.first } | |
let(:index_path) { polymorphic_url([business, Article]) } | |
before(:each) { sign_in(account, "password") } # Everything needs authentication. | |
context "when creating an Article" 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 'spec_helper' | |
describe "Payment Methods" do | |
let(:account) { Factory(:account, :password => "password") } | |
let(:business) { account.businesses.first } | |
before(:each) { sign_in(account, "password") } # Everything needs authentication. | |
context "when editing a Business' Payment Methods" do | |
let!(:subject) { Factory(:payment_method, :business => business) } |
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
$ be rake spec:models --trace | |
** Invoke spec:models (first_time) | |
** Invoke db:test:prepare (first_time) | |
** Invoke db:abort_if_pending_migrations (first_time) | |
** Invoke environment (first_time) | |
** Execute environment | |
** Execute db:abort_if_pending_migrations | |
** Execute db:test:prepare | |
** Invoke db:test:load (first_time) |
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
gem 'linecache19', :git => 'git://github.com/mark-moseley/linecache' | |
gem 'ruby-debug-base19x', '~> 0.11.30.pre4' | |
gem 'ruby-debug19' |
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
javascript:var m = document.location.href.match(new RegExp('(?:(?:www\.)?github.com)/([^/?%]+/[^/?%]+)','i')); if(!!m[1]) { var repo = m[1]; document.write('<!doctype html><title>'+repo+' | DocumentUp</title><script src="https://cdnjs.cloudflare.com/ajax/libs/documentup/latest.min.js"></script><script>DocumentUp.document("'+repo+'");</script>'); } else { alert("This is not a GitHub repo!"); } |
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
class Region < ActiveRecord::Base | |
acts_as_nested_set :left_column => 'left', :right_column => 'right' | |
attr_accessible :parent_id, :postcode, :name, :region_type | |
attr_accessor :area | |
def self.suburb_search(terms, options={}) | |
options = { | |
:limit => 20 |