Sha256: 3f439635357fcfccb0c1b45c06cff81be63ef4fd467927d155df57336afbef3e
Contents?: true
Size: 933 Bytes
Versions: 30
Compression:
Stored size: 933 Bytes
Contents
describe "Mercury.modalHandlers.htmlEditor", -> template 'mercury/modals/htmleditor.html' beforeEach -> @modal = element: $('#test') hide: -> Mercury.region = content: -> '<span>html \ncontent</span>' Mercury.modalHandlers.htmlEditor.call(@modal) describe "loading", -> it "sets the value of the textarea", -> expect($('#test textarea').val()).toEqual('<span>html \ncontent</span>') describe "submitting", -> it "triggers a replaceHTML action", -> spy = spyOn(Mercury, 'trigger').andCallFake(=>) jasmine.simulate.click($('#submit').get(0)) expect(spy.callCount).toEqual(1) expect(spy.argsForCall[0]).toEqual(['action', {action: 'replaceHTML', value: '<span>html content</span>'}]) it "hides the modal", -> spy = spyOn(@modal, 'hide').andCallFake(=>) jasmine.simulate.click($('#submit').get(0)) expect(spy.callCount).toEqual(1)
Version data entries
30 entries across 30 versions & 3 rubygems