~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/javascript/tests/test_requestbuild_overlay.js

  • Committer: Henning Eggers
  • Date: 2011-08-26 14:51:02 UTC
  • mto: This revision was merged to the branch mainline in revision 13837.
  • Revision ID: henning@canonical.com-20110826145102-6rhnh6cbq8cnpkcn
Refactored request build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
        return mockio;
161
161
    },
162
162
 
163
 
    notest_requestbuilds_success: function() {
 
163
    test_requestbuilds_success: function() {
164
164
        var mockio = this._makeRequest();
165
165
        mockio.success({
166
166
            responseText: builds_target_markup,
175
175
            2, Y.one("#builds-target").all('.package-build').size());
176
176
    },
177
177
 
178
 
    notest_requestbuilds_failure_500: function() {
 
178
    test_requestbuilds_failure_500: function() {
179
179
        var mockio = this._makeRequest(),
180
180
            oops_id = "OOPS-TESTING",
181
181
            message = "Server error, please contact an administrator. " +
182
 
                "OOPS ID: " + oops_id;
 
182
                "OOPS ID:" + oops_id;
183
183
        mockio.failure({
184
184
            'responseHeaders': {'X-Lazr-OopsId': oops_id}
185
185
            });
199
199
            Y.one("[name='field.actions.request']").get('disabled'));
200
200
    },
201
201
 
202
 
    notest_requestbuilds_failure_400: function() {
 
202
    test_requestbuilds_build_collision: function() {
203
203
        var mockio = this._makeRequest(),
204
204
            success_message = "2 new recipe builds have been queued.",
205
205
            informational_message = "An identical build ...",
209
209
                already_pending: informational_message,
210
210
                errors: [error_message]
211
211
            };
212
 
        mockio.failure({
213
 
            status: 400,
 
212
        mockio.success({
214
213
            statusText: "Request Build",
215
214
            responseText: Y.JSON.stringify(response_text),
216
215
            responseHeaders: {'Content-type:': 'application/json'}