Sha256: 9c938eb54e5fa4287cdf4ba9d07c4ea6d3285bf72ad4486505975a7f3911c863
Contents?: true
Size: 1.18 KB
Versions: 5
Compression:
Stored size: 1.18 KB
Contents
describe "Mercury.Regions.Image", -> template 'mercury/regions/image.html' beforeEach -> @regionElement = $('#image_region1') describe "constructor", -> beforeEach -> @buildSpy = spyOn(Mercury.Regions.Image.prototype, 'build').andCallFake(=>) @bindEventsSpy = spyOn(Mercury.Regions.Image.prototype, 'bindEvents').andCallFake(=>) it "expects an element and window", -> @region = new Mercury.Regions.Image(@regionElement, window) expect(@region.element.get(0)).toEqual($('#image_region1').get(0)) expect(@region.window).toEqual(window) it "accepts options", -> @region = new Mercury.Regions.Image(@regionElement, window, {foo: 'something'}) expect(@region.options).toEqual({foo: 'something'}) it "sets it's type", -> @region = new Mercury.Regions.Image(@regionElement, window) expect(@region.type()).toEqual('image') it "calls build", -> @region = new Mercury.Regions.Image(@regionElement, window) expect(@buildSpy.callCount).toEqual(1) it "calls bindEvents", -> @region = new Mercury.Regions.Image(@regionElement, window) expect(@bindEventsSpy.callCount).toEqual(1)
Version data entries
5 entries across 5 versions & 1 rubygems