class SomeController
def show
get_result(params[:options])
end
private
def get_result(options)
options[:name] + ' ' + options[:age]
end
end
class ResultModel
def self.get_result(options)
options[:name] + ' ' + options[:age]
end
end
...
def show
ResultModel.get_result(params[:options])
end
describe(function(){
beforeEach(function(){
this.deal = 'Old Navy Stuff';
});
it(function(){
//test!
this.deal === 'Old Navy Stuff';
});
});
describe("mocking Dates", function(){
it("can mock global.Date", function(){
this._Date = Date;
var testContext = this;
spyOn(global, 'Date').andCallFake(function(){
return new testContext._Date(1999, 4, 8);
});
var raw = new Date();
var old = new this._Date(1900, 10, 10);
expect(raw.getFullYear()).not.toEqual(old.getFullYear());
});
});
var frag = fixtures['filename no extension'];
$('#jasmine-content').append(frag);
$('.cards').live('click', function(){
//handle event
});
/* */
function bindEvents() {
$('.cards').live('click', function(){
//handle event
});
}
/