Sha256: 2caeccb088b7fce420c4a868d8b3d6187c94a58c2c9a3426eef28df8fe2a9991

Contents?: true

Size: 849 Bytes

Versions: 2

Compression:

Stored size: 849 Bytes

Contents

module "Cartilage.Views.ImageView"
  setup: ->
    @imageView = new Cartilage.Views.ImageView

test "isLoaded property should be read-only", 1, ->
  @imageView.isLoaded = true
  ok @imageView.isLoaded == false, "isLoaded should be false"

test "isError property should be read-only", 1, ->
  @imageView.isError = true
  ok @imageView.isError == false, "isError should be false"
  
asyncTest "should fire load event upon successful load", 1, ->
  @imageView.on "load", ->
    ok true, 'load called'
    start()

  @imageView.imageAddress = "http://www.placehold.it/500x500"
  $('#testElement').html @imageView.render().el 

asyncTest "should fire error event upon unsuccessful load attempt", 1, ->
  @imageView.on "error", ->
    ok true, 'error called'
    start()

  @imageView.imageAddress = '404'
  $('#testElement').html @imageView.render().el 

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cartilage-0.1.2 test/framework/cartilage/views/image_view_test.js.coffee
cartilage-0.1.1 test/framework/cartilage/views/image_view_test.js.coffee