describe 'jQuery' describe 'sandbox()' before dom = sandbox() end it 'should provide an empty DOM sandbox' dom.prepend('test') dom.should.have_text 'test' end end describe 'element() / elements()' it 'should alias jQuery' element.should.be jQuery elements.should.be jQuery end end describe 'async' it 'should load mah cookies (textfile)' $.get('async', function(text){ text.should_eql 'cookies!' }) end it 'should load mah cookies twice (ensure multiple async requests work)' $.get('async', function(text){ text.should.eql 'cookies!' }) $.get('async', function(text){ text.should.not.eql 'rawr' }) end end describe 'matchers' before_each html = '

\ \ test \ test \

' elem = $(html) end it 'should fail with pretty print of element' spec = mock_it(function() { elem.should.not.have_tag 'label' }) spec.should.have_failure_message(/