spec_app/spec/javascripts/up/link_spec.js.coffee in upjs-rails-0.7.4 vs spec_app/spec/javascripts/up/link_spec.js.coffee in upjs-rails-0.7.5
- old
+ new
@@ -83,12 +83,22 @@
expect($area.attr('up-target')).toEqual('selector')
expect($area.attr('up-instant')).toEqual('')
expect($area.attr('up-preload')).toEqual('')
it "renames a contained link's href attribute to up-href so the container is considered a link", ->
- $area = affix('div[up-expand] a[href="/path"]')
+ $area = affix('div[up-expand] a[up-follow][href="/path"]')
up.ready($area)
expect($area.attr('up-href')).toEqual('/path')
+
+ it "copies an contained non-link element with up-href attribute", ->
+ $area = affix('div[up-expand] span[up-follow][up-href="/path"]')
+ up.ready($area)
+ expect($area.attr('up-href')).toEqual('/path')
+
+ it 'adds an up-follow attribute if the contained link has neither up-follow nor up-target attributes', ->
+ $area = affix('div[up-expand] a[href="/path"]')
+ up.ready($area)
+ expect($area.attr('up-follow')).toEqual('')
describe '[up-instant]', ->
beforeEach ->
@$link = affix('a[href="/path"][up-follow][up-instant]')
\ No newline at end of file