Skip to content

Instantly share code, notes, and snippets.

@dreamr
dreamr / article.rb
Created July 1, 2011 00:28
A model that can get its ORM from AR or DM - Work in progress
@@config = {
:use_adapter => :data_mapper
}
# Ideally I would like to be able to mix in ActiveRecord or DataMapper
# to get a ORM layer. Can't get ActiveRecord to work because it inherits
# rather then mixes in
class Article
jokelly@pinkbox:~/development/apps/pinkbox/management$ rake recreate_dbs config:everything_runs_locally
(in /home/jokelly/development/apps/pinkbox/management)
localgems Gems
mkdir -p /home/jokelly/development/apps/pinkbox/management/etc/localgems/gems
WARNING: did not load management:db tasks because pinkbox_common gem was not found in
jokelly@pinkbox:~/development/apps/pinkbox/management$
@dreamr
dreamr / Article
Created June 22, 2011 01:06
More link summary issue example
---
title: RubySlippers, the smartest blogging engine in all of Oz!
date: 21/06/2011
tags: announcements
I just wanted to shout a quick _hello world_. Nothing more to read here.
~
~/development/apps/pinkbox/management |develop: 4989m| $ cd $PINKBOX_ROOT/management ; rake startup --trace
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
localgems Gems
mkdir -p /Users/james/development/apps/pinkbox/management/etc/localgems/gems
livegems Gems
WARNING: Global access to Rake DSL methods is deprecated. Please include
... Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method Module#mkdir_p called at /Users/james/development/apps/pinkbox/management/dev_util/tasks/rake_helper.rb:96:in `add_gems'
mkdir -p /Users/james/development/apps/pinkbox/management/etc/livegems/gems
** Invoke startup (first_time)
RAILS_ENV=test rake management:db:schema:load --trace(in /Users/james/development/clients/importal/pinkbox/management)
localgems Gems
mkdir -p /Users/james/development/clients/importal/pinkbox/management/etc/localgems/gems
livegems Gems
mkdir -p /Users/james/development/clients/importal/pinkbox/management/etc/livegems/gems
** Invoke management:db:schema:load (first_time)
** Invoke gems (first_time)
** Execute gems
localgems Gems
mkdir -p /Users/james/development/clients/importal/pinkbox/management/etc/localgems/gems
~/development/clients/importal/pinkbox/management |develop: --| $ rake all_tests --trace(in /Users/james/development/clients/importal/pinkbox/management)
localgems Gems
mkdir -p /Users/james/development/clients/importal/pinkbox/management/etc/localgems/gems
livegems Gems
mkdir -p /Users/james/development/clients/importal/pinkbox/management/etc/livegems/gems
** Invoke all_tests (first_time)
** Execute all_tests
(in /Users/james/development/clients/importal/pinkbox/management)
localgems Gems
mkdir -p /Users/james/development/clients/importal/pinkbox/management/etc/localgems/gems
require 'faker'
require "#{Rails.root}/app/lib/railstar_lib/data/masked_field"
require "#{Rails.root}/spec/support/factory_sequences"
include RailstarLib::Data
Factory.define :user do |u|
u.name { Faker::Name.name }
u.email { Factory.next(:email) }
u.password "password"
class UserSession < Authlogic::Session::Base
extend ActiveModel::Naming
end
@dreamr
dreamr / tasks_spec.rb
Created June 1, 2011 21:37
request spec for tasks
require 'spec_helper'
describe "Tasks" do
before(:each) do
login_as(:developer)
end
describe "GET /tasks" do
it "renders" do
visit tasks_path
@dreamr
dreamr / spec_helper.rb
Created June 1, 2011 21:36
my spec helper
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'authlogic/test_case'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}