Skip to content

Commit

Permalink
Fix tests...
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Adams committed Mar 7, 2012
1 parent daf29cb commit 68b56dc
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
class CreatePlutusTables < ActiveRecord::Migration
def self.up
create_table :accounts do |t|
create_table :plutus_accounts do |t|
t.string :name
t.string :type
t.boolean :contra

t.timestamps
end
add_index :accounts, [:name, :type]
create_table :transactions do |t|

add_index :plutus_accounts, [:name, :type]

create_table :plutus_transactions do |t|
t.string :description
t.integer :credit_account_id
t.integer :debit_account_id
Expand All @@ -21,13 +21,13 @@ def self.up
t.timestamps
end

add_index :transactions, :credit_account_id
add_index :transactions, :debit_account_id
add_index :transactions, [:commercial_document_id, :commercial_document_type], :name => "index_transactions_on_commercial_doc"
add_index :plutus_transactions, :credit_account_id
add_index :plutus_transactions, :debit_account_id
add_index :plutus_transactions, [:commercial_document_id, :commercial_document_type], :name => "plutus_ts_on_commercial_doc"
end

def self.down
drop_table :accounts
drop_table :transactions
drop_table :plutus_accounts
drop_table :plutus_transactions
end
end
22 changes: 11 additions & 11 deletions fixture_rails_root/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20101203185848) do
ActiveRecord::Schema.define(:version => 20120307201016) do

create_table "accounts", :force => true do |t|
create_table "plutus_accounts", :force => true do |t|
t.string "name"
t.string "type"
t.boolean "contra"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

add_index "accounts", ["name", "type"], :name => "index_accounts_on_name_and_type"
add_index "plutus_accounts", ["name", "type"], :name => "index_plutus_accounts_on_name_and_type"

create_table "transactions", :force => true do |t|
create_table "plutus_transactions", :force => true do |t|
t.string "description"
t.integer "credit_account_id"
t.integer "debit_account_id"
t.decimal "amount", :precision => 20, :scale => 10
t.integer "commercial_document_id"
t.string "commercial_document_type"
t.datetime "created_at"
t.datetime "updated_at"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

add_index "transactions", ["commercial_document_id", "commercial_document_type"], :name => "index_transactions_on_commercial_doc"
add_index "transactions", ["credit_account_id"], :name => "index_transactions_on_credit_account_id"
add_index "transactions", ["debit_account_id"], :name => "index_transactions_on_debit_account_id"
add_index "plutus_transactions", ["commercial_document_id", "commercial_document_type"], :name => "plutus_ts_on_commercial_doc"
add_index "plutus_transactions", ["credit_account_id"], :name => "index_plutus_transactions_on_credit_account_id"
add_index "plutus_transactions", ["debit_account_id"], :name => "index_plutus_transactions_on_debit_account_id"

end
20 changes: 10 additions & 10 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
require 'factory_girl'

ENV["RAILS_ENV"] ||= 'test'
require File.expand_path(File.dirname(__FILE__) + "/../fixture_rails_root/config/environment")
require Rails.root.join('db/schema').to_s
require 'rspec/rails'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path(File.dirname(__FILE__) + "/../fixture_rails_root/config/environment")
require Rails.root.join('db/schema').to_s
require 'rspec/rails'

$: << File.expand_path(File.dirname(__FILE__) + '/../lib/')
require 'plutus'
$: << File.expand_path(File.dirname(__FILE__) + '/../lib/')
require 'plutus'

Dir[File.expand_path(File.join(File.dirname(__FILE__),'factories','**','*.rb'))].each {|f| require f}
Dir[File.expand_path(File.join(File.dirname(__FILE__),'factories','**','*.rb'))].each {|f| require f}

RSpec.configure do |config|
config.use_transactional_fixtures = true
end
RSpec.configure do |config|
config.use_transactional_fixtures = true
end

0 comments on commit 68b56dc

Please sign in to comment.