Navigation Menu

Skip to content

Commit

Permalink
Fix test for DescribeIndexFields
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Aug 3, 2012
1 parent 29dd8f7 commit 1f12540
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions test/api-configuration.test.js
Expand Up @@ -373,9 +373,7 @@ suite('Configuration API', function() {
.get('/?DomainName=domain2&Action=CreateDomain&Version=2011-02-01', {
'Host': 'cloudsearch.localhost'
})
.get('/?Action=DescribeDomains&Version=2011-02-01', {
'Host': 'cloudsearch.localhost'
})
.get('/?Action=DescribeDomains&Version=2011-02-01')
.next(function(response) {
response = toParsedResponse(response);
var expectedDomains = ['domain1', 'domain2', 'domain3'];
Expand All @@ -394,7 +392,6 @@ suite('Configuration API', function() {
});

test('Get, Action=DescribeDomains (specified domains)', function(done) {
var domain;
utils
.get('/?DomainName=domain3&Action=CreateDomain&Version=2011-02-01', {
'Host': 'cloudsearch.localhost'
Expand All @@ -407,9 +404,7 @@ suite('Configuration API', function() {
})
.get('/?Action=DescribeDomains&Version=2011-02-01' +
'&DomainNames.member.1=domain2' +
'&DomainNames.member.2=domain1', {
'Host': 'cloudsearch.localhost'
})
'&DomainNames.member.2=domain1')
.next(function(response) {
response = toParsedResponse(response);
var expectedDomains = ['domain2', 'domain1'];
Expand Down Expand Up @@ -641,7 +636,7 @@ suite('Configuration API', function() {
var domains = [];
for (var i in members) {
if (members.hasOwnProperty(i))
domains.push(members[i].IndexFieldName);
domains.push(members[i].Options.IndexFieldName);
}
return domains;
}
Expand All @@ -662,17 +657,15 @@ suite('Configuration API', function() {
'IndexField.IndexFieldType=literal&' +
'Action=DefineIndexField&Version=2011-02-01')
.get('/?Action=DescribeIndexFields&Version=2011-02-01' +
'&DomainName=companies', {
'Host': 'cloudsearch.localhost'
})
'&DomainName=companies')
.next(function(response) {
response = toParsedResponse(response);
assert.deepEqual(response.pattern,
{ statusCode: 200,
body: PATTERN_DescribeIndexFieldsResponse([
PATTERN_IndexFieldStatus_UInt,
PATTERN_IndexFieldStatus_Literal,
PATTERN_IndexFieldStatus_Text
PATTERN_IndexFieldStatus_Text,
PATTERN_IndexFieldStatus_Literal
]) });

var expectedFields = ['age', 'name', 'product'];
Expand Down Expand Up @@ -703,9 +696,7 @@ suite('Configuration API', function() {
.get('/?Action=DescribeIndexFields&Version=2011-02-01' +
'&DomainName=companies' +
'&FieldNames.member.1=name' +
'&FieldNames.member.2=age', {
'Host': 'cloudsearch.localhost'
})
'&FieldNames.member.2=age')
.next(function(response) {
response = toParsedResponse(response);
assert.deepEqual(response.pattern,
Expand Down

0 comments on commit 1f12540

Please sign in to comment.