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...
1 parent eff8d30 commit 3baa1f3c3750f0aec9f28a040be719a84f370c82 @alexcrichton alexcrichton committed with josevalim Nov 1, 2010
Showing with 6 additions and 6 deletions.
  1. +2 −2 test/server.rb
  2. +1 −1 test/views/iframe.erb
  3. +1 −1 test/views/iframe_csrf.erb
  4. +2 −2 test/views/index.erb
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,15 +35,15 @@
<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>
</iframe>
</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>

0 comments on commit 3baa1f3

Please sign in to comment.