mirror of
https://github.com/thoughtbot/factory_bot.git
synced 2022-11-09 11:43:51 -05:00
24 lines
472 B
Ruby
24 lines
472 B
Ruby
![]() |
ActiveRecord::Base.establish_connection(
|
||
|
:adapter => 'sqlite3',
|
||
|
:database => File.join(File.dirname(__FILE__), 'test.db')
|
||
|
)
|
||
|
|
||
|
class CreateSchema < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
create_table :posts, :force => true do |t|
|
||
|
t.string :title
|
||
|
t.string :body
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
CreateSchema.suppress_messages { CreateSchema.migrate(:up) }
|
||
|
|
||
|
class Post < ActiveRecord::Base
|
||
|
end
|
||
|
|
||
|
Factory.define :post do |f|
|
||
|
end
|
||
|
|
||
|
require 'factory_girl/step_definitions'
|