mirror of
https://github.com/samsonjs/instapaper.git
synced 2026-04-27 14:57:44 +00:00
remove text alias to get_text
This commit is contained in:
parent
49ae0497c6
commit
de1196717d
2 changed files with 3 additions and 8 deletions
|
|
@ -70,7 +70,6 @@ module Instapaper
|
||||||
def get_text(bookmark_id)
|
def get_text(bookmark_id)
|
||||||
perform_post_with_unparsed_response('/api/1/bookmarks/get_text', bookmark_id: bookmark_id)
|
perform_post_with_unparsed_response('/api/1/bookmarks/get_text', bookmark_id: bookmark_id)
|
||||||
end
|
end
|
||||||
alias_method :text, :get_text
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -178,26 +178,22 @@ describe Instapaper::Client::Bookmarks do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '.text' do
|
describe '#get_text' do
|
||||||
before do
|
before do
|
||||||
stub_post('/api/1/bookmarks/get_text')
|
stub_post('/api/1/bookmarks/get_text')
|
||||||
.to_return(body: fixture('bookmarks_get_text.txt'), headers: {content_type: 'text/html; charset=utf-8'})
|
.to_return(body: fixture('bookmarks_get_text.txt'), headers: {content_type: 'text/html; charset=utf-8'})
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should get the correct resource' do
|
it 'should get the correct resource' do
|
||||||
client.text(123)
|
client.get_text(123)
|
||||||
expect(a_post('/api/1/bookmarks/get_text').with(body: {bookmark_id: '123'}))
|
expect(a_post('/api/1/bookmarks/get_text').with(body: {bookmark_id: '123'}))
|
||||||
.to have_been_made
|
.to have_been_made
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should return the bookmark's html on success" do
|
it "should return the bookmark's html on success" do
|
||||||
bookmark = client.text(123)
|
bookmark = client.get_text(123)
|
||||||
expect(bookmark.length).to be > 0
|
expect(bookmark.length).to be > 0
|
||||||
expect(bookmark).to include("Ideo's Axioms for Starting Disruptive New Businesses")
|
expect(bookmark).to include("Ideo's Axioms for Starting Disruptive New Businesses")
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should be aliased as .get_text' do
|
|
||||||
expect(client.text(123)).to eq(client.get_text(123))
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue