relevance / blue-ridge

Framework for JavaScript Testing (currently a Rails Plugin)
http://groups.google.com/group/blueridgejs
MIT License
480 stars 40 forks source link

patch: automatically create fixutres from templates #14

Closed drnic closed 15 years ago

drnic commented 15 years ago

NOTE: For details see commit message in link below

I've ported a gist (http://gist.github.com/148947) from Jonas Nicklas into the blue_ridge + javascript_spec generators.

http://github.com/drnic/blue-ridge/commit/0d425952e40fec35b48e6d2a29c00f92c95b2247 (subsequent commit has patch to README for contributors)

If you're using rspec + pass a relative path to a rails template (e.g. accounts/new.html.rb) then the fixture file will be automatically rendered from the template.

Just run "spec spec/javascripts/accounts_new_spec.rb" (after setting up what data you want for the template).

It's only available for rspec since it uses rspec's view render mechanism.

drnic commented 15 years ago

Added a css() helper to insert css tags into fixtures, like the require() helper inserts Githubissues.

  • Githubissues is a development platform for aggregating issues.