Permalink
Browse files

Moved models into their own file

  • Loading branch information...
1 parent 47a6b73 commit c701ae5e55ac929708744d5a37b6baa534afe3e8 @jferris jferris committed Jun 1, 2008
Showing with 2 additions and 33 deletions.
  1. +2 −33 test/test_helper.rb
View
@@ -1,41 +1,10 @@
$: << File.join(File.dirname(__FILE__), '..', 'lib')
+$: << File.join(File.dirname(__FILE__))
require 'rubygems'
require 'test/unit'
require 'activerecord'
require 'factory_girl'
require 'shoulda'
require 'mocha'
-
-ActiveRecord::Base.establish_connection(
- :adapter => 'sqlite3',
- :database => File.join(File.dirname(__FILE__), 'test.db')
-)
-
-class CreateSchema < ActiveRecord::Migration
- def self.up
- create_table :users, :force => true do |t|
- t.string :first_name
- t.string :last_name
- t.string :email
- t.boolean :admin, :default => false
- end
-
- create_table :posts, :force => true do |t|
- t.string :title
- t.integer :author_id
- end
- end
-end
-
-CreateSchema.suppress_messages { CreateSchema.migrate(:up) }
-
-class User < ActiveRecord::Base
- validates_presence_of :first_name, :last_name, :email
- has_many :posts, :foreign_key => 'author_id'
-end
-
-class Post < ActiveRecord::Base
- validates_presence_of :title, :author_id
- belongs_to :author, :class_name => 'User'
-end
+require 'models'

0 comments on commit c701ae5

Please sign in to comment.