~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/javascript/tests/test_lp_client_integration.js

  • Committer: Launchpad Patch Queue Manager
  • Date: 2012-01-05 01:16:46 UTC
  • mfrom: (14628.1.2 js-client-link)
  • Revision ID: launchpad@pqm.canonical.com-20120105011646-dlhd7oqm9pui6yk1
[r=benji][bug=911973] Set lp_original_uri properly for objects
        returned by named_get and named_post that have a self_link.

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
    Y.Assert.areSame(1, config.result.total_size);
128
128
  },
129
129
 
 
130
  test_named_get_uri: function() {
 
131
    var data = serverfixture.setup(
 
132
      this, 'create_product_with_milestone_and_login');
 
133
    var client = new Y.lp.client.Launchpad({sync: true});
 
134
    var config = makeTestConfig({parameters: {name: data.milestone.name}});
 
135
    var product = new Y.lp.client.Entry(
 
136
      client, data.product, data.product.self_link);
 
137
    product.named_get('getMilestone', config);
 
138
    Y.Assert.isTrue(config.successful, 'Getting milestone failed');
 
139
    var milestone = config.result;
 
140
    Y.Assert.isInstanceOf(Y.lp.client.Entry, milestone);
 
141
    Y.Assert.areSame(data.milestone_self_link, milestone.lp_original_uri);
 
142
  },
 
143
 
130
144
  test_named_post_integration: function() {
131
145
    var data = serverfixture.setup(this, 'create_bug_and_login');
132
146
    var client = new Y.lp.client.Launchpad({sync: true});
133
147
    var config = makeTestConfig();
134
148
    client.named_post(
135
149
      data.bug.self_link, 'mute', config);
136
 
    Y.Assert.isTrue(config.successful);
 
150
    Y.Assert.isTrue(config.successful, "named_post failed: " + config.result);
137
151
  },
138
152
 
139
153
  test_follow_link: function() {