Sha256: da67b4159ae90edf93517e2210317d134ce204f50e0d06736750dd63b16782c7
Contents?: true
Size: 863 Bytes
Versions: 15
Compression:
Stored size: 863 Bytes
Contents
require 'spec_helper' describe Emojidex::API::Search::Emoji do subject { Emojidex::Client.new(host: 'http://localhost') } let!(:api_url) { 'http://localhost/api/v1' } describe '#emoji' do before do stub_get("#{api_url}/search/emoji.json") .with(query: { 'q[code_cont]' => 't' }) .to_return( body: fixture('search_emoji.json'), headers: { content_type: 'application/json' } ) end it 'requests the correct resource' do subject.emoji_code_cont('t') expect(a_get("#{api_url}/search/emoji.json") .with(query: { 'q[code_cont]' => 't' })).to have_been_made end it 'returns the requested search' do results = subject.emoji_code_cont('t') expect(results).to be_an Array expect(results.first).to be_a Hash end end end
Version data entries
15 entries across 15 versions & 1 rubygems