mirror of
https://github.com/samsonjs/instapaper.git
synced 2026-03-25 08:55:49 +00:00
Coerce BookmarkList bookmarks to correct format
Previously fetching all bookmarks caused the `instapaper_hash` not being set.
This commit is contained in:
parent
19304cc274
commit
546d4ca55b
2 changed files with 10 additions and 0 deletions
|
|
@ -60,6 +60,11 @@ module Instapaper
|
|||
if response.key?('hash')
|
||||
response['instapaper_hash'] = response.delete('hash')
|
||||
end
|
||||
if response.key?('bookmarks')
|
||||
response['bookmarks'] = response['bookmarks'].collect {|bookmark|
|
||||
coerce_hash(bookmark)
|
||||
}
|
||||
end
|
||||
response
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -27,6 +27,11 @@ describe Instapaper::Client::Bookmarks do
|
|||
expect(bookmark).to be_an Instapaper::Bookmark
|
||||
end
|
||||
end
|
||||
|
||||
it 'coerces bookmarks correctly' do
|
||||
list = client.bookmarks
|
||||
expect(list.bookmarks.first.instapaper_hash).to_not be_nil
|
||||
end
|
||||
end
|
||||
|
||||
describe '#update_read_progress' do
|
||||
|
|
|
|||
Loading…
Reference in a new issue