technicalpickles-shoulda_generator 0.1.2 → 0.2.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 (56) hide show
  1. data/LICENSE +20 -0
  2. data/README.markdown +46 -48
  3. data/Rakefile +23 -7
  4. data/TODO +8 -0
  5. data/VERSION.yml +4 -0
  6. data/test/fixtures/about_yml_plugins/bad_about_yml/about.yml +1 -0
  7. data/test/fixtures/about_yml_plugins/bad_about_yml/init.rb +1 -0
  8. data/test/fixtures/about_yml_plugins/plugin_without_about_yml/init.rb +1 -0
  9. data/test/fixtures/eager/zoo.rb +3 -0
  10. data/test/fixtures/eager/zoo/reptile_house.rb +2 -0
  11. data/test/fixtures/environment_with_constant.rb +1 -0
  12. data/test/fixtures/lib/generators/missing_class/missing_class_generator.rb +0 -0
  13. data/test/fixtures/lib/generators/working/working_generator.rb +2 -0
  14. data/test/fixtures/plugins/alternate/a/generators/a_generator/a_generator.rb +4 -0
  15. data/test/fixtures/plugins/default/gemlike/init.rb +1 -0
  16. data/test/fixtures/plugins/default/gemlike/lib/gemlike.rb +2 -0
  17. data/test/fixtures/plugins/default/gemlike/rails/init.rb +7 -0
  18. data/test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb +0 -0
  19. data/test/fixtures/plugins/default/stubby/about.yml +2 -0
  20. data/test/fixtures/plugins/default/stubby/generators/stubby_generator/stubby_generator.rb +4 -0
  21. data/test/fixtures/plugins/default/stubby/init.rb +7 -0
  22. data/test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb +2 -0
  23. data/test/rails_generators/shoulda_model_generator_test.rb +39 -0
  24. data/test/shoulda_macros/generator_macros.rb +36 -0
  25. data/test/stolen_from_railties.rb +288 -0
  26. data/test/test_helper.rb +41 -0
  27. metadata +74 -55
  28. data/rails_generators/shoulda_model/USAGE +0 -27
  29. data/rails_generators/shoulda_model/shoulda_model_generator.rb +0 -49
  30. data/rails_generators/shoulda_model/templates/factory.rb +0 -5
  31. data/rails_generators/shoulda_model/templates/fixtures.yml +0 -19
  32. data/rails_generators/shoulda_model/templates/migration.rb +0 -16
  33. data/rails_generators/shoulda_model/templates/model.rb +0 -2
  34. data/rails_generators/shoulda_model/templates/unit_test.rb +0 -7
  35. data/rails_generators/shoulda_scaffold/USAGE +0 -25
  36. data/rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb +0 -107
  37. data/rails_generators/shoulda_scaffold/templates/blueprint/ie.css +0 -22
  38. data/rails_generators/shoulda_scaffold/templates/blueprint/print.css +0 -29
  39. data/rails_generators/shoulda_scaffold/templates/blueprint/screen.css +0 -226
  40. data/rails_generators/shoulda_scaffold/templates/controller.rb +0 -72
  41. data/rails_generators/shoulda_scaffold/templates/erb/_form.html.erb +0 -8
  42. data/rails_generators/shoulda_scaffold/templates/erb/edit.html.erb +0 -12
  43. data/rails_generators/shoulda_scaffold/templates/erb/index.html.erb +0 -22
  44. data/rails_generators/shoulda_scaffold/templates/erb/layout.html.erb +0 -23
  45. data/rails_generators/shoulda_scaffold/templates/erb/new.html.erb +0 -8
  46. data/rails_generators/shoulda_scaffold/templates/erb/show.html.erb +0 -12
  47. data/rails_generators/shoulda_scaffold/templates/functional_test/basic.rb +0 -66
  48. data/rails_generators/shoulda_scaffold/templates/functional_test/should_be_restful.rb +0 -13
  49. data/rails_generators/shoulda_scaffold/templates/haml/_form.html.haml +0 -7
  50. data/rails_generators/shoulda_scaffold/templates/haml/edit.html.haml +0 -9
  51. data/rails_generators/shoulda_scaffold/templates/haml/index.html.haml +0 -18
  52. data/rails_generators/shoulda_scaffold/templates/haml/layout.html.haml +0 -15
  53. data/rails_generators/shoulda_scaffold/templates/haml/new.html.haml +0 -7
  54. data/rails_generators/shoulda_scaffold/templates/haml/show.html.haml +0 -10
  55. data/rails_generators/shoulda_scaffold/templates/helper.rb +0 -2
  56. data/shoulda_generator.gemspec +0 -32
@@ -1,66 +0,0 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
-
3
- class <%= controller_class_name %>ControllerTest < ActionController::TestCase
4
- context 'GET to index' do
5
- setup do
6
- get :index
7
- end
8
- should_respond_with :success
9
- should_assign_to :<%= table_name %>
10
- end
11
-
12
- context 'GET to new' do
13
- setup do
14
- get :new
15
- end
16
-
17
- should_respond_with :success
18
- should_render_template :new
19
- should_assign_to :<%= file_name %>
20
- end
21
-
22
- context 'POST to create' do
23
- setup do
24
- post :create, :<%= file_name %> => Factory.attributes_for(:<%= file_name %>)
25
- @<%= file_name %> = <%= class_name %>.find(:all).last
26
- end
27
-
28
- should_redirect_to '<%= file_name %>_path(@<%= file_name %>)'
29
- end
30
-
31
- context 'GET to show' do
32
- setup do
33
- @<%= file_name %> = Factory(:<%= file_name %>)
34
- get :show, :id => @<%= file_name %>.id
35
- end
36
- should_respond_with :success
37
- should_render_template :show
38
- should_assign_to :<%= file_name %>
39
- end
40
-
41
- context 'GET to edit' do
42
- setup do
43
- @<%= file_name %> = Factory(:<%= file_name %>)
44
- get :edit, :id => @<%= file_name %>.id
45
- end
46
- should_respond_with :success
47
- should_render_template :edit
48
- should_assign_to :<%= file_name %>
49
- end
50
-
51
- context 'PUT to update' do
52
- setup do
53
- @<%= file_name %> = Factory(:<%= file_name %>)
54
- put :update, :id => @<%= file_name %>.id, :<%= file_name %> => Factory.attributes_for(:<%= file_name %>)
55
- end
56
- should_redirect_to '<%= file_name %>_path(@<%= file_name %>)'
57
- end
58
-
59
- context 'DELETE to destroy' do
60
- setup do
61
- @<%= file_name %> = Factory(:<%= file_name %>)
62
- delete :destroy, :id => @<%= file_name %>.id
63
- end
64
- should_redirect_to '<%= table_name %>_path'
65
- end
66
- end
@@ -1,13 +0,0 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
-
3
- class <%= controller_class_name %>ControllerTest < ActionController::TestCase
4
-
5
- def setup
6
- @<%= file_name %> = Factory(:<%= file_name %>)
7
- end
8
-
9
- should_be_restful do |resource|
10
- resource.formats = [:html, :xml]
11
- resource.destroy.flash = nil
12
- end
13
- end
@@ -1,7 +0,0 @@
1
- = form.error_messages
2
-
3
- %dl
4
- <% for attribute in attributes -%>
5
- %dt= form.label :<%= attribute.name %>
6
- %dd= form.<%= attribute.field_type %> :<%= attribute.name %>
7
- <% end -%>
@@ -1,9 +0,0 @@
1
- %h1 Editing <%= singular_name %>
2
-
3
- - form_for(@<%= singular_name %>) do |form|
4
- = render :partial => 'form', :locals => {:form => form}
5
- %p= form.submit 'Update'
6
-
7
- %p
8
- = link_to 'Show', @<%= singular_name %>
9
- = link_to 'Back', <%= plural_name %>_path
@@ -1,18 +0,0 @@
1
- %h1 Listing <%= plural_name %>
2
-
3
- %table
4
- %tr
5
- <% for attribute in attributes -%>
6
- %th <%= attribute.column.human_name %>
7
- <% end -%>
8
-
9
- - for <%= singular_name %> in @<%= plural_name %>
10
- %tr
11
- <% for attribute in attributes -%>
12
- %td= h <%= singular_name %>.<%= attribute.name %>
13
- <% end -%>
14
- %td= link_to 'Show', <%= singular_name %>
15
- %td= link_to 'Edit', edit_<%= singular_name %>_path(<%= singular_name %>)
16
- %td= link_to 'Destroy', <%= singular_name %>, :confirm => 'Are you sure?', :method => :delete
17
-
18
- %p= link_to 'New <%= singular_name %>', new_<%= singular_name %>_path
@@ -1,15 +0,0 @@
1
- !!! Transitional
2
- %html
3
- %head
4
- %title= "#{controller.controller_name}: #{controller.action_name}"
5
- = stylesheet_link_tag 'blueprint/screen', :media => 'screen'
6
- = stylesheet_link_tag 'blueprint/print', :media => 'print'
7
- = "<!--[if IE]>#{stylesheet_link_tag 'blueprint/ie', :media => 'screen'}<![endif]-->"
8
- %body
9
- .container
10
-
11
- #content{:class => 'column span-24'}
12
- - flash.each do |key, value|
13
- %div{:class => key}= h(value)
14
-
15
- = yield
@@ -1,7 +0,0 @@
1
- %h1 New <%= singular_name %>
2
-
3
- - form_for(@<%= singular_name %>) do |form|
4
- = render :partial => 'form', :locals => {:form => form}
5
- %p= form.submit "Create"
6
-
7
- %p= link_to 'Back', <%= plural_name %>_path
@@ -1,10 +0,0 @@
1
- %dl
2
- <% for attribute in attributes -%>
3
- %dt <%= attribute.column.human_name %>
4
- %dd= h @<%= singular_name %>.<%= attribute.name %>
5
- <% end -%>
6
-
7
- %p
8
- = link_to 'Edit', edit_<%= singular_name %>_path(@<%= singular_name %>)
9
- |
10
- = link_to 'Back', <%= plural_name %>_path
@@ -1,2 +0,0 @@
1
- module <%= controller_class_name %>Helper
2
- end
@@ -1,32 +0,0 @@
1
- Gem::Specification.new do |s|
2
- s.name = %q{shoulda_generator}
3
- s.version = "0.1.2"
4
-
5
- s.required_rubygems_version = Gem::Requirement.new("= 1.2") if s.respond_to? :required_rubygems_version=
6
- s.authors = ["Josh Nichols"]
7
- s.date = %q{2008-08-28}
8
- s.description = %q{Generators which create tests using shoulda}
9
- s.email = %q{josh@technicalpickles.com}
10
- s.extra_rdoc_files = ["README.markdown"]
11
- s.files = ["rails_generators/shoulda_model/shoulda_model_generator.rb", "rails_generators/shoulda_model/templates/factory.rb", "rails_generators/shoulda_model/templates/fixtures.yml", "rails_generators/shoulda_model/templates/migration.rb", "rails_generators/shoulda_model/templates/model.rb", "rails_generators/shoulda_model/templates/unit_test.rb", "rails_generators/shoulda_model/USAGE", "rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb", "rails_generators/shoulda_scaffold/templates/blueprint/ie.css", "rails_generators/shoulda_scaffold/templates/blueprint/print.css", "rails_generators/shoulda_scaffold/templates/blueprint/screen.css", "rails_generators/shoulda_scaffold/templates/controller.rb", "rails_generators/shoulda_scaffold/templates/erb/_form.html.erb", "rails_generators/shoulda_scaffold/templates/erb/edit.html.erb", "rails_generators/shoulda_scaffold/templates/erb/index.html.erb", "rails_generators/shoulda_scaffold/templates/erb/layout.html.erb", "rails_generators/shoulda_scaffold/templates/erb/new.html.erb", "rails_generators/shoulda_scaffold/templates/erb/show.html.erb", "rails_generators/shoulda_scaffold/templates/functional_test/basic.rb", "rails_generators/shoulda_scaffold/templates/functional_test/should_be_restful.rb", "rails_generators/shoulda_scaffold/templates/haml/_form.html.haml", "rails_generators/shoulda_scaffold/templates/haml/edit.html.haml", "rails_generators/shoulda_scaffold/templates/haml/index.html.haml", "rails_generators/shoulda_scaffold/templates/haml/layout.html.haml", "rails_generators/shoulda_scaffold/templates/haml/new.html.haml", "rails_generators/shoulda_scaffold/templates/haml/show.html.haml", "rails_generators/shoulda_scaffold/templates/helper.rb", "rails_generators/shoulda_scaffold/USAGE", "Rakefile", "README.markdown", "shoulda_generator.gemspec", "Manifest"]
12
- s.has_rdoc = true
13
- s.homepage = %q{http://github.com/technicalpickles/shoulda_generator}
14
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Shoulda_generator", "--main", "README.markdown"]
15
- s.require_paths = ["lib"]
16
- s.rubyforge_project = %q{shoulda_generator}
17
- s.rubygems_version = %q{1.2.0}
18
- s.summary = %q{Generators which create tests using shoulda}
19
-
20
- if s.respond_to? :specification_version then
21
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
22
- s.specification_version = 2
23
-
24
- if current_version >= 3 then
25
- s.add_development_dependency(%q<echoe>, [">= 0"])
26
- else
27
- s.add_dependency(%q<echoe>, [">= 0"])
28
- end
29
- else
30
- s.add_dependency(%q<echoe>, [">= 0"])
31
- end
32
- end