Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow the two iframe tests to also have a variable jquery version.

This also fixes the two tests because since 'vendor/jquery-1.4.2.js' was removed, neither test would pass because jQuery wasn't actually present for the tests sadly.

Now, the index page embeds the jquery version into the request URL, so the two iframes load the same version as the one currently being tested
  • Loading branch information...
commit 3baa1f3c3750f0aec9f28a040be719a84f370c82 1 parent eff8d30
@alexcrichton alexcrichton authored josevalim committed
View
4 test/server.rb
@@ -54,11 +54,11 @@ def jquery_link version
end
end
-get '/iframe' do
+get '/iframe/:version' do
erb :iframe
end
-get '/iframe-csrf' do
+get '/iframe-csrf/:version' do
erb :iframe_csrf
end
View
2  test/views/iframe.erb
@@ -2,7 +2,7 @@
<html id="html">
<head>
<title>jquery-ujs iframe</title>
- <script src="/vendor/jquery-1.4.2.js" type="text/javascript"></script>
+ <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>
<script src="/test/settings.js" type="text/javascript"></script>
View
2  test/views/iframe_csrf.erb
@@ -4,7 +4,7 @@
<title>jquery-ujs iframe</title>
<meta name="csrf-param" content="authenticity_token"/>
<meta name="csrf-token" content="cf50faa3fe97702ca1ae"/>
- <script src="/vendor/jquery-1.4.2.js" type="text/javascript"></script>
+ <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>
<script src="/test/settings.js" type="text/javascript"></script>
View
4 test/views/index.erb
@@ -35,7 +35,7 @@
<div id='fixtures' class='fixture'></div>
<div id='fixtures-iframe' class='fixture'>
- <iframe onload="this.loaded=true;" src="<%=@app_base_url%>/iframe" width=450 height=100>
+ <iframe onload="this.loaded=true;" src="<%=@app_base_url%>/iframe/<%= params[:version] %>" width=450 height=100>
<div class='iframe'>
<div id='iframe_form'></div>
</div>
@@ -43,7 +43,7 @@
</div>
<div id='fixtures-iframe-csrf' class='fixture'>
- <iframe onload="this.loaded=true;" src="<%=@app_base_url%>/iframe-csrf" width=450 height=100>
+ <iframe onload="this.loaded=true;" src="<%=@app_base_url%>/iframe-csrf/<%= params[:version] %>" width=450 height=100>
<div class='iframe'>
<div id='iframe_form'></div>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.