Project

siesta

0.01
No commit activity in last 3 years
No release in over 3 years
A rails mountable engine setting up siesta for testing ExtJS
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 3.2.6
~> 0.5.1
 Project Readme

Siesta

Build Status Dependency Status Code Climate

A rails mountable engine setting up siesta for testing ExtJS.

Install

Add siesta to Gemfile:

gem 'siesta'

And then run bundle install to install siesta. That's all.

Usage

  • Mount the engine in your rails application.
# config/routes
if Rails.env.development?
  mount Siesta::Engine => '/'
end
  • (OPTIONAL) Configure siesta.

    • spec_dir - Default directory of specs is spec/javascripts, so you should create you specs under spec/javascripts by default. But you could change the default value through an initializer.

      # config/initializers/siesta.rb
      Siesta.configure do |config|
        config.spec_dir = 'test/javascripts'
      end
    • auto_organizing - Organizing the tests by folders, default is true.

      # config/initializers/siesta.rb
      Siesta.configure do |config|
        config.auto_organizing = false
      end

      If you do not enable auto_organizing function, you need to create a test_harness.js under spec_dir to organize your tests.

      var Harness = Siesta.Harness.Browser.ExtJS;
      
      Harness.start({
        group               : 'Sample',
        items               : [
          '/assets/sample.t.js'
        ]
      });
  • Create your specs under the directory of specs.

// spec/javascripts/sample.t.js
StartTest(function(t) {
  t.ok(1 == 1, 'A sample test');
})    
  • Create spec/javascripts/test_harness.js to start.
// spec/javascript/test_harness.js
var Harness = Siesta.Harness.Browser.ExtJS;

Harness.start({
  group: 'Sample',
  items: ['/assets/sample.t.js']
});
rails s
// spec/javascripts/siesta_config.js
Siesta.Harness.Browser.ExtJS.configure({
  title: 'Dummy App',
  loaderPath: { 'DummyApp' : '/assets/extjs/app' },

  preload : [
    "/assets/extjs/resources/css/ext-all.css",
    "/assets/extjs/ext-all-debug.js"
  ]
});

For more detail about how to test your ExtJS, please visit: http://www.bryntum.com/products/siesta/docs/

License

This project rocks and uses GPLv3.