erp_txns_and_accts 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. data/GPL-3-LICENSE +0 -0
  2. data/app/models/biz_txn_acct_pty_rtype.rb +4 -0
  3. data/app/models/biz_txn_acct_root.rb +15 -3
  4. data/app/models/extensions/money.rb +1 -2
  5. data/app/models/extensions/party.rb +6 -10
  6. data/app/models/financial_txn.rb +12 -55
  7. data/app/models/financial_txn_account.rb +5 -32
  8. data/db/migrate/20080805000030_base_txns_and_accts.rb +10 -7
  9. data/db/migrate/upgrade/20120118135738_add_type_column_to_biz_txn_acct_root.rb +7 -0
  10. data/db/migrate/upgrade/20120118143602_add_apply_date_to_financial_txn.rb +7 -0
  11. data/db/migrate/upgrade/20120515155000_update_financial_txn_acct_due_date.rb +9 -0
  12. data/lib/erp_txns_and_accts/engine.rb +7 -1
  13. data/lib/erp_txns_and_accts/extensions/active_record/acts_as_biz_txn_account.rb +6 -4
  14. data/lib/erp_txns_and_accts/extensions/active_record/acts_as_biz_txn_event.rb +1 -1
  15. data/lib/erp_txns_and_accts/extensions/active_record/acts_as_financial_txn_account.rb +9 -4
  16. data/lib/erp_txns_and_accts/version.rb +7 -1
  17. data/lib/erp_txns_and_accts.rb +1 -0
  18. data/spec/dummy/Rakefile +7 -0
  19. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  20. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  21. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  22. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  23. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  24. data/spec/dummy/config/application.rb +48 -0
  25. data/spec/dummy/config/boot.rb +10 -0
  26. data/spec/dummy/config/database.yml +8 -0
  27. data/spec/dummy/config/environment.rb +5 -0
  28. data/spec/dummy/config/environments/spec.rb +27 -0
  29. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  30. data/spec/dummy/config/initializers/inflections.rb +10 -0
  31. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  32. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  33. data/spec/dummy/config/initializers/session_store.rb +8 -0
  34. data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
  35. data/spec/dummy/config/locales/en.yml +5 -0
  36. data/spec/dummy/config/routes.rb +3 -0
  37. data/spec/dummy/config.ru +4 -0
  38. data/spec/dummy/public/404.html +26 -0
  39. data/spec/dummy/public/422.html +26 -0
  40. data/spec/dummy/public/500.html +26 -0
  41. data/spec/dummy/public/favicon.ico +0 -0
  42. data/spec/dummy/script/rails +6 -0
  43. data/spec/factories/basic.rb +13 -0
  44. data/spec/models/base_txn_context_spec.rb +11 -0
  45. data/spec/models/biz_acct_txn_task_spec.rb +11 -0
  46. data/spec/models/biz_txn_acct_party_role_spec.rb +11 -0
  47. data/spec/models/biz_txn_acct_pty_rtype_spec.rb +11 -0
  48. data/spec/models/biz_txn_acct_rel_type_spec.rb +11 -0
  49. data/spec/models/biz_txn_acct_relationship_spec.rb +11 -0
  50. data/spec/models/biz_txn_acct_root_spec.rb +12 -0
  51. data/spec/models/biz_txn_acct_status_spec.rb +13 -0
  52. data/spec/models/biz_txn_acct_status_type_spec.rb +13 -0
  53. data/spec/models/biz_txn_acct_type_spec.rb +13 -0
  54. data/spec/models/biz_txn_agreement_role_spec.rb +14 -0
  55. data/spec/models/biz_txn_agreement_role_type_spec.rb +14 -0
  56. data/spec/models/biz_txn_event_desc_spec.rb +14 -0
  57. data/spec/models/biz_txn_event_spec.rb +11 -0
  58. data/spec/models/biz_txn_party_role_spec.rb +11 -0
  59. data/spec/models/biz_txn_party_role_type_spec.rb +11 -0
  60. data/spec/models/biz_txn_rel_type_spec.rb +11 -0
  61. data/spec/models/biz_txn_relationship_spec.rb +11 -0
  62. data/spec/models/biz_txn_status_spec.rb +11 -0
  63. data/spec/models/biz_txn_task_spec.rb +11 -0
  64. data/spec/models/biz_txn_task_type_spec.rb +11 -0
  65. data/spec/models/biz_txn_type_spec.rb +12 -0
  66. data/spec/models/financial_txn_account_spec.rb +11 -0
  67. data/spec/models/financial_txn_spec.rb +11 -0
  68. data/spec/spec_helper.rb +60 -0
  69. metadata +151 -46
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,13 @@
1
+ ##
2
+ #The basic models, these factories have no
3
+ #callbacks, associations, sequences declared
4
+ #besides what's necessary
5
+ FactoryGirl.define do
6
+ factory :financial_txn
7
+ factory :financial_txn_account
8
+ factory :biz_txn_acct_root
9
+ factory :biz_txn_event
10
+ factory :biz_txn_acct
11
+ factory :biz_txn_acct_party_role
12
+ factory :biz_txn_type
13
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe BaseTxnContext do
4
+ it "can be instantiated" do
5
+ BaseTxnContext.new.should be_an_instance_of(BaseTxnContext)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BaseTxnContext.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizAcctTxnTask do
4
+ it "can be instantiated" do
5
+ BizAcctTxnTask.new.should be_an_instance_of(BizAcctTxnTask)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizAcctTxnTask.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnAcctPartyRole do
4
+ it "can be instantiated" do
5
+ BizTxnAcctPartyRole.new.should be_an_instance_of(BizTxnAcctPartyRole)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnAcctPartyRole.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnAcctPtyRtype do
4
+ it "can be instantiated" do
5
+ BizTxnAcctPtyRtype.new.should be_an_instance_of(BizTxnAcctPtyRtype)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnAcctPtyRtype.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnAcctRelType do
4
+ it "can be instantiated" do
5
+ BizTxnAcctRelType.new.should be_an_instance_of(BizTxnAcctRelType)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnAcctRelType.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnAcctRelationship do
4
+ it "can be instantiated" do
5
+ BizTxnAcctRelationship.new.should be_an_instance_of(BizTxnAcctRelationship)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnAcctRelationship.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnAcctRoot do
4
+ it "can be instantiated" do
5
+ BizTxnAcctRoot.new.should be_an_instance_of(BizTxnAcctRoot)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnAcctRoot.create().should be_persisted
10
+ end
11
+ end
12
+
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnAcctStatus do
4
+ it "can be instantiated" do
5
+ BizTxnAcctStatus.new.should be_an_instance_of(BizTxnAcctStatus)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnAcctStatus.create().should be_persisted
10
+ end
11
+ end
12
+
13
+
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnAcctStatusType do
4
+ it "can be instantiated" do
5
+ BizTxnAcctStatusType.new.should be_an_instance_of(BizTxnAcctStatusType)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnAcctStatusType.create().should be_persisted
10
+ end
11
+ end
12
+
13
+
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnAcctType do
4
+ it "can be instantiated" do
5
+ BizTxnAcctType.new.should be_an_instance_of(BizTxnAcctType)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnAcctType.create().should be_persisted
10
+ end
11
+ end
12
+
13
+
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnAgreementRole do
4
+ it "can be instantiated" do
5
+ BizTxnAgreementRole.new.should be_an_instance_of(BizTxnAgreementRole)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnAgreementRole.create().should be_persisted
10
+ end
11
+ end
12
+
13
+
14
+
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnAgreementRoleType do
4
+ it "can be instantiated" do
5
+ BizTxnAgreementRoleType.new.should be_an_instance_of(BizTxnAgreementRoleType)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnAgreementRoleType.create().should be_persisted
10
+ end
11
+ end
12
+
13
+
14
+
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnEventDesc do
4
+ it "can be instantiated" do
5
+ BizTxnEventDesc.new.should be_an_instance_of(BizTxnEventDesc)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnEventDesc.create().should be_persisted
10
+ end
11
+ end
12
+
13
+
14
+
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnEvent do
4
+ it "can be instantiated" do
5
+ BizTxnEvent.new.should be_an_instance_of(BizTxnEvent)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnEvent.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnPartyRole do
4
+ it "can be instantiated" do
5
+ BizTxnPartyRole.new.should be_an_instance_of(BizTxnPartyRole)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnPartyRole.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnPartyRoleType do
4
+ it "can be instantiated" do
5
+ BizTxnPartyRoleType.new.should be_an_instance_of(BizTxnPartyRoleType)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnPartyRoleType.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnRelType do
4
+ it "can be instantiated" do
5
+ BizTxnRelType.new.should be_an_instance_of(BizTxnRelType)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnRelType.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnRelationship do
4
+ it "can be instantiated" do
5
+ BizTxnRelationship.new.should be_an_instance_of(BizTxnRelationship)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnRelationship.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnStatus do
4
+ it "can be instantiated" do
5
+ BizTxnStatus.new.should be_an_instance_of(BizTxnStatus)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnStatus.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnTask do
4
+ it "can be instantiated" do
5
+ BizTxnTask.new.should be_an_instance_of(BizTxnTask)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnTask.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnTaskType do
4
+ it "can be instantiated" do
5
+ BizTxnTaskType.new.should be_an_instance_of(BizTxnTaskType)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnTaskType.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+
3
+ describe BizTxnType do
4
+ it "can be instantiated" do
5
+ BizTxnType.new.should be_an_instance_of(BizTxnType)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ BizTxnType.create().should be_persisted
10
+ end
11
+ end
12
+
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe FinancialTxnAccount do
4
+ it "can be instantiated" do
5
+ FinancialTxnAccount.new.should be_an_instance_of(FinancialTxnAccount)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ FinancialTxnAccount.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe FinancialTxn do
4
+ it "can be instantiated" do
5
+ FinancialTxn.new.should be_an_instance_of(FinancialTxn)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ FinancialTxn.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,60 @@
1
+ require 'spork'
2
+ require 'rake'
3
+
4
+ Spork.prefork do
5
+ # Loading more in this block will cause your tests to run faster. However,
6
+ # if you change any configuration or code from libraries loaded here, you'll
7
+ # need to restart spork for it take effect.
8
+
9
+ ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
10
+ DUMMY_APP_ROOT=File.join(File.dirname(__FILE__), '/dummy')
11
+
12
+ require 'active_support'
13
+ require 'active_model'
14
+ require 'active_record'
15
+ require 'action_controller'
16
+
17
+ # Configure Rails Envinronment
18
+ ENV["RAILS_ENV"] = "spec"
19
+ require File.expand_path(DUMMY_APP_ROOT + "/config/environment.rb", __FILE__)
20
+
21
+ ActiveRecord::Base.configurations = YAML::load(IO.read(DUMMY_APP_ROOT + "/config/database.yml"))
22
+ ActiveRecord::Base.establish_connection(ENV["DB"] || "spec")
23
+ ActiveRecord::Migration.verbose = false
24
+
25
+ # Requires supporting ruby files with custom matchers and macros, etc,
26
+ # in spec/support/ and its subdirectories.
27
+ Dir[File.join(ENGINE_RAILS_ROOT, "spec/support/**/*.rb")].each {|f| require f }
28
+
29
+ require 'rspec/rails'
30
+ require 'erp_dev_svcs'
31
+
32
+ RSpec.configure do |config|
33
+ config.use_transactional_fixtures = true
34
+ config.include Sorcery::TestHelpers::Rails
35
+ config.include ErpDevSvcs
36
+ config.include ErpDevSvcs::ControllerSupport, :type => :controller
37
+ end
38
+ end
39
+
40
+ Spork.each_run do
41
+ #We have to execute the migrations from dummy app directory
42
+ Dir.chdir DUMMY_APP_ROOT
43
+ `rake db:drop`
44
+ Dir.chdir ENGINE_RAILS_ROOT
45
+
46
+ #We have to execute the migrations from dummy app directory
47
+ Dir.chdir DUMMY_APP_ROOT
48
+ `rake db:migrate`
49
+ Dir.chdir ENGINE_RAILS_ROOT
50
+
51
+ ErpDevSvcs::FactorySupport.load_engine_factories
52
+
53
+ require 'simplecov'
54
+ SimpleCov.start 'rails' do
55
+ add_filter "spec/"
56
+ end
57
+ #Need to explictly load the files in lib/ until we figure out how to
58
+ #get rails to autoload them for spec like it used to...
59
+ Dir[File.join(ENGINE_RAILS_ROOT, "lib/**/*.rb")].each {|f| load f}
60
+ end