Skip to content

Instantly share code, notes, and snippets.

View pivotal-creationmix's full-sized avatar

pivotal-creationmix

View GitHub Profile
(function($){
$.fn.check = function(){
if (!this.is(':checked')) {
this.toggleChecked();
}
return this;
};
$.fn.uncheck = function(){
var swfup = new SWFUpload({
post_params : {
authenticity_token : '<%= u form_authenticity_token %>'
session: '<%= u request.env['rack.request.cookie_hash'].try(:[], Rails.application.config.session_options[:key]) %>'
}
});
beforeEach(function() {
this.addMatchers({
toBeVisible: function() {
var actual = $(this.actual);
var basicMessage = "be visible";
return this._reportWithNonExistant(
actual.is(':visible'),
basicMessage,
"Expected '$(" + actual.selector + ")' to " + basicMessage + " but was not"