Sha256: b25cf786e7c30120858154ab83554257319de2ce785917fc3ee411a3be4006f5

Contents?: true

Size: 1.72 KB

Versions: 8

Compression:

Stored size: 1.72 KB

Contents

describe 'up.modal', ->
  
  describe 'Javascript functions', ->
    
    describe 'up.modal.defaults', ->
      
      it 'should have tests'
        
    describe 'up.modal.open', ->

      it "loads the given link's destination in a dialog window", (done) ->
        $link = affix('a[href="/path/to"][up-modal=".middle"]').text('link')
        promise = up.modal.open($link)
        request = jasmine.Ajax.requests.mostRecent()
        expect(request.url).toMatch /\/path\/to$/
        request.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($('.up-modal')).toExist()
          expect($('.up-modal-dialog')).toExist()
          expect($('.up-modal-dialog .middle')).toExist()
          expect($('.up-modal-dialog .middle')).toHaveText('new-middle')
          expect($('.up-modal-dialog .before')).not.toExist()
          expect($('.up-modal-dialog .after')).not.toExist()
          done()

    describe 'up.modal.close', ->

      it 'should have tests'

    describe 'up.modal.source', ->

      it 'should have tests'

  describe 'unobtrusive behavior', ->
    
    describe 'a[up-modal]', ->
      
      it 'should have tests'
      
    describe '[up-close]', ->
      
      it 'should have tests'

    describe 'when following links inside a modal', ->

      it 'prefers to replace a selector within the modal'

      it 'auto-closes the modal if a selector behind the modal gets replaced'

      it "doesn't auto-close the modal if a selector behind the modal if the modal is sticky"

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
upjs-rails-0.7.3 spec_app/spec/javascripts/up/modal_spec.js.coffee
upjs-rails-0.7.2 spec_app/spec/javascripts/up/modal_spec.js.coffee
upjs-rails-0.7.1 spec_app/spec/javascripts/up/modal_spec.js.coffee
upjs-rails-0.7.0 spec_app/spec/javascripts/up/modal_spec.js.coffee
upjs-rails-0.6.5 spec_app/spec/javascripts/up/modal_spec.js.coffee
upjs-rails-0.6.4 spec_app/spec/javascripts/up/modal_spec.js.coffee
upjs-rails-0.6.3 spec_app/spec/javascripts/up/modal_spec.js.coffee
upjs-rails-0.6.2 spec_app/spec/javascripts/up/modal_spec.js.coffee