Merge pull request #7 from vesan/fix-bookmark-list-bookmarks-not-being-coerced

Coerce BookmarkList bookmarks to correct format
This commit is contained in:
Steve Agalloco 2016-08-02 16:21:48 -04:00 committed by GitHub
commit 9c109f0da0
2 changed files with 10 additions and 0 deletions

View file

@ -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

View file

@ -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