-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
44 lines (37 loc) · 923 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
require 'bundler/gem_tasks'
require 'rake/testtask'
Rake::TestTask.new do |t|
t.libs << 'test'
t.pattern = 'test/*_test.rb'
end
Rake::TestTask.new do |t|
t.libs << 'test'
t.name = "test:integration"
t.pattern = 'test/integration/*_test.rb'
end
namespace :test do
desc "Prepare test environment"
task :prepare do
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:database => "#{Dir.pwd}/database.sqlite3"
)
ActiveRecord::Schema.define do
create_table :posts do |t|
t.column :title, :string
t.column :author, :string
t.timestamps
end
create_table :comments do |t|
t.column :message, :string
t.column :author, :string
t.belongs_to :post
end
create_table :likes do |t|
t.column :author, :string
t.belongs_to :comment
end
end
end
end