Clone the repository.
git clone https://github.com/uploadcare/uploadcare-widget
You need a working Ruby 2.0.0 and above environment with Bundler.
If you don't want to set up the environment to your machine, you can use Vagrant. Just install Vagrant and VirtualBox or other provider.
After opening your terminal, go to this directory and run:
vagrant up
vagrant ssh
In Vagrant run:
bundle install
cd ./test/dummy
bundle install
Inside folder run
npm install
npm run build
bundle install
cd ./test/dummy
bundle install
- run
bundle exec rake js:latest:build
to build assets to the pkg/latest directory (with the “latest” suffix). - run
bundle exec rake js:release:build
to build assets to the pkg/version directory (with the current version suffix). The version is specified inlib/uploadcare-widget/version.rb
.
Go to test/dummy/
. There is a simple Rails app. Run it:
bundle exec rails server
Open http://127.0.0.1:3000/. Follow any link. There's going to be a widget or three. Edit code and reload the page :-)
Use Jasminerice
installed under the test/dummy/
Rails app.
To run tests in your browser go to http://127.0.0.1:3000/jasmine.
For more information, see jasminerice docs.
To run tests in a terminal you must first install phantomjs.
Then, there are two options:
- run
bundle exec guard start
- run
bundle exec guard-jasmine
The first one is for continuous tests execution,
the second one runs tests just once.
Both should be executed from the test/dummy/
directory.
See guard-jasmine docs for more information.