Skip to content

Commit

Permalink
Add jQuery version 1.6.3 to tests, and use it by default
Browse files Browse the repository at this point in the history
  • Loading branch information
akzhan committed Sep 2, 2011
1 parent ee275d1 commit 840ab6a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 7 additions & 1 deletion test/server.rb
@@ -1,6 +1,8 @@
require 'sinatra'
require 'json'

JQUERY_VERSIONS = %w[ 1.6 1.6.1 1.6.2 1.6.3 ].freeze

use Rack::Static, :urls => ["/src"], :root => File.expand_path('..', settings.root)

helpers do
Expand Down Expand Up @@ -39,10 +41,14 @@ def script_tag src
src = "/test/#{src}.js" unless src.index('/')
%(<script src="#{src}" type="text/javascript"></script>)
end

def jquery_versions
JQUERY_VERSIONS
end
end

get '/' do
params[:version] ||= '1.6.2'
params[:version] ||= JQUERY_VERSIONS.last
params[:cdn] ||= 'jquery'
erb :index
end
Expand Down
10 changes: 6 additions & 4 deletions test/views/index.erb
Expand Up @@ -10,10 +10,12 @@
</div>
<div id="jquery-version">
jQuery version:
<%= jquery_link '1.6' %>
<%= jquery_link '1.6.1' %>
<%= jquery_link '1.6.2' %>
<%= jquery_link 'edge' if File.exist?(settings.root + '/public/vendor/jquery.js') %>

<% jquery_versions.each do |v| %>
<%= ' • ' if v != jquery_versions.first %>
<%= jquery_link v %>
<% end %>
<%= (' • ' + jquery_link('edge')) if File.exist?(settings.root + '/public/vendor/jquery.js') %>
</div>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
Expand Down

0 comments on commit 840ab6a

Please sign in to comment.