Skip to content

Instantly share code, notes, and snippets.

@axsuul
Created August 8, 2012 19:29

Revisions

  1. Ax Suul revised this gist Aug 8, 2012. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions spec.rb
    Original file line number Diff line number Diff line change
    @@ -20,11 +20,11 @@
    factory :valid_neutral_account_with_production_record, parent: :valid_neutral_account do
    association :account, factory: :account

    after(:create) do
    after(:create) do |account|
    FactoryGirl.modify do
    factory :account, class: FinancialAccounting::Account do
    account_identifier { account_identifier # TRYING TO RELATE THIS TO THE account_identifier generated above }
    account_number { account_number }
    account_identifier { account.account_identifier # TRYING TO RELATE THIS TO THE account_identifier generated above }
    account_number { account.account_number }
    end
    end
    end
  2. John Gerhardt revised this gist Aug 8, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion spec.rb
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,7 @@
    after(:create) do
    FactoryGirl.modify do
    factory :account, class: FinancialAccounting::Account do
    account_identifier { account_identifier }
    account_identifier { account_identifier # TRYING TO RELATE THIS TO THE account_identifier generated above }
    account_number { account_number }
    end
    end
  3. John Gerhardt renamed this gist Aug 8, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. John Gerhardt created this gist Aug 8, 2012.
    39 changes: 39 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    FactoryGirl.define do
    factory :neutral_account, class: FinancialAccounting::Update::Neutral::Account do
    load_sequence { FactoryGirl.generate(:sn) }
    loaded_at { Time.now }
    recorded_at { Time.now }
    created_at { Time.now }
    updated_at { Time.now }

    factory :valid_neutral_account do
    association :custodian, factory: :custodian
    association :advisory_firm, factory: :advisory_firm
    #association :account, factory: :account, strategy: :build
    account_number { Faker::Financial.random_string(9) }
    account_identifier { "#{Platform::Custodian.find(custodian).code}-#{account_number}" }
    advisory_firm_number { Faker::Financial.random_string(3) }
    advisory_firm_identifier { Platform::AdvisoryFirmIdentifier.lookup_advisory_firm_identifier(custodian_id, advisory_firm_number) }
    date_opened { Time.now }
    end

    factory :valid_neutral_account_with_production_record, parent: :valid_neutral_account do
    association :account, factory: :account

    after(:create) do
    FactoryGirl.modify do
    factory :account, class: FinancialAccounting::Account do
    account_identifier { account_identifier }
    account_number { account_number }
    end
    end
    end

    end

    end

    factory :invalid_neutral_account, class: FinancialAccounting::Update::Neutral::Account do
    load_sequence nil
    end
    end