This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$('#LoginForm a.login_method_switch').click(function() { | |
var blockToShow = '#session_' + this.text.toLowerCase().replace(' ', '_'); | |
$('#LoginForm ' + blockToShow).show("slow"); | |
$('#LoginForm .session_login_method:not(' + blockToShow + ')').hide("slow"); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Webrat | |
class Form | |
protected | |
def form_method | |
special_method = Webrat::XML.css_search(@element, 'input[name="_method"]').first | |
unless special_method.nil? | |
special_method['value'] | |
else | |
Webrat::XML.attribute(@element, "method").blank? ? :get : Webrat::XML.attribute(@element, "method").downcase | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class WithinToleranceOfNow: | |
def __init__(self, expectation = datetime.utcnow()): | |
self.expected_time = expectation | |
def __eq__(self, other): | |
try: | |
parsed_time = datetime.utcfromtimestamp(int(other)) | |
difference = abs(parsed_time - self.expected_time) | |
return (difference.seconds < 10) | |
except AttributeError as e: |