                     expect($('.up-modal-dialog').length).toBe(1)
                     expect($('.container')).toHaveText('response3')
                     bodyPadding = parseInt($('body').css('padding-right'))
-                    expect(bodyPadding).toBeAround(assumedScrollbarWidth, 10)
-                    if assumedScrollbarWidth > 0 # this test does not make sense on Safari
-                      expect(bodyPadding).not.toBeAround(2 * assumedScrollbarWidth, 2 * 5)
+                    expect(bodyPadding).toBeAround(scrollbarWidth, 10)
+                    if scrollbarWidth > 0 # this test does not make sense on old Safaris
+                      expect(bodyPadding).not.toBeAround(2 * scrollbarWidth, 2 * 5)
                     done()
 
         it 'closes the current modal and wait for its close animation to finish before starting the open animation of a second modal', asyncSpec (next) ->


        it 'does not open multiple modals or pad the body twice if the user starts loading a second modal before the first was done loading', (done) ->
          up.modal.config.closeDuration = 10

          # Load a first modal
          up.modal.visit('/path1', target: '.container', animation: 'fade-in', duration: 50)


            @respondWith('<div class="container">text</div>')

          promise.then ->
            expect(parseInt($anchoredElement.css('right'))).toBeAround(30 + scrollbarWidth, 10)

            up.modal.close().then ->
              expect(parseInt($anchoredElement.css('right'))).toBeAround(30 , 10)
