* Append timestamp to all qunit.html script includes for no caching.

* Set mockjax responseTime to 0.
* Post actual and expected values to jstestnet when available.
* Re-enabled 2 disabled tests
This commit is contained in:
Ricky Rosario 2011-05-06 12:11:28 -04:00
Родитель 8511ddbe0a
Коммит 47b7da4b94
4 изменённых файлов: 21 добавлений и 11 удалений

Просмотреть файл

@ -2,6 +2,7 @@ import logging
import os
import socket
import StringIO
from time import time
from django.conf import settings
from django.contrib.sites.models import Site
@ -179,4 +180,5 @@ def monitor(request):
def kitsune_qunit(request, path):
"""View that hosts QUnit tests."""
ctx = django_qunit.views.get_suite_context(request, path)
ctx.update(timestamp=time())
return jingo.render(request, 'tests/qunit.html', ctx)

Просмотреть файл

@ -82,6 +82,11 @@
if (typeof(details.source) !== 'undefined') {
msg.stacktrace = details.source;
}
if(typeof(details.actual) !== 'undefined' &&
typeof(details.expected) !== 'undefined') {
msg.actual = details.actual;
msg.expected = details.expected;
}
}
postMsg(msg);
};

Просмотреть файл

@ -7,6 +7,7 @@ var kboxFixture = {
url: '/vote',
status: 200,
contentType: 'text/json',
responseTime: 0,
response: function(settings) {
// set the response message to the key/values POSTed
var message = ''
@ -24,7 +25,7 @@ var kboxFixture = {
};
module('ajaxvote', kboxFixture);
/*
asyncTest('helpful vote', function() {
var $sandbox = this.sandbox,
$messageBox;
@ -64,5 +65,5 @@ asyncTest('not helpful vote', function() {
start();
});
});
*/
});

Просмотреть файл

@ -2,8 +2,8 @@
<html>
<head>
<title>QUnit Test Suite</title>
<link rel="stylesheet" href="{{ url('qunit_css') }}" type="text/css" media="screen">
<link rel="stylesheet" href="{{ MEDIA_URL }}css/kbox.css" type="text/css" media="screen">
<link rel="stylesheet" href="{{ url('qunit_css') }}?v={{ timestamp }}" type="text/css" media="screen">
<link rel="stylesheet" href="{{ MEDIA_URL }}css/kbox.css?v={{ timestamp }}" type="text/css" media="screen">
</head>
<body
data-for-os="{&#34;maemo&#34;: 4, &#34;win&#34;: 1, &#34;mac&#34;: 2, &#34;android&#34;: 5, &#34;linux&#34;: 3}"
@ -85,18 +85,20 @@
<script src="{{ url('jsi18n') }}/build:{{ BUILD_ID_JS }}"></script>
<script src="{{ url('wafflejs') }}"></script>
{{ js('common') }}
<script type="text/javascript" src="{{ url('qunit_js') }}"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}js/libs/jquery.mockjax.js"></script>
<script src="{{ url('wafflejs') }}?v={{ timestamp }}"></script>
{% for jsfile in settings.MINIFY_BUNDLES['js']['common'] %}
<script src="{{ MEDIA_URL + jsfile }}?v={{ timestamp }}"></script>
{% endfor %}
<script type="text/javascript" src="{{ url('qunit_js') }}?v={{ timestamp }}"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}js/libs/jquery.mockjax.js?v={{ timestamp }}"></script>
{% for url in suite.extra_urls %}
<script type="text/javascript" src="{{ url }}"></script>
<script type="text/javascript" src="{{ url }}?v={{ timestamp }}"></script>
{% endfor %}
{% for url in suite.extra_media_urls %}
<script type="text/javascript" src="{{ MEDIA_URL }}{{ url }}"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}{{ url }}?v={{ timestamp }}"></script>
{% endfor %}
{% for file in files %}
<script type="text/javascript" src="{{ url('qunit_test', file) }}"></script>
<script type="text/javascript" src="{{ url('qunit_test', file) }}?v={{ timestamp }}"></script>
{% endfor %}
</body>