diff --git a/test/server.rb b/test/server.rb index f15a91bf..59bcf4f5 100644 --- a/test/server.rb +++ b/test/server.rb @@ -6,19 +6,19 @@ use Rack::Static, :urls => ["/src"], :root => File.expand_path('..', settings.root) helpers do - def jquery_link version + def jquery_link(version, path="/") if params[:version] == version "[#{version}]" else - "#{version}" + "#{version}" end end - def cdn_link cdn + def cdn_link(cdn, path="/") if params[:cdn] == cdn "[#{cdn}]" else - "#{cdn}" + "#{cdn}" end end @@ -53,6 +53,16 @@ def jquery_versions erb :index end +get '/manual' do + params[:version] ||= '1.11.0' + params[:cdn] ||= 'jquery' + params[:sleep] ||= 0 + sleep params[:sleep].to_i + @extra_params = "version=#{params[:version]}&cdn=#{params[:cdn]}" + erb :manual +end + + [:get, :post, :put, :delete].each do |method| send(method, '/echo') { data = { :params => params }.update(request.env) diff --git a/test/views/manual.erb b/test/views/manual.erb new file mode 100644 index 00000000..2c76ff65 --- /dev/null +++ b/test/views/manual.erb @@ -0,0 +1,32 @@ +<% @title = "jquery-ujs manual test" %> +

<%= @title %>

+
+ CDN: + <%= cdn_link('jquery', '/manual') %> • + <%= cdn_link('googleapis', '/manual') %> +
+
+ jQuery version: + + <% jquery_versions.each do |v| %> + <%= ' • ' if v != jquery_versions.first %> + <%= jquery_link(v, '/manual') %> + <% end %> + <%= (' • ' + jquery_link('edge', '/manual')) if File.exist?(settings.root + '/public/vendor/jquery.js') %> +
+

+

We just haven't figured out how to automate these yet.

+ +

data-disable

+

Clicking these links will reload this page with a short delay. During the delay, each link should become disabled and its text should change to "Please wait..."

+ +page loaded at: + \ No newline at end of file