bento 0.0.2 → 0.0.3

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 (52) hide show
  1. data/README.rdoc +38 -5
  2. data/lib/bento.rb +1 -0
  3. data/lib/bento/controllers/account_scopable.rb +75 -43
  4. data/lib/bento/models/modules/user_association.rb +2 -1
  5. data/lib/bento/models/user.rb +24 -0
  6. data/lib/bento/rails/routes.rb +7 -2
  7. data/lib/bento/version.rb +1 -1
  8. data/lib/generators/active_record/bento_generator.rb +5 -5
  9. data/lib/generators/active_record/templates/bento_membership_migration.rb +25 -0
  10. data/lib/generators/bento/orm_helpers.rb +50 -0
  11. data/spec/bento/models/modules/user_accessors_spec.rb +12 -2
  12. data/spec/bento/models/user_spec.rb +24 -0
  13. data/spec/controllers/bento_for_custom_routes_spec.rb +38 -0
  14. data/spec/controllers/bento_for_detault_routes_spec.rb +23 -0
  15. data/spec/controllers/bento_for_nested_routes_spec.rb +28 -0
  16. data/spec/rails_app/app/models/account.rb +3 -1
  17. data/spec/rails_app/app/models/bento_membership.rb +6 -0
  18. data/spec/rails_app/app/models/user.rb +8 -3
  19. data/spec/rails_app/app/views/layouts/application.html.erb +6 -1
  20. data/spec/rails_app/app/views/projects/_my_accounts.html.erb +6 -0
  21. data/spec/rails_app/app/views/projects/_my_projects.html.erb +9 -0
  22. data/spec/rails_app/app/views/projects/index.html.erb +4 -0
  23. data/spec/rails_app/config/environment.rb +4 -0
  24. data/spec/rails_app/db/development.sqlite3 +0 -0
  25. data/spec/rails_app/db/migrate/20101015094514_bento_create_accounts.rb +0 -1
  26. data/spec/rails_app/db/migrate/20110821091847_add_plan_to_accounts.rb +9 -0
  27. data/spec/rails_app/db/migrate/20110821095924_bento_create_bento_memberships.rb +25 -0
  28. data/spec/rails_app/{log/production.log → db/production.sqlite3} +0 -0
  29. data/spec/rails_app/db/schema.rb +11 -3
  30. data/spec/rails_app/db/test.sqlite3 +0 -0
  31. data/spec/rails_app/log/development.log +78 -72
  32. data/spec/rails_app/log/test.log +32588 -33752
  33. data/spec/rails_app/tmp/capybara/capybara-201108261408529518409580.html +23 -0
  34. data/spec/rails_app/tmp/capybara/capybara-201108261409354283519857.html +23 -0
  35. data/spec/rails_app/tmp/capybara/capybara-201108261411215267908820.html +36 -0
  36. data/spec/rails_app/tmp/capybara/capybara-201108261411377094743316.html +36 -0
  37. data/spec/rails_app/tmp/capybara/capybara-201108261607322084409756.html +34 -0
  38. data/spec/rails_app/tmp/capybara/capybara-201108261612128889477667.html +34 -0
  39. data/spec/rails_app/tmp/capybara/capybara-201108261614323748273234.html +34 -0
  40. data/spec/rails_app/tmp/capybara/capybara-201108261614562813014420.html +34 -0
  41. data/spec/rails_app/tmp/capybara/capybara-201108261615145359399760.html +34 -0
  42. data/spec/rails_app/tmp/capybara/capybara-201108261616296916249304.html +34 -0
  43. data/spec/rails_app/tmp/capybara/capybara-201108261617171731033403.html +34 -0
  44. data/spec/rails_app/tmp/capybara/capybara-201108261617339533158457.html +36 -0
  45. data/spec/rails_app/tmp/capybara/capybara-201108261620375648320872.html +41 -0
  46. data/spec/spec_helper.rb +7 -3
  47. data/spec/support/bento_spec_helper.rb +2 -2
  48. data/spec/support/blueprints.rb +0 -1
  49. metadata +97 -96
  50. data/spec/bento_spec.rb +0 -4
  51. data/spec/controllers/bento_for_routes_spec.rb +0 -55
  52. data/spec/rails_app/log/server.log +0 -0
@@ -1,4 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Bento do
4
- end
@@ -1,55 +0,0 @@
1
- require 'spec_helper'
2
-
3
- class SitesController < ActionController::Base
4
- def show; render(:text => "s"); end
5
- def index; render(:text => "i"); end
6
- def new; render(:text => "n"); end
7
- def edit; render(:text => "e"); end
8
- def create; redirect_to sites_url; end
9
- def update; redirect_to sites_url; end
10
- def destroy; redirect_to sites_url; end
11
- end
12
-
13
- context "with the default bento controller" do
14
- describe Bento::AccountsController do
15
- before { controller.stubs(:authenticate_user!) }
16
- let(:account) { Account.make }
17
-
18
- describe "#bento_for" do
19
- it "defines resource routes" do
20
- with_routing do |map|
21
- map.draw { bento_for :accounts }
22
-
23
- get(:show, :id => account.id); response.should be_success
24
- get(:index); response.should be_success
25
- get(:sign_up); response.should be_success
26
- get(:new, :id => account.id); response.should be_success
27
- get(:edit, :id => account.id); response.should be_success
28
- post(:create); response.should be_redirect
29
- put(:update, :id => account.id); response.should be_redirect
30
- put(:destroy, :id => account.id); response.should be_redirect
31
- end
32
- end
33
- end
34
- end
35
- end
36
-
37
- context "with a custonly defined controller" do
38
- describe SitesController do
39
- describe "#bento_for" do
40
- it "defines resource routes" do
41
- with_routing do |map|
42
- map.draw { bento_for :sites }
43
-
44
- get(:show, :id => 1); response.should be_success
45
- get(:index); response.should be_success
46
- get(:new, :id => 1); response.should be_success
47
- get(:edit, :id => 1); response.should be_success
48
- post(:create); response.should be_redirect
49
- put(:update, :id => 1); response.should be_redirect
50
- put(:destroy, :id => 1); response.should be_redirect
51
- end
52
- end
53
- end
54
- end
55
- end
File without changes