Skip to content

Commit

Permalink
[Closes assaf#315] Test not failing.
Browse files Browse the repository at this point in the history
  • Loading branch information
assaf committed May 28, 2012
1 parent 5c44585 commit 3a8adbf
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/jquery_compat_test.coffee
Expand Up @@ -26,6 +26,9 @@ test = (version)->
<a href="#post">Post</a>
<div id="response"></div>
<input id="edit-subject" value="subject">
<textarea id="edit-note">note</textarea>
</body>
<script>
Expand Down Expand Up @@ -58,6 +61,7 @@ test = (version)->
@browser = new Browser()
@browser.visit "http://localhost:3003/compat/jquery-#{version}", done


describe "selecting an option in a select element", ->
before (done)->
@browser.select "select", "1"
Expand All @@ -66,13 +70,15 @@ test = (version)->
it "should fire the change event", ->
assert.equal @browser.text("#option"), "1"


describe "jQuery.post", ->
before (done)->
@browser.clickLink "Post", done

it "should perform an AJAX POST request", ->
assert /foo=bar/.test(@browser.text("#response"))


describe "jQuery.globalEval", ->
it "should work as expected", ->
@browser.evaluate("(function () {
Expand All @@ -81,6 +87,17 @@ test = (version)->
assert.ok @browser.window.globalEvalWorks


describe "setting val to empty", ->
it "should set to empty", ->
assert @browser.query("input#edit-subject").value
@browser.window.$("input#edit-subject").val("")
assert !@browser.query("input#edit-subject").value

assert @browser.query("textarea#edit-note").textContent
@browser.window.$("textarea#edit-note").val("")
assert !@browser.query("textarea#edit-note").textContent


describe "Compatibility with jQuery", ->

for version in JQUERY_VERSIONS
Expand Down

0 comments on commit 3a8adbf

Please sign in to comment.