       it 'prefers to replace a selector within the popup', ->
         $outside = affix('.foo').text('old outside')
         $link = affix('.link')
-        up.popup.attach($link, href: '/path', target: '.foo')
+        up.popup.attach($link, target: '.foo')
         @respondWith("<div class='foo'>old inside</div>")
         up.extract('.foo', "<div class='foo'>new text</div>")
         expect($outside).toBeInDOM()

      it 'auto-closes the popup when a replacement from inside the popup affects a selector behind the popup', ->
        affix('.outside').text('old outside')
        $link = affix('.link')
        up.popup.attach($link, href: '/path', target: '.inside')
        @respondWith("<div class='inside'>old inside</div>")
        up.extract('.outside', "<div class='outside'>new outside</div>", origin: $('.inside'))
        expect($('.outside')).toHaveText('new outside')

      it 'closes a popup on mousedown (in case an [up-instant] link removes its parent and thus a click event never fires)', ->
        affix('.outside').text('old outside')
        $link = affix('.link')
        up.popup.attach($link, target: '.inside')
        @respondWith("<div class='inside'>inside</div>")
        Trigger.mousedown($('body'))
        expect($('.up-popup')).not.toExist()
