remove text alias to get_text

This commit is contained in:
stve 2015-02-14 14:47:28 -05:00
parent 49ae0497c6
commit de1196717d
2 changed files with 3 additions and 8 deletions

View file

@ -70,7 +70,6 @@ module Instapaper
def get_text(bookmark_id)
perform_post_with_unparsed_response('/api/1/bookmarks/get_text', bookmark_id: bookmark_id)
end
alias_method :text, :get_text
end
end
end

View file

@ -178,26 +178,22 @@ describe Instapaper::Client::Bookmarks do
end
end
describe '.text' do
describe '#get_text' do
before do
stub_post('/api/1/bookmarks/get_text')
.to_return(body: fixture('bookmarks_get_text.txt'), headers: {content_type: 'text/html; charset=utf-8'})
end
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'}))
.to have_been_made
end
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).to include("Ideo's Axioms for Starting Disruptive New Businesses")
end
it 'should be aliased as .get_text' do
expect(client.text(123)).to eq(client.get_text(123))
end
end
end