Skip to content

Commit

Permalink
Do not require accessToken: stevenschobert#242
Browse files Browse the repository at this point in the history
  • Loading branch information
juhamust committed May 26, 2015
1 parent a85275c commit 2baeb0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/instafeed.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,9 @@ class Instafeed
throw new Error "No user specified. Use the 'userId' option."

# make sure there is an access token
if typeof @options.accessToken isnt 'string'
throw new Error "No access token. Use the 'accessToken' option."
# NOTE: accessToken is not required if feed is public
#if typeof @options.accessToken isnt 'string'
# throw new Error "No access token. Use the 'accessToken' option."

endpoint = "users/#{@options.userId}/media/recent"
# throw an error if any other option is given
Expand Down
4 changes: 2 additions & 2 deletions test/instafeedTest.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ describe 'Instafeed instace', ->
accessToken: 'mytoken'
(-> feed._buildUrl()).should.throw "No user specified. Use the 'userId' option."

it 'should refuse to build a url if get=user and there is no accessToken', ->
###it 'should refuse to build a url if get=user and there is no accessToken', ->
feed = new Instafeed
clientId: 'test'
get: 'user'
userId: 1
(-> feed._buildUrl()).should.throw "No access token. Use the 'accessToken' option."
(-> feed._buildUrl()).should.throw "No access token. Use the 'accessToken' option."###

it 'should run a before & after callback functions', ->
timesRan = 0
Expand Down

0 comments on commit 2baeb0b

Please sign in to comment.