Skip to content
Browse files

Add the ability to test against different versions of jQuery

1 parent 9c84c9d commit 95f3fdeb012d849d56c5e09c548322c1efc63429 @alexcrichton alexcrichton committed with josevalim Oct 20, 2010
Showing with 27 additions and 6,243 deletions.
  1. +0 −6,240 test/public/vendor/jquery-1.4.2.js
  2. +16 −0 test/server.rb
  3. +11 −3 test/views/index.erb
View
6,240 test/public/vendor/jquery-1.4.2.js
0 additions, 6,240 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
16 test/server.rb
@@ -15,9 +15,25 @@
get '/' do
FileUtils.cp(source_file, dest_file)
+ params[:version] ||= '1.4.3'
erb :index
end
+get '/jquery/:version' do
+ FileUtils.cp(source_file, dest_file)
+ erb :index
+end
+
+helpers do
+ def jquery_link version
+ if params[:version] == version
+ "[#{version}]"
+ else
+ "<a href='/jquery/#{version}'>#{version}</a>"
+ end
+ end
+end
+
get '/show' do
if request.xhr?
{:hello => :sexy, :request_env => request.env}.to_json
View
14 test/views/index.erb
@@ -3,8 +3,11 @@
<head>
<title>jquery-ujs test</title>
<link href="/qunit.css" media="screen" rel="stylesheet" type="text/css" media="screen, projection" />
- <style> .fixture { text-indent: -9000em; } </style>
- <script src="/vendor/jquery-1.4.2.js" type="text/javascript"></script>
+ <style>
+ .fixture { text-indent: -9000em; }
+ #qunit-header a { color: inherit; }
+ </style>
+ <script src="http://code.jquery.com/jquery-<%= params[:version] %>.js" type="text/javascript"></script>
<script src="/vendor/qunit.js" type="text/javascript"></script>
<script src="/vendor/rails.js" type="text/javascript"></script>
@@ -18,7 +21,12 @@
</head>
<body id="body">
- <h1 id="qunit-header">jquery-ujs test</h1>
+ <h1 id="qunit-header">
+ jquery-ujs test
+ <%= jquery_link '1.4.1' %>
+ <%= jquery_link '1.4.2' %>
+ <%= jquery_link '1.4.3' %>
+ </h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>

0 comments on commit 95f3fde

Please sign in to comment.
Something went wrong with that request. Please try again.