diff options
author | Marius Mathiesen <marius@shortcut.no> | 2009-11-30 10:37:33 +0100 |
---|---|---|
committer | Marius Mathiesen <marius@shortcut.no> | 2009-12-03 14:18:58 +0100 |
commit | 32790146f73f2ee8538ea236f1dbbc32fb3d6d4b (patch) | |
tree | 93f5688871819a2c1bc595c61ed22527e46fa4a6 /test | |
parent | c753d1dbaa667dc9382c28f5942d95f46a1b765f (diff) | |
download | gitorious-mainline-outdated-32790146f73f2ee8538ea236f1dbbc32fb3d6d4b.zip gitorious-mainline-outdated-32790146f73f2ee8538ea236f1dbbc32fb3d6d4b.tar.gz gitorious-mainline-outdated-32790146f73f2ee8538ea236f1dbbc32fb3d6d4b.tar.bz2 |
Moving the form replacer into a testable jQuery plugin
Diffstat (limited to 'test')
-rw-r--r-- | test/javascripts/rails_form_replacer_test.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/javascripts/rails_form_replacer_test.js b/test/javascripts/rails_form_replacer_test.js new file mode 100644 index 0000000..54b5313 --- /dev/null +++ b/test/javascripts/rails_form_replacer_test.js @@ -0,0 +1,30 @@ +/* + #-- + # Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) + # + # This program is free software: you can redistribute it and/or modify + # it under the terms of the GNU Affero General Public License as published by + # the Free Software Foundation, either version 3 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU Affero General Public License for more details. + # + # You should have received a copy of the GNU Affero General Public License + # along with this program. If not, see <http://www.gnu.org/licenses/>. + #-- +*/ + +TestCase("Replace Rails generated forms", { + "test stuff": function () { + /*DOC += <a data-request-method="delete">Foo</a*/ + var clicked = false; + var backend = function (options){ + clicked = true; + }; + var el = jQuery("a[data-request-method]").replaceRailsGeneratedForm(); + assertEquals("start_watching", el.attr("id")); + } +}); |