Sha256: afcae97828710ec89f8b61d8decfd9454a9ab2f86829959fdcf337ea17ce9abd

Contents?: true

Size: 819 Bytes

Versions: 9

Compression:

Stored size: 819 Bytes

Contents

#= require services/calculate

describe "Calculate", ->
  before ->
    @service = new Calculate()

  it "should have serviceName 'ex:services:calculate'", ->
    expect(@service.serviceName).to.equal('ex:services:calculate') 

  describe "#calculate", ->
    before ->
      @service.calculate()

    it "should calculate result", ->
      expect(@service.result).to.equal(400)

  describe "#serve", ->
    before ->
      $('#fixtures').html("<div class='calculate'><span class='result'></span></div>")
      $('#fixtures').trigger('ex:services:calculate')
    after ->
      $('#fixtures').empty()

    it "should calculate the result", ->
      expect($('.calculate')).to.have.class('calculate_active')

    it "should render the result to the span.result", ->
      expect($('span.result').text()).to.equal('400')

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
transponder-0.9.0 test/javascripts/transponder/services/calculate_test.coffee
transponder-0.8.2 test/javascripts/transponder/services/calculate_test.coffee
transponder-0.1.5 test/javascripts/transponder/services/calculate_test.coffee
transponder-0.1.4 test/javascripts/transponder/services/calculate_test.coffee
transponder-0.1.3 test/javascripts/transponder/services/calculate_test.coffee
transponder-0.1.2 test/javascripts/transponder/services/calculate_test.coffee
transponder-0.1.1 test/javascripts/transponder/services/calculate_test.coffee
transponder-0.1.0 test/javascripts/transponder/services/calculate_test.coffee
transponder-0.0.8 test/javascripts/transponder/services/calculate_test.coffee