will (owner)

Revisions

gist: 130364 Download_button fork
public
Public Clone URL: git://gist.github.com/130364.git
celerity_jquery_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env jruby
require 'rubygems'
require 'celerity'
 
url = "http://uiuc.us/jquery.html"
puts "url should be #{url}"
 
[:firefox, :internet_explorer].each do |browser|
  b = Celerity::Browser.new :log_level => :severe, :browser => browser
  b.goto url
  b.buttons.first.click
  
  puts "#{browser} got: #{b.url}"
end
 
# output
# url should be http://uiuc.us/jquery.html
# firefox got: http://www.google.com/
# internet_explorer got: http://uiuc.us/jquery.html
 
jquery.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<html>
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title>jquery-bug</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8">
      $(document).ready( function() {
          $("form").submit(function(event){
            event.preventDefault();
            return false;
          });
        });
    </script>
  </head>
  <body>
    
   <form action="http://google.com">
     <input type=submit id="submit" />
   </form>
  </body>
</html>