Giter Site home page Giter Site logo

rspec-haml-scaffold-generator's Introduction

RSpec Haml Scaffold Generator

This is an uber version of the RSpec Scaffold Generator, the following things have been added:

Support for Haml instead of erb Nested routes (nested tests/migrations)

Installation:

sudo gem install zachinglis-rspec-haml-scaffold

Examples:

./script/generate rspec_haml_scaffold post # no attributes, view will be anemic
./script/generate rspec_haml_scaffold post attribute:string attribute:boolean # this is actually broken at the moment, don't do this !!! Feel free to patch it

Credits

* Daniel Fischer - http://danielfischer.com
* Zach Inglis - http://zachinglis.com

rspec-haml-scaffold-generator's People

Contributors

maleko avatar zachinglis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rspec-haml-scaffold-generator's Issues

some problems with giles generateds

look

halan@halan-laptop:/teste/vendor/plugins$ git clone git://github.com/dfischer/rspec-haml-scaffold-generator.git
Initialized empty Git repository in /home/halan/teste/vendor/plugins/rspec-haml-scaffold-generator/.git/
remote: Counting objects: 99, done.
Receiving objects: 100% (99/99), 16.27 KiB, done.
Resolving deltas: 100% (44/44), done.
remote: Compressing objects: 100% (58/58), done.
remote: Total 99 (delta 44), reused 69 (delta 32)
halan@halan-laptop:
/teste/vendor/plugins$ cd ..
halan@halan-laptop:/teste/vendor$ cd ..
halan@halan-laptop:
/teste$ ./script/generate rspec_haml_scaffold User nome:string senha:string
route map.resources User
exists app/models
exists app/controllers/
exists app/helpers/
create app/views/users
create spec/controllers/
create spec/models
create spec/helpers/
create spec/fixtures
create spec/views/users
create spec/controllers/users_controller_spec.rb
create app/controllers/users_controller.rb
create spec/helpers/users_helper_spec.rb
create app/helpers/users_helper.rb
create app/views/users/index.html.haml
create app/views/users/show.html.haml
create app/views/users/new.html.haml
create app/views/users/edit.html.haml
create app/models/user.rb
create spec/fixtures/users.yml
create spec/models/user_spec.rb
create spec/views/users/edit.html.haml_spec.rb
create spec/views/users/index.html.haml_spec.rb
create spec/views/users/new.html.haml_spec.rb
create spec/views/users/show.html.haml_spec.rb
create db/migrate
create db/migrate/20091208112629_create_users.rb
halan@halan-laptop:~/teste$ rake db:migrate
(in /home/halan/teste)
== CreateUsers: migrating ====================================================
-- create_table(:users)
-> 0.1579s
== CreateUsers: migrated (0.1581s) ===========================================

halan@halan-laptop:/teste$ rake spec
(in /home/halan/teste)
halan@halan-laptop:
/teste$ ./script/generate rspec
exists lib/tasks
create lib/tasks/rspec.rake
create script/autospec
create script/spec
exists spec
create spec/rcov.opts
create spec/spec.opts
create spec/spec_helper.rb
halan@halan-laptop:~/teste$ rake spec
(in /home/halan/teste)
FFFFFFF.FF..........................FFFFF.FFF

NameError in 'UsersController handling DELETE /User/1 should find the user requested'
undefined local variable or method users_url' for #<UsersController:0xb6c6b770> /home/halan/teste/app/controllers/users_controller.rb:81:indestroy'
/home/halan/teste/app/controllers/users_controller.rb:80:in destroy' ./spec/controllers/users_controller_spec.rb:306:indo_delete'
./spec/controllers/users_controller_spec.rb:311:

NameError in 'UsersController handling DELETE /User/1 should call destroy on the found user'
undefined local variable or method users_url' for #<UsersController:0xb6c5a358> /home/halan/teste/app/controllers/users_controller.rb:81:indestroy'
/home/halan/teste/app/controllers/users_controller.rb:80:in destroy' ./spec/controllers/users_controller_spec.rb:306:indo_delete'
./spec/controllers/users_controller_spec.rb:316:

NameError in 'UsersController handling DELETE /User/1 should redirect to the Users list'
undefined local variable or method users_url' for #<UsersController:0xb6c4d554> /home/halan/teste/app/controllers/users_controller.rb:81:indestroy'
/home/halan/teste/app/controllers/users_controller.rb:80:in destroy' ./spec/controllers/users_controller_spec.rb:306:indo_delete'
./spec/controllers/users_controller_spec.rb:320:

NoMethodError in 'UsersController handling PUT /Users/1 should find the user requested'
undefined method user_path' for #<UsersController:0xb6c40750> /home/halan/teste/app/controllers/users_controller.rb:65:inupdate'
/home/halan/teste/app/controllers/users_controller.rb:62:in update' ./spec/controllers/users_controller_spec.rb:264:input_with_successful_update'
./spec/controllers/users_controller_spec.rb:274:

NoMethodError in 'UsersController handling PUT /Users/1 should update the found user'
undefined method user_path' for #<UsersController:0xb6c337bc> /home/halan/teste/app/controllers/users_controller.rb:65:inupdate'
/home/halan/teste/app/controllers/users_controller.rb:62:in update' ./spec/controllers/users_controller_spec.rb:264:input_with_successful_update'
./spec/controllers/users_controller_spec.rb:278:

NoMethodError in 'UsersController handling PUT /Users/1 should assign the found user for the view'
undefined method user_path' for #<UsersController:0xb6c27048> /home/halan/teste/app/controllers/users_controller.rb:65:inupdate'
/home/halan/teste/app/controllers/users_controller.rb:62:in update' ./spec/controllers/users_controller_spec.rb:264:input_with_successful_update'
./spec/controllers/users_controller_spec.rb:283:

NoMethodError in 'UsersController handling PUT /Users/1 should redirect to the user on successful update'
undefined method user_path' for #<UsersController:0xb6c1a8d4> /home/halan/teste/app/controllers/users_controller.rb:65:inupdate'
/home/halan/teste/app/controllers/users_controller.rb:62:in update' ./spec/controllers/users_controller_spec.rb:264:input_with_successful_update'
./spec/controllers/users_controller_spec.rb:288:

NoMethodError in 'UsersController handling POST /Users should create a new user'
undefined method user_path' for #<UsersController:0xb6c02d74> /home/halan/teste/app/controllers/users_controller.rb:48:increate'
/home/halan/teste/app/controllers/users_controller.rb:45:in create' ./spec/controllers/users_controller_spec.rb:231:inpost_with_successful_save'
./spec/controllers/users_controller_spec.rb:241:

NoMethodError in 'UsersController handling POST /Users should redirect to the new user on successful save'
undefined method user_path' for #<UsersController:0xb6bf5d04> /home/halan/teste/app/controllers/users_controller.rb:48:increate'
/home/halan/teste/app/controllers/users_controller.rb:45:in create' ./spec/controllers/users_controller_spec.rb:231:inpost_with_successful_save'
./spec/controllers/users_controller_spec.rb:245:

Test::Unit::AssertionFailedError in 'UsersController#route_for should map { :controller => 'Users', :action => 'show', :id => 1 } to /Users/1'
The recognized options <{"action"=>"show", "id"=>"1", "controller"=>"Users"}> did not match <{"action"=>"show", "id"=>1, "controller"=>"Users"}>, difference: <{"id"=>1}>
If you're expecting this failure, we suggest {:get=>"/Users/1"}.should_not be_routable
./spec/controllers/users_controller_spec.rb:14:

Test::Unit::AssertionFailedError in 'UsersController#route_for should map { :controller => 'Users', :action => 'edit', :id => 1 } to /Users/1/edit'
The recognized options <{"action"=>"edit", "id"=>"1", "controller"=>"Users"}> did not match <{"action"=>"edit", "id"=>1, "controller"=>"Users"}>, difference: <{"id"=>1}>
If you're expecting this failure, we suggest {:get=>"/Users/1/edit"}.should_not be_routable
./spec/controllers/users_controller_spec.rb:18:

Test::Unit::AssertionFailedError in 'UsersController#route_for should map { :controller => 'Users', :action => 'update', :id => 1} to /Users/1'
The recognized options <{"action"=>"show", "id"=>"1", "controller"=>"Users"}> did not match <{"action"=>"update", "id"=>1, "controller"=>"Users"}>, difference: <{"action"=>"update", "id"=>1}>
If you're expecting this failure, we suggest {:get=>"/Users/1"}.should_not be_routable
./spec/controllers/users_controller_spec.rb:22:

Test::Unit::AssertionFailedError in 'UsersController#route_for should map { :controller => 'Users', :action => 'destroy', :id => 1} to /Users/1'
The recognized options <{"action"=>"show", "id"=>"1", "controller"=>"Users"}> did not match <{"action"=>"destroy", "id"=>1, "controller"=>"Users"}>, difference: <{"action"=>"destroy", "id"=>1}>
If you're expecting this failure, we suggest {:get=>"/Users/1"}.should_not be_routable
./spec/controllers/users_controller_spec.rb:26:

ActionView::MissingTemplate in '/Users/index.html.haml should render list of users'
Missing template Users/index.html.haml in view path /home/halan/teste/app/views:
./spec/views/users/index.html.haml_spec.rb:18:

ActionView::MissingTemplate in '/Users/new.html.haml should render new form'
Missing template Users/new.html.haml in view path /home/halan/teste/app/views:
./spec/views/users/new.html.haml_spec.rb:15:

ActionView::MissingTemplate in '/User/edit.html.haml should render edit form'
Missing template Users/edit.html.haml in view path /home/halan/teste/app/views:
./spec/views/users/edit.html.haml_spec.rb:14:

ActionView::MissingTemplate in '/Users/show.html.haml should render attributes in

'
Missing template Users/show.html.haml in view path /home/halan/teste/app/views:
./spec/views/users/show.html.haml_spec.rb:15:

Finished in 0.485945 seconds

45 examples, 17 failures
rake aborted!
Command /usr/bin/ruby1.8 -I"lib" "/home/halan/.gem/ruby/1.8/gems/rspec-1.2.9/bin/spec" "spec/views/users/show.html.haml_spec.rb" "spec/views/users/edit.html.haml_spec.rb" "spec/views/users/new.html.haml_spec.rb" "spec/views/users/index.html.haml_spec.rb" "spec/controllers/users_controller_spec.rb" "spec/models/user_spec.rb" "spec/helpers/users_helper_spec.rb" --options "/home/halan/teste/spec/spec.opts" failed

(See full trace by running task with --trace)
halan@halan-laptop:~/teste$

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.