Sha256: 770e16a83d2a0f7866abb8fb6cb8700c99a2b948d890d13e7715fb7082305211

Contents?: true

Size: 827 Bytes

Versions: 4

Compression:

Stored size: 827 Bytes

Contents

helpers = Trix.TestHelpers

helpers.extend
  insertString: (string) ->
    getComposition().insertString(string)
    render()

  insertText: (text) ->
    getComposition().insertText(text)
    render()

  insertDocument: (document) ->
    getComposition().insertDocument(document)
    render()

  insertFile: (file) ->
    getComposition().insertFile(file)
    render()

  insertImageAttachment: (attributes) ->
    attributes ?=
      url: TEST_IMAGE_URL
      width: 10
      height: 10
      filename: "image.gif"
      contentType: "image/gif"

    attachment = new Trix.Attachment attributes
    text = Trix.Text.textForAttachmentWithAttributes(attachment)
    helpers.insertText(text)

  replaceDocument: (document) ->
    getComposition().setDocument(document)
    render()

render = ->
  getEditorController().render()

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vapid-0.1.3 lib/vapid/vendor/trix/test/src/test_helpers/editor_helpers.coffee
vapid-0.1.2 lib/vapid/vendor/trix/test/src/test_helpers/editor_helpers.coffee
vapid-0.1.1 lib/vapid/vendor/trix/test/src/test_helpers/editor_helpers.coffee
vapid-0.1.0 lib/vapid/vendor/trix/test/src/test_helpers/editor_helpers.coffee