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: """