Sha256: ea5d0de1d94fd01b5a4fd5fad704627a71a05ebf3b4b9ea58ae7898943b3c5db

Contents?: true

Size: 1.61 KB

Versions: 4

Compression:

Stored size: 1.61 KB

Contents

describe 'up.link', ->
  
  describe 'Javascript functions', ->
  
    describe 'up.follow', ->
      
      if up.browser.canPushState()
      
        it 'loads the given link via AJAX and replaces the response in the given target', (done) ->
          jasmine.Ajax.install()
    
          affix('.before').text('old-before')
          affix('.middle').text('old-middle')
          affix('.after').text('old-after')
          $link = affix('a[href="/path"][up-target=".middle"]')
    
          promise = up.follow($link)
    
          jasmine.Ajax.requests.mostRecent().respondWith
            status: 200
            contentType: 'text/html'
            responseText:
              """
              <div class="before">new-before</div>
              <div class="middle">new-middle</div>
              <div class="after">new-after</div>
              """      
          
          promise.then ->
            expect($('.before')).toHaveText('old-before')
            expect($('.middle')).toHaveText('new-middle')
            expect($('.after')).toHaveText('old-after')
            done()
            
      else
        
        it 'follows the given link', ->
          $link = affix('a[href="/path"][up-target=".middle"]')
          spyOn(up.browser, 'loadPage')
          up.follow($link)
          expect(up.browser.loadPage).toHaveBeenCalledWith('/path', jasmine.anything())
          

    describe 'up.visit', ->
      
      it 'should have tests'
          
  describe 'unobtrusive behavior', ->

    describe 'a[up-target]', ->

      it 'should have tests'

    describe '[up-follow]', ->

      it 'should have tests'
      
      

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
upjs-rails-0.4.1 spec_app/spec/javascripts/up/link_spec.js.coffee
upjs-rails-0.4.0 spec_app/spec/javascripts/up/link_spec.js.coffee
upjs-rails-0.3.3 spec_app/spec/javascripts/up/link_spec.js.coffee
upjs-rails-0.3.2 spec_app/spec/javascripts/up/link_spec.js.coffee