plutus 0.5.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. data/README.markdown +116 -69
  2. data/Rakefile +7 -20
  3. data/app/assets/javascripts/plutus/application.js +15 -0
  4. data/app/assets/stylesheets/plutus/application.css +13 -0
  5. data/app/assets/stylesheets/plutus/main.css.scss +86 -0
  6. data/app/controllers/plutus/accounts_controller.rb +45 -0
  7. data/app/controllers/plutus/transactions_controller.rb +44 -0
  8. data/app/models/plutus/account.rb +60 -0
  9. data/app/models/plutus/amount.rb +16 -0
  10. data/app/models/plutus/asset.rb +83 -0
  11. data/app/models/plutus/credit_amount.rb +10 -0
  12. data/app/models/plutus/debit_amount.rb +10 -0
  13. data/app/models/plutus/equity.rb +84 -0
  14. data/app/models/plutus/expense.rb +83 -0
  15. data/app/models/plutus/liability.rb +78 -0
  16. data/app/models/plutus/revenue.rb +83 -0
  17. data/app/models/plutus/transaction.rb +83 -0
  18. data/app/views/{accounts → plutus/accounts}/index.html.erb +4 -2
  19. data/app/views/{accounts → plutus/accounts}/show.html.erb +8 -18
  20. data/app/views/plutus/transactions/index.html.erb +48 -0
  21. data/app/views/plutus/transactions/show.html.erb +46 -0
  22. data/config/database.yml +5 -0
  23. data/config/routes.rb +6 -0
  24. data/lib/generators/plutus/templates/migration.rb +17 -13
  25. data/lib/plutus.rb +3 -2
  26. data/lib/plutus/version.rb +3 -0
  27. data/spec/controllers/accounts_controller_spec.rb +22 -19
  28. data/spec/controllers/transactions_controller_spec.rb +23 -20
  29. data/spec/factories/account_factory.rb +30 -24
  30. data/spec/factories/amount_factory.rb +19 -0
  31. data/spec/factories/transaction_factory.rb +11 -6
  32. data/spec/models/account_spec.rb +61 -40
  33. data/spec/models/amount_spec.rb +12 -0
  34. data/spec/models/asset_spec.rb +46 -39
  35. data/spec/models/credit_amount_spec.rb +22 -0
  36. data/spec/models/debit_amount_spec.rb +22 -0
  37. data/spec/models/equity_spec.rb +51 -43
  38. data/spec/models/expense_spec.rb +49 -41
  39. data/spec/models/liability_spec.rb +48 -40
  40. data/spec/models/revenue_spec.rb +48 -41
  41. data/spec/models/transaction_spec.rb +77 -42
  42. data/spec/routing/accounts_routing_spec.rb +23 -20
  43. data/spec/routing/transactions_routing_spec.rb +23 -20
  44. data/spec/spec_helper.rb +3 -1
  45. metadata +208 -139
  46. data/.yardopts +0 -2
  47. data/VERSION.yml +0 -5
  48. data/app/controllers/accounts_controller.rb +0 -43
  49. data/app/controllers/transactions_controller.rb +0 -42
  50. data/app/models/account.rb +0 -57
  51. data/app/models/asset.rb +0 -81
  52. data/app/models/equity.rb +0 -82
  53. data/app/models/expense.rb +0 -81
  54. data/app/models/liability.rb +0 -76
  55. data/app/models/revenue.rb +0 -81
  56. data/app/models/transaction.rb +0 -27
  57. data/app/views/layouts/accounts.html.erb +0 -68
  58. data/app/views/layouts/transactions.html.erb +0 -68
  59. data/app/views/transactions/index.html.erb +0 -27
  60. data/app/views/transactions/show.html.erb +0 -24
  61. data/doc/Account.html +0 -300
  62. data/doc/AccountsController.html +0 -317
  63. data/doc/Asset.html +0 -610
  64. data/doc/CreatePlutusTables.html +0 -265
  65. data/doc/Equity.html +0 -610
  66. data/doc/Expense.html +0 -610
  67. data/doc/Liability.html +0 -588
  68. data/doc/Plutus.html +0 -91
  69. data/doc/Plutus/Engine.html +0 -100
  70. data/doc/PlutusGenerator.html +0 -312
  71. data/doc/Revenue.html +0 -610
  72. data/doc/Transaction.html +0 -156
  73. data/doc/TransactionsController.html +0 -317
  74. data/doc/_index.html +0 -204
  75. data/doc/class_list.html +0 -36
  76. data/doc/css/common.css +0 -1
  77. data/doc/css/full_list.css +0 -53
  78. data/doc/css/style.css +0 -310
  79. data/doc/file.README.html +0 -250
  80. data/doc/file_list.html +0 -38
  81. data/doc/frames.html +0 -13
  82. data/doc/index.html +0 -250
  83. data/doc/js/app.js +0 -202
  84. data/doc/js/full_list.js +0 -149
  85. data/doc/js/jquery.js +0 -154
  86. data/doc/method_list.html +0 -275
  87. data/doc/top-level-namespace.html +0 -90
  88. data/fixture_rails_root/.gitignore +0 -4
  89. data/fixture_rails_root/Gemfile +0 -38
  90. data/fixture_rails_root/Gemfile.lock +0 -98
  91. data/fixture_rails_root/README +0 -256
  92. data/fixture_rails_root/Rakefile +0 -7
  93. data/fixture_rails_root/app/controllers/application_controller.rb +0 -3
  94. data/fixture_rails_root/app/helpers/application_helper.rb +0 -2
  95. data/fixture_rails_root/app/views/layouts/application.html.erb +0 -14
  96. data/fixture_rails_root/config.ru +0 -4
  97. data/fixture_rails_root/config/application.rb +0 -42
  98. data/fixture_rails_root/config/boot.rb +0 -13
  99. data/fixture_rails_root/config/database.yml +0 -22
  100. data/fixture_rails_root/config/environment.rb +0 -5
  101. data/fixture_rails_root/config/environments/development.rb +0 -26
  102. data/fixture_rails_root/config/environments/production.rb +0 -49
  103. data/fixture_rails_root/config/environments/test.rb +0 -35
  104. data/fixture_rails_root/config/initializers/backtrace_silencers.rb +0 -7
  105. data/fixture_rails_root/config/initializers/inflections.rb +0 -10
  106. data/fixture_rails_root/config/initializers/mime_types.rb +0 -5
  107. data/fixture_rails_root/config/initializers/secret_token.rb +0 -7
  108. data/fixture_rails_root/config/initializers/session_store.rb +0 -8
  109. data/fixture_rails_root/config/locales/en.yml +0 -5
  110. data/fixture_rails_root/config/routes.rb +0 -58
  111. data/fixture_rails_root/db/migrate/20101203193439_create_plutus_tables.rb +0 -33
  112. data/fixture_rails_root/db/schema.rb +0 -40
  113. data/fixture_rails_root/db/seeds.rb +0 -7
  114. data/fixture_rails_root/doc/README_FOR_APP +0 -2
  115. data/fixture_rails_root/lib/tasks/.gitkeep +0 -0
  116. data/fixture_rails_root/public/404.html +0 -26
  117. data/fixture_rails_root/public/422.html +0 -26
  118. data/fixture_rails_root/public/500.html +0 -26
  119. data/fixture_rails_root/public/favicon.ico +0 -0
  120. data/fixture_rails_root/public/images/rails.png +0 -0
  121. data/fixture_rails_root/public/index.html +0 -239
  122. data/fixture_rails_root/public/javascripts/application.js +0 -2
  123. data/fixture_rails_root/public/javascripts/controls.js +0 -965
  124. data/fixture_rails_root/public/javascripts/dragdrop.js +0 -974
  125. data/fixture_rails_root/public/javascripts/effects.js +0 -1123
  126. data/fixture_rails_root/public/javascripts/prototype.js +0 -6001
  127. data/fixture_rails_root/public/javascripts/rails.js +0 -175
  128. data/fixture_rails_root/public/robots.txt +0 -5
  129. data/fixture_rails_root/public/stylesheets/.gitkeep +0 -0
  130. data/fixture_rails_root/script/rails +0 -6
  131. data/fixture_rails_root/test/performance/browsing_test.rb +0 -9
  132. data/fixture_rails_root/test/test_helper.rb +0 -13
  133. data/fixture_rails_root/vendor/plugins/.gitkeep +0 -0
  134. data/plutus.gemspec +0 -176
  135. data/tasks/plutus_tasks.rake +0 -4
@@ -1,46 +1,54 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Expense do
4
-
5
- it "should allow creating an expense account" do
6
- expense = Factory(:expense)
7
- end
8
-
9
- it "should report a balance for the expense account" do
10
- expense = Factory(:expense)
11
- expense.balance.should be_kind_of(BigDecimal)
12
- end
13
-
14
- it "should report a balance for the class of accounts" do
15
- Expense.should respond_to(:balance)
16
- Expense.balance.should be_kind_of(BigDecimal)
17
- end
18
-
19
- it "should not report a trial balance" do
20
- lambda{Expense.trial_balance}.should raise_error(NoMethodError)
21
- end
22
-
23
- it "should not be valid without a name" do
24
- expense = Factory.build(:expense, :name => nil)
25
- expense.should_not be_valid
26
- end
27
-
28
- it "should have many credit transactions" do
29
- expense = Factory(:expense)
30
- expense.should respond_to(:credit_transactions)
31
- end
3
+ module Plutus
4
+ describe Expense do
5
+
6
+ it "should allow creating an expense account" do
7
+ expense = FactoryGirl.create(:expense)
8
+ end
32
9
 
33
- it "should have many debit transactions" do
34
- expense = Factory(:expense)
35
- expense.should respond_to(:debit_transactions)
36
- end
10
+ it "should report a balance for the expense account" do
11
+ expense = FactoryGirl.create(:expense)
12
+ FactoryGirl.create(:debit_amount, :account => expense)
13
+ expense.balance.should > 0
14
+ expense.balance.should be_kind_of(BigDecimal)
15
+ end
37
16
 
38
- it "a contra account should reverse the normal balance" do
39
- expense = Factory(:expense)
40
- contra_expense = Factory(:expense, :contra => true)
41
- transaction = Factory(:transaction, :credit_account => contra_expense, :debit_account => expense, :amount => 1000)
42
- contra_expense.balance.should > 0
43
- Expense.balance.should == 0
44
- end
17
+ it "should report a balance for the class of accounts" do
18
+ expense = FactoryGirl.create(:expense)
19
+ FactoryGirl.create(:debit_amount, :account => expense)
20
+ Expense.should respond_to(:balance)
21
+ Expense.balance.should > 0
22
+ Expense.balance.should be_kind_of(BigDecimal)
23
+ end
45
24
 
46
- end
25
+ it "should not report a trial balance" do
26
+ lambda{Expense.trial_balance}.should raise_error(NoMethodError)
27
+ end
28
+
29
+ it "should not be valid without a name" do
30
+ expense = FactoryGirl.build(:expense, :name => nil)
31
+ expense.should_not be_valid
32
+ end
33
+
34
+ it "should have many credit transactions" do
35
+ expense = Factory(:expense)
36
+ expense.should respond_to(:credit_transactions)
37
+ end
38
+
39
+ it "should have many debit transactions" do
40
+ expense = Factory(:expense)
41
+ expense.should respond_to(:debit_transactions)
42
+ end
43
+
44
+ it "a contra account should reverse the normal balance" do
45
+ expense = FactoryGirl.create(:expense)
46
+ contra_expense = Factory(:expense, :contra => true)
47
+ FactoryGirl.create(:debit_amount, :account => expense)
48
+ FactoryGirl.create(:credit_amount, :account => contra_expense)
49
+ contra_expense.balance.should > 0
50
+ Expense.balance.should == 0
51
+ end
52
+
53
+ end
54
+ end
@@ -1,46 +1,54 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Liability do
4
-
5
- it "should allow creating a liability account" do
6
- liability = Factory(:liability)
7
- end
8
-
9
- it "should report a balance for the liability account" do
10
- liability = Factory(:liability)
11
- liability.balance.should be_kind_of(BigDecimal)
12
- end
13
-
14
- it "should report a balance for the class of accounts" do
15
- Liability.should respond_to(:balance)
16
- Liability.balance.should be_kind_of(BigDecimal)
17
- end
18
-
19
- it "should not report a trial balance" do
20
- lambda{Liability.trial_balance}.should raise_error(NoMethodError)
21
- end
22
-
23
- it "should not be valid without a name" do
24
- liability = Factory.build(:liability, :name => nil)
25
- liability.should_not be_valid
26
- end
27
-
28
- it "should have many credit transactions" do
29
- liability = Factory(:liability)
30
- liability.should respond_to(:credit_transactions)
31
- end
3
+ module Plutus
4
+ describe Liability do
5
+
6
+ it "should allow creating an liability account" do
7
+ liability = FactoryGirl.create(:liability)
8
+ end
32
9
 
33
- it "should have many debit transactions" do
34
- liability = Factory(:liability)
35
- liability.should respond_to(:debit_transactions)
36
- end
10
+ it "should report a balance for the liability account" do
11
+ liability = FactoryGirl.create(:liability)
12
+ FactoryGirl.create(:credit_amount, :account => liability)
13
+ liability.balance.should > 0
14
+ liability.balance.should be_kind_of(BigDecimal)
15
+ end
37
16
 
38
- it "a contra account should reverse the normal balance" do
39
- liability = Factory(:liability)
40
- contra_liability = Factory(:liability, :contra => true)
41
- transaction = Factory(:transaction, :credit_account => liability, :debit_account => contra_liability, :amount => 1000)
42
- contra_liability.balance.should > 0
43
- Liability.balance.should == 0
44
- end
17
+ it "should report a balance for the class of accounts" do
18
+ liability = FactoryGirl.create(:liability)
19
+ FactoryGirl.create(:credit_amount, :account => liability)
20
+ Liability.should respond_to(:balance)
21
+ Liability.balance.should > 0
22
+ Liability.balance.should be_kind_of(BigDecimal)
23
+ end
45
24
 
25
+ it "should not report a trial balance" do
26
+ lambda{Liability.trial_balance}.should raise_error(NoMethodError)
27
+ end
28
+
29
+ it "should not be valid without a name" do
30
+ liability = FactoryGirl.build(:liability, :name => nil)
31
+ liability.should_not be_valid
32
+ end
33
+
34
+ it "should have many credit transactions" do
35
+ liability = Factory(:liability)
36
+ liability.should respond_to(:credit_transactions)
37
+ end
38
+
39
+ it "should have many debit transactions" do
40
+ liability = Factory(:liability)
41
+ liability.should respond_to(:debit_transactions)
42
+ end
43
+
44
+ it "a contra account should reverse the normal balance" do
45
+ liability = FactoryGirl.create(:liability)
46
+ contra_liability = Factory(:liability, :contra => true)
47
+ FactoryGirl.create(:credit_amount, :account => liability)
48
+ FactoryGirl.create(:debit_amount, :account => contra_liability)
49
+ contra_liability.balance.should > 0
50
+ Liability.balance.should == 0
51
+ end
52
+
53
+ end
46
54
  end
@@ -1,46 +1,53 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Revenue do
4
-
5
- it "should allow creating a revenue account" do
6
- revenue = Factory(:revenue)
7
- end
8
-
9
- it "should report a balance for the revenue account" do
10
- revenue = Factory(:revenue)
11
- revenue.balance.should be_kind_of(BigDecimal)
12
- end
13
-
14
- it "should report a balance for the class of accounts" do
15
- Revenue.should respond_to(:balance)
16
- Revenue.balance.should be_kind_of(BigDecimal)
17
- end
18
-
19
- it "should not report a trial balance" do
20
- lambda{Revenue.trial_balance}.should raise_error(NoMethodError)
21
- end
22
-
23
- it "should not be valid without a name" do
24
- revenue = Factory.build(:revenue, :name => nil)
25
- revenue.should_not be_valid
26
- end
27
-
28
- it "should have many credit transactions" do
29
- revenue = Factory(:revenue)
30
- revenue.should respond_to(:credit_transactions)
31
- end
3
+ module Plutus
4
+ describe Revenue do
5
+
6
+ it "should allow creating an revenue account" do
7
+ revenue = FactoryGirl.create(:revenue)
8
+ end
9
+
10
+ it "should report a balance for the revenue account" do
11
+ revenue = FactoryGirl.create(:revenue)
12
+ FactoryGirl.create(:credit_amount, :account => revenue)
13
+ revenue.balance.should > 0
14
+ revenue.balance.should be_kind_of(BigDecimal)
15
+ end
32
16
 
33
- it "should have many debit transactions" do
34
- revenue = Factory(:revenue)
35
- revenue.should respond_to(:debit_transactions)
36
- end
37
-
38
- it "a contra account should reverse the normal balance" do
39
- revenue = Factory(:revenue)
40
- contra_revenue = Factory(:revenue, :contra => true)
41
- transaction = Factory(:transaction, :credit_account => revenue, :debit_account => contra_revenue, :amount => 1000)
42
- contra_revenue.balance.should > 0
43
- Revenue.balance.should == 0
44
- end
17
+ it "should report a balance for the class of accounts" do
18
+ revenue = FactoryGirl.create(:revenue)
19
+ FactoryGirl.create(:credit_amount, :account => revenue)
20
+ Revenue.should respond_to(:balance)
21
+ Revenue.balance.should > 0
22
+ Revenue.balance.should be_kind_of(BigDecimal)
23
+ end
45
24
 
25
+ it "should not report a trial balance" do
26
+ lambda{Revenue.trial_balance}.should raise_error(NoMethodError)
27
+ end
28
+
29
+ it "should not be valid without a name" do
30
+ revenue = FactoryGirl.build(:revenue, :name => nil)
31
+ revenue.should_not be_valid
32
+ end
33
+
34
+ it "should have many credit transactions" do
35
+ revenue = Factory(:revenue)
36
+ revenue.should respond_to(:credit_transactions)
37
+ end
38
+
39
+ it "should have many debit transactions" do
40
+ revenue = Factory(:revenue)
41
+ revenue.should respond_to(:debit_transactions)
42
+ end
43
+
44
+ it "a contra account should reverse the normal balance" do
45
+ contra_revenue = Factory(:revenue, :contra => true)
46
+ # the odd amount below is because factories create an revenue debit_amount
47
+ FactoryGirl.create(:debit_amount, :account => contra_revenue, :amount => 473)
48
+ contra_revenue.balance.should > 0
49
+ Revenue.balance.should == 0
50
+ end
51
+
52
+ end
46
53
  end
@@ -1,48 +1,83 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Transaction do
3
+ module Plutus
4
+ describe Transaction do
4
5
 
5
- it "should create a transaction" do
6
- transaction = Factory(:transaction)
7
- end
8
-
9
- it "should not be valid without a credit account" do
10
- transaction = Factory.build(:transaction, :credit_account => nil)
11
- transaction.should_not be_valid
12
- end
13
-
14
- it "should not be valid without a valid credit account" do
15
- bad_account = Factory.build(:asset, :name => nil)
16
- transaction = Factory.build(:transaction, :credit_account => bad_account)
17
- transaction.should_not be_valid
18
- end
19
-
20
- it "should not be valid without a debit account" do
21
- transaction = Factory.build(:transaction, :debit_account => nil)
22
- transaction.should_not be_valid
23
- end
24
-
25
- it "should not be valid without a valid credit account" do
26
- bad_account = Factory.build(:asset, :name => nil)
27
- transaction = Factory.build(:transaction, :debit_account => bad_account)
28
- transaction.should_not be_valid
29
- end
30
-
31
- it "should not be valid without an amount" do
32
- transaction = Factory.build(:transaction, :amount => nil)
33
- transaction.should_not be_valid
34
- end
6
+ it "should create a transaction" do
7
+ transaction = FactoryGirl.build(:transaction_with_credit_and_debit)
8
+ transaction.save!
9
+ end
10
+
11
+ it "should not be valid without a credit amount" do
12
+ transaction = FactoryGirl.build(:transaction)
13
+ transaction.debit_amounts << FactoryGirl.build(:debit_amount, :transaction => transaction)
14
+ transaction.should_not be_valid
15
+ transaction.errors['base'].should include("Transaction must have at least one credit amount")
16
+ end
17
+
18
+ it "should not be valid with an invalid credit amount" do
19
+ transaction = FactoryGirl.build(:transaction)
20
+ transaction.debit_amounts << FactoryGirl.build(:debit_amount, :transaction => transaction)
21
+ transaction.credit_amounts << FactoryGirl.build(:credit_amount, :transaction => transaction, :amount => nil)
22
+ transaction.should_not be_valid
23
+ transaction.errors[:credit_amounts].should == ["is invalid"]
24
+ end
25
+
26
+ it "should not be valid without a debit amount" do
27
+ transaction = FactoryGirl.build(:transaction)
28
+ transaction.credit_amounts << FactoryGirl.build(:credit_amount, :transaction => transaction)
29
+ transaction.should_not be_valid
30
+ transaction.errors['base'].should include("Transaction must have at least one debit amount")
31
+ end
32
+
33
+ it "should not be valid with an invalid debit amount" do
34
+ transaction = FactoryGirl.build(:transaction)
35
+ transaction.credit_amounts << FactoryGirl.build(:credit_amount, :transaction => transaction)
36
+ transaction.debit_amounts << FactoryGirl.build(:debit_amount, :transaction => transaction, :amount => nil)
37
+ transaction.should_not be_valid
38
+ transaction.errors[:debit_amounts].should == ["is invalid"]
39
+ end
40
+
41
+ it "should not be valid without a description" do
42
+ transaction = FactoryGirl.build(:transaction_with_credit_and_debit, :description => nil)
43
+ transaction.should_not be_valid
44
+ transaction.errors[:description].should == ["can't be blank"]
45
+ end
46
+
47
+ it "should require the debit and credit amounts to cancel" do
48
+ transaction = FactoryGirl.build(:transaction)
49
+ transaction.credit_amounts << FactoryGirl.build(:credit_amount, :amount => 100, :transaction => transaction)
50
+ transaction.debit_amounts << FactoryGirl.build(:debit_amount, :amount => 200, :transaction => transaction)
51
+ transaction.should_not be_valid
52
+ transaction.errors['base'].should == ["The credit and debit amounts are not equal"]
53
+ end
54
+
55
+ it "should have a polymorphic commercial document associations" do
56
+ mock_document = FactoryGirl.create(:asset) # one would never do this, but it allows us to not require a migration for the test
57
+ transaction = FactoryGirl.build(:transaction_with_credit_and_debit, :commercial_document => mock_document)
58
+ transaction.save
59
+ saved_transaction = Transaction.find(transaction.id)
60
+ saved_transaction.commercial_document.should == mock_document
61
+ end
62
+
63
+ it "should allow building a transaction and credit and debits with a hash" do
64
+ FactoryGirl.create(:asset, :name => "Accounts Receivable")
65
+ FactoryGirl.create(:revenue, :name => "Sales Revenue")
66
+ FactoryGirl.create(:liability, :name => "Sales Tax Payable")
67
+ mock_document = FactoryGirl.create(:asset)
68
+ transaction = Transaction.build(
69
+ description: "Sold some widgets",
70
+ commercial_document: mock_document,
71
+ debits: [
72
+ {account: "Accounts Receivable", amount: 50}],
73
+ credits: [
74
+ {account: "Sales Revenue", amount: 45},
75
+ {account: "Sales Tax Payable", amount: 5}])
76
+ transaction.should be_valid
77
+ transaction.save
78
+ saved_transaction = Transaction.find(transaction.id)
79
+ saved_transaction.commercial_document.should == mock_document
80
+ end
35
81
 
36
- it "should not be valid without a description" do
37
- transaction = Factory.build(:transaction, :description => nil)
38
- transaction.should_not be_valid
39
- end
40
-
41
- it "should have a polymorphic commercial document associations" do
42
- mock_document = Factory(:transaction) # one would never do this, but it allows us to not require a migration for the test
43
- transaction = Factory(:transaction, :commercial_document => mock_document)
44
- saved_transaction = Transaction.find(transaction.id)
45
- saved_transaction.commercial_document.should == mock_document
46
82
  end
47
-
48
83
  end
@@ -1,29 +1,32 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe AccountsController do
4
- describe "routing" do
5
- it "recognizes and generates #index" do
6
- { :get => "/accounts" }.should route_to(:controller => "accounts", :action => "index")
7
- end
3
+ module Plutus
4
+ describe AccountsController do
5
+ # Run these tests if you enable routing in your rails app. See README
6
+ #describe "routing" do
7
+ #it "recognizes and generates #index" do
8
+ #{ :get => "/accounts" }.should route_to(:controller => "accounts", :action => "index")
9
+ #end
8
10
 
9
- it "recognizes and generates #show" do
10
- { :get => "/accounts/1" }.should route_to(:controller => "accounts", :action => "show", :id => "1")
11
- end
11
+ #it "recognizes and generates #show" do
12
+ #{ :get => "/accounts/1" }.should route_to(:controller => "accounts", :action => "show", :id => "1")
13
+ #end
12
14
 
13
- it "recognizes and generates #edit" do
14
- { :get => "/accounts/1/edit" }.should_not be_routable
15
- end
15
+ #it "recognizes and generates #edit" do
16
+ #{ :get => "/accounts/1/edit" }.should_not be_routable
17
+ #end
16
18
 
17
- it "recognizes and generates #create" do
18
- { :post => "/accounts" }.should_not be_routable
19
- end
19
+ #it "recognizes and generates #create" do
20
+ #{ :post => "/accounts" }.should_not be_routable
21
+ #end
20
22
 
21
- it "recognizes and generates #update" do
22
- { :put => "/accounts/1" }.should_not be_routable
23
- end
23
+ #it "recognizes and generates #update" do
24
+ #{ :put => "/accounts/1" }.should_not be_routable
25
+ #end
24
26
 
25
- it "recognizes and generates #destroy" do
26
- { :delete => "/accounts/1" }.should_not be_routable
27
- end
27
+ #it "recognizes and generates #destroy" do
28
+ #{ :delete => "/accounts/1" }.should_not be_routable
29
+ #end
30
+ #end
28
31
  end
29
32
  end