Sha256: 94be67d638d1a0faf35b9af8ab53948ff3f5e9554acb850c9474beed87735c01

Contents?: true

Size: 863 Bytes

Versions: 4

Compression:

Stored size: 863 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::Client::Search::Legacy, '#email' do
  let(:keyword)      { 'api' }
  let(:request_path) { "/legacy/user/email/#{keyword}" }

  before do
    stub_get(request_path).
      to_return(body: body, status: status,
        headers: {content_type: "application/json; charset=utf-8"})
  end

  context "resource found" do
    let(:body)   { fixture('search/email.json') }
    let(:status) { 200 }

    it "should get the resources" do
      subject.email keyword
      a_get(request_path).should have_been_made
    end

    it "should get the resource through params hash" do
      subject.email email: keyword
      a_get(request_path).should have_been_made
    end

    it "should get user information" do
      user = subject.email email: keyword
      user.user.username.should == 'techno'
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
github_api-0.12.3 spec/github/client/search/legacy/email_spec.rb
github_api-0.12.2 spec/github/client/search/legacy/email_spec.rb
github_api-0.12.1 spec/github/client/search/legacy/email_spec.rb
github_api-0.12.0 spec/github/client/search/legacy/email_spec.rb