describe 'up.link', -> describe 'Javascript functions', -> describe 'up.follow', -> 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: """
new-before
new-middle
new-after
""" promise.then -> expect($('.before')).toHaveText('old-before') expect($('.middle')).toHaveText('new-middle') expect($('.after')).toHaveText('old-after') done() 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'