Can I apply it to other environments?
qcgm1978 opened this issue · comments
Hello:
I want to know whether I can apply it like qunit, e.g. I include a js file and write test code.
I see the prerequisites in readme file as follows:
Ruby on Rails, 3.2.x
jquery-rails
Does it mean I can't apply it in other environments?
Best Regards
Hi,
You can definitely use it without Rails. But you'll still need jQuery in your project.
So to get this working in other kinds of projects, you will need to:
-
gem install cactus
or copyvendor/assets/javascripts/cactus.js
somewhere -
Include jQuery in your layout
-
Add the following in the bottom of your layout
<script src='/cactus.js' type='text/javascript'></script> <script src='/spec.js' type='text/javascript'></script>
If you have a number of spec files, include them according after cactus.js
.
Hope this helps!
Thank you!
Hello:
Thanks a lot. It works directly referenced in html like the deom: http://jsbin.com/OpABeYa/3/edit?html,js,output
Best Regards