unpoly-rails 0.34.2 → 0.35.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of unpoly-rails might be problematic. Click here for more details.

@@ -85,46 +85,44 @@ describe 'up.popup', ->
85
85
 
86
86
  describe 'opening a popup while another modal is open', ->
87
87
 
88
- describeCapability 'canCssTransition', ->
88
+ it 'closes the current popup and wait for its close animation to finish before starting the open animation of a second popup', (done) ->
89
+ $span = affix('span')
90
+ up.popup.config.openAnimation = 'fade-in'
91
+ up.popup.config.openDuration = 5
92
+ up.popup.config.closeAnimation = 'fade-out'
93
+ up.popup.config.closeDuration = 60
89
94
 
90
- it 'closes the current popup and wait for its close animation to finish before starting the open animation of a second popup', (done) ->
91
- $span = affix('span')
92
- up.popup.config.openAnimation = 'fade-in'
93
- up.popup.config.openDuration = 5
94
- up.popup.config.closeAnimation = 'fade-out'
95
- up.popup.config.closeDuration = 60
95
+ events = []
96
+ u.each ['up:popup:open', 'up:popup:opened', 'up:popup:close', 'up:popup:closed'], (event) ->
97
+ up.on event, -> events.push(event)
96
98
 
97
- events = []
98
- u.each ['up:popup:open', 'up:popup:opened', 'up:popup:close', 'up:popup:closed'], (event) ->
99
- up.on event, -> events.push(event)
99
+ up.popup.attach($span, { target: '.target', html: '<div class="target">response1</div>' })
100
100
 
101
- up.popup.attach($span, { target: '.target', html: '<div class="target">response1</div>' })
101
+ # First popup is starting opening animation
102
+ expect(events).toEqual ['up:popup:open']
103
+ expect($('.target')).toHaveText('response1')
102
104
 
103
- # First popup is starting opening animation
104
- expect(events).toEqual ['up:popup:open']
105
+ u.setTimer 80, ->
106
+ # First popup has completed opening animation
107
+ expect(events).toEqual ['up:popup:open', 'up:popup:opened']
105
108
  expect($('.target')).toHaveText('response1')
106
109
 
107
- u.setTimer 80, ->
108
- # First popup has completed opening animation
109
- expect(events).toEqual ['up:popup:open', 'up:popup:opened']
110
- expect($('.target')).toHaveText('response1')
111
-
112
- # We open another popup, which will cause the first modal to start closing
113
- up.popup.attach($span, { target: '.target', html: '<div class="target">response2</div>' })
110
+ # We open another popup, which will cause the first modal to start closing
111
+ up.popup.attach($span, { target: '.target', html: '<div class="target">response2</div>' })
114
112
 
115
- u.setTimer 20, ->
113
+ u.setTimer 20, ->
116
114
 
117
- # Second popup is still waiting for first popup's closing animation to finish.
118
- expect(events).toEqual ['up:popup:open', 'up:popup:opened', 'up:popup:close']
119
- expect($('.target')).toHaveText('response1')
115
+ # Second popup is still waiting for first popup's closing animation to finish.
116
+ expect(events).toEqual ['up:popup:open', 'up:popup:opened', 'up:popup:close']
117
+ expect($('.target')).toHaveText('response1')
120
118
 
121
- u.setTimer 200, ->
119
+ u.setTimer 200, ->
122
120
 
123
- # First popup has finished closing, second popup has finished opening.
124
- expect(events).toEqual ['up:popup:open', 'up:popup:opened', 'up:popup:close', 'up:popup:closed', 'up:popup:open', 'up:popup:opened']
125
- expect($('.target')).toHaveText('response2')
121
+ # First popup has finished closing, second popup has finished opening.
122
+ expect(events).toEqual ['up:popup:open', 'up:popup:opened', 'up:popup:close', 'up:popup:closed', 'up:popup:open', 'up:popup:opened']
123
+ expect($('.target')).toHaveText('response2')
126
124
 
127
- done()
125
+ done()
128
126
 
129
127
  describe 'up.popup.coveredUrl', ->
130
128
 
@@ -388,11 +388,9 @@ describe 'up.proxy', ->
388
388
  promise = up.proxy.get(url: '/foo', data: { key: 'value' })
389
389
  expect(promise).toBeUndefined()
390
390
 
391
- describeCapability 'canFormData', ->
392
-
393
- it "returns undefined if the given request's { data } is a FormData object", ->
394
- promise = up.proxy.get(url: '/foo', data: new FormData())
395
- expect(promise).toBeUndefined()
391
+ it "returns undefined if the given request's { data } is a FormData object", ->
392
+ promise = up.proxy.get(url: '/foo', data: new FormData())
393
+ expect(promise).toBeUndefined()
396
394
 
397
395
  describe 'up.proxy.set', ->
398
396
 
@@ -110,6 +110,7 @@ describe 'up.util', ->
110
110
  element = up.util.createElementFromHtml(string)
111
111
 
112
112
  expect(element.querySelector('head title').textContent).toEqual('document title')
113
+ expect(element.querySelector('body').getAttribute('data-env')).toEqual('production')
113
114
  expect(element.querySelectorAll('body div').length).toBe(2)
114
115
  expect(element.querySelectorAll('body div')[0].textContent).toEqual('line 1')
115
116
  expect(element.querySelectorAll('body div')[1].textContent).toEqual('line 2')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unpoly-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.2
4
+ version: 0.35.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-13 00:00:00.000000000 Z
11
+ date: 2017-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails