0.0
No commit activity in last 3 years
No release in over 3 years
A small utility which creates the HTML fixtures for Jasmine and JSTestDriver tests from the controller specs.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0.0
~> 1.6.4

Runtime

 Project Readme

JS Fixtures

A gem that allows controller specs to generate markup which can be used as HTML fixtures within javascript tests written using Jasmine and JSTestDriver.

Usage

  • Add the dependency for your gem in Gemfile:

    gem 'js_fixtures',:require => false
    
  • Add the require in spec_helper.rb

    require 'js_fixtures'
    
  • Within the controller specs, call the method to create fixtures as follows:

    save_fixture(html_for('body'),'Signup')
    

The above will save the content of the body in file Signup.js in the path 'spec/javascripts/helpers/'. The file will have a method loadSignupFixture which contains the HTML fixture.

  • Call the same in the JS tests in beforeEach section:
beforeEach(function () {
  $(this).ready(function () {
    loadSignupFixture()
  });
});

Contributing

See the CONTRIBUTING document. Thank you, contributors!

License

JS Fixtures is Copyright (c) 2016 Multunus Software Pvt. Ltd. It is free software, and may be redistributed under the terms specified in the LICENSE file.

About

multunus

JS Fixtures is maintained and funded by Multunus Software Pvt. Ltd. The names and logos for Multunus are trademarks of Multunus Software Pvt. Ltd.

We love open source software! See our other projects or hire us to help build your product.