Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

completing optional count parameter testing

  • Loading branch information...
commit 5508ef37c6393e3efa42e1cbcb2213432551ee4d 1 parent c1aa5a6
@mckelvey authored
View
7 test/instagram.locations.coffee
@@ -50,6 +50,11 @@ module.exports =
data[0].should.have.property 'name'
test.output "data[0] had the property 'name'", data[0].name
app.finish_test()
+ 'locations#search for 40.77/-73.98 with count 60': ->
+ test.helper 'locations#search for 40.77/-73.98 with count 60', Instagram, 'locations', 'search', { lat: 40.77, lng: -73.98, distance: 5000, count: 60 }, (data) ->
+ data.length.should.equal 60
+ test.output "data had length of 60", data.length
+ app.finish_test()
'locations#subscriptions': ->
test.helper "locations#subscriptions subscribe to location '1257285'", Instagram, 'locations', 'subscribe', { object_id: '1257285' }, (data) ->
data.should.have.property 'id'
@@ -73,6 +78,8 @@ module.exports =
app.finish_test()
###
+count seems to return n-1 results; e.g. request 50 returns 49, request 30 returns 29,...
+
'locations#recent for id#1 with count of 50': ->
test.helper 'locations#recent for id#1 with count of 50', Instagram, 'locations', 'recent', { location_id: 1, count: 50 }, (data, pagination) ->
data.length.should.equal 49
View
14 test/instagram.locations.js
@@ -57,6 +57,18 @@
return app.finish_test();
});
},
+ 'locations#search for 40.77/-73.98 with count 60': function() {
+ return test.helper('locations#search for 40.77/-73.98 with count 60', Instagram, 'locations', 'search', {
+ lat: 40.77,
+ lng: -73.98,
+ distance: 5000,
+ count: 60
+ }, function(data) {
+ data.length.should.equal(60);
+ test.output("data had length of 60", data.length);
+ return app.finish_test();
+ });
+ },
'locations#subscriptions': function() {
return test.helper("locations#subscriptions subscribe to location '1257285'", Instagram, 'locations', 'subscribe', {
object_id: '1257285'
@@ -97,6 +109,8 @@
}
};
/*
+ count seems to return n-1 results; e.g. request 50 returns 49, request 30 returns 29,...
+
'locations#recent for id#1 with count of 50': ->
test.helper 'locations#recent for id#1 with count of 50', Instagram, 'locations', 'recent', { location_id: 1, count: 50 }, (data, pagination) ->
data.length.should.equal 49
View
2  test/instagram.media.coffee
@@ -95,6 +95,8 @@ module.exports =
app.finish_test()
###
+tested on Austin, Tx. { lat: 30.30, lng: -97.70, distance: 5000 }; weird, request with count 200 produces 54, request with count 50 produces 46, request with count 46 produces 42, request with count 42 produces 38... I think you see the pattern. :)
+
'media#search for 30.30/-97.70 with count of 42': ->
test.helper 'media#search for 30.30/-97.70 with count of 42', Instagram, 'media', 'search', { lat: 30.30, lng: -97.70, distance: 5000, count: 42 }, (data) ->
data.length.should.equal 42
View
2  test/instagram.media.js
@@ -148,6 +148,8 @@
}
};
/*
+ tested on Austin, Tx. { lat: 30.30, lng: -97.70, distance: 5000 }; weird, request with count 200 produces 54, request with count 50 produces 46, request with count 46 produces 42, request with count 42 produces 38... I think you see the pattern. :)
+
'media#search for 30.30/-97.70 with count of 42': ->
test.helper 'media#search for 30.30/-97.70 with count of 42', Instagram, 'media', 'search', { lat: 30.30, lng: -97.70, distance: 5000, count: 42 }, (data) ->
data.length.should.equal 42
View
10 test/instagram.tags.coffee
@@ -77,4 +77,14 @@ module.exports =
test.output "data was null; we unsubscribed from the subscription #{subscription_id}"
app.finish_test()
+###
+seems to max out at 49 rather than 100 (ruby api docs) otherwise works perfectly
+
+ 'tags#search for sex with count 200': ->
+ test.helper 'tags#search for sex with count 200', Instagram, 'tags', 'search', { q: 'sex', count: 200 }, (data) ->
+ data.length.should.equal 200
+ test.output "data had length equal to 200", data.length
+ app.finish_test()
+###
+
app.start_tests module.exports
View
9 test/instagram.tags.js
@@ -105,5 +105,14 @@
});
}
};
+ /*
+ seems to max out at 49 rather than 100 (ruby api docs) otherwise works perfectly
+
+ 'tags#search for sex with count 200': ->
+ test.helper 'tags#search for sex with count 200', Instagram, 'tags', 'search', { q: 'sex', count: 200 }, (data) ->
+ data.length.should.equal 200
+ test.output "data had length equal to 200", data.length
+ app.finish_test()
+ */
app.start_tests(module.exports);
}).call(this);
View
30 test/instagram.users.coffee
@@ -43,6 +43,11 @@ module.exports =
data[0].should.have.property 'id'
data[0]['user'].should.have.property 'username', 'mckelvey'
app.finish_test()
+ 'users#recent for mckelvey with count 60': ->
+ test.helper 'users#recent for mckelvey with count 60', Instagram, 'users', 'recent', { user_id: 291024, count: 60 }, (data) ->
+ data.length.should.equal 60
+ test.output "data had length equal to 60", data.length
+ app.finish_test()
'users#search for mckelvey': ->
test.helper 'users#search for mckelvey', Instagram, 'users', 'search', { q: 'mckelvey' }, (data) ->
data.length.should.be.above 0
@@ -52,11 +57,21 @@ module.exports =
data[0].should.have.property 'id', '291024'
test.output "data had the property 'id' equal to '291024'"
app.finish_test()
+ 'users#search for i with count': ->
+ test.helper 'users#search for i with count', Instagram, 'users', 'search', { q: 'i', count: 50 }, (data) ->
+ data.length.should.equal 50
+ test.output "data had length equal to 50", data.length
+ app.finish_test()
'users#follows id#291024': ->
test.helper 'users#follows id#291024', Instagram, 'users', 'follows', { user_id: 291024 }, (data, pagination) ->
data.length.should.be.above 0
data.length.should.be.below 51
app.finish_test()
+ 'users#follows id#291024 with count 50': ->
+ test.helper 'users#follows id#291024 with count 50', Instagram, 'users', 'follows', { user_id: 291024, count: 50 }, (data, pagination) ->
+ data.length.should.equal 50
+ test.output "data had length equal to 50", data.length
+ app.finish_test()
'users#followed_by id#291024': ->
test.helper 'users#followed_by id#291024', Instagram, 'users', 'followed_by', { user_id: 291024 }, (data, pagination) ->
data.length.should.be.above 0
@@ -64,6 +79,11 @@ module.exports =
data.length.should.be.below 51
test.output "data had length less than 51", data.length
app.finish_test()
+ 'users#followed_by id#291024 with count 50': ->
+ test.helper 'users#followed_by id#291024 with count 50', Instagram, 'users', 'followed_by', { user_id: 291024, count: 50 }, (data, pagination) ->
+ data.length.should.equal 50
+ test.output "data had length equal to 50", data.length
+ app.finish_test()
'users#requested_by id#291024': ->
test.helper 'users#requested_by id#291024', Instagram, 'users', 'requested_by', { user_id: 291024 }, (data, pagination) ->
data.should.have.property 'length'
@@ -94,4 +114,14 @@ module.exports =
test.output "data had the property 'outgoing_status' equal to 'follows'", data
app.finish_test()
+###
+for me, returns 9 regardless, requesting with count seems to have no impact Ñ time based only now?
+
+ 'users#self for mckelvey with count 200': ->
+ test.helper 'users#self for mckelvey with count 200', Instagram, 'users', 'self', { count: 200 }, (data) ->
+ data.length.should.equal 200
+ test.output "data had length equal to 200", data.length
+ app.finish_test()
+###
+
app.start_tests module.exports
View
49 test/instagram.users.js
@@ -47,6 +47,16 @@
return app.finish_test();
});
},
+ 'users#recent for mckelvey with count 60': function() {
+ return test.helper('users#recent for mckelvey with count 60', Instagram, 'users', 'recent', {
+ user_id: 291024,
+ count: 60
+ }, function(data) {
+ data.length.should.equal(60);
+ test.output("data had length equal to 60", data.length);
+ return app.finish_test();
+ });
+ },
'users#search for mckelvey': function() {
return test.helper('users#search for mckelvey', Instagram, 'users', 'search', {
q: 'mckelvey'
@@ -60,6 +70,16 @@
return app.finish_test();
});
},
+ 'users#search for i with count': function() {
+ return test.helper('users#search for i with count', Instagram, 'users', 'search', {
+ q: 'i',
+ count: 50
+ }, function(data) {
+ data.length.should.equal(50);
+ test.output("data had length equal to 50", data.length);
+ return app.finish_test();
+ });
+ },
'users#follows id#291024': function() {
return test.helper('users#follows id#291024', Instagram, 'users', 'follows', {
user_id: 291024
@@ -69,6 +89,16 @@
return app.finish_test();
});
},
+ 'users#follows id#291024 with count 50': function() {
+ return test.helper('users#follows id#291024 with count 50', Instagram, 'users', 'follows', {
+ user_id: 291024,
+ count: 50
+ }, function(data, pagination) {
+ data.length.should.equal(50);
+ test.output("data had length equal to 50", data.length);
+ return app.finish_test();
+ });
+ },
'users#followed_by id#291024': function() {
return test.helper('users#followed_by id#291024', Instagram, 'users', 'followed_by', {
user_id: 291024
@@ -80,6 +110,16 @@
return app.finish_test();
});
},
+ 'users#followed_by id#291024 with count 50': function() {
+ return test.helper('users#followed_by id#291024 with count 50', Instagram, 'users', 'followed_by', {
+ user_id: 291024,
+ count: 50
+ }, function(data, pagination) {
+ data.length.should.equal(50);
+ test.output("data had length equal to 50", data.length);
+ return app.finish_test();
+ });
+ },
'users#requested_by id#291024': function() {
return test.helper('users#requested_by id#291024', Instagram, 'users', 'requested_by', {
user_id: 291024
@@ -134,5 +174,14 @@
});
}
};
+ /*
+ for me, returns 9 regardless, requesting with count seems to have no impact � time based only now?
+
+ 'users#self for mckelvey with count 200': ->
+ test.helper 'users#self for mckelvey with count 200', Instagram, 'users', 'self', { count: 200 }, (data) ->
+ data.length.should.equal 200
+ test.output "data had length equal to 200", data.length
+ app.finish_test()
+ */
app.start_tests(module.exports);
}).call(this);
Please sign in to comment.
Something went wrong with that request. Please try again.