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

Version Path
emojidex-0.0.23 spec/api/search/emoji_spec.rb
emojidex-0.0.22 spec/api/search/emoji_spec.rb
emojidex-0.0.21 spec/api/search/emoji_spec.rb
emojidex-0.0.20 spec/api/search/emoji_spec.rb
emojidex-0.0.19 spec/api/search/emoji_spec.rb
emojidex-0.0.18 spec/api/search/emoji_spec.rb
emojidex-0.0.17 spec/api/search/emoji_spec.rb
emojidex-0.0.16 spec/api/search/emoji_spec.rb
emojidex-0.0.15 spec/api/search/emoji_spec.rb
emojidex-0.0.14 spec/api/search/emoji_spec.rb
emojidex-0.0.13 spec/api/search/emoji_spec.rb
emojidex-0.0.12 spec/api/search/emoji_spec.rb
emojidex-0.0.11 spec/api/search/emoji_spec.rb
emojidex-0.0.10 spec/api/search/emoji_spec.rb
emojidex-0.0.9 spec/api/search/emoji_spec.rb