Sha256: 19713937f55addffa8a1eb607aacd47a9aa2b774b08791345f86e180c78ab39f

Contents?: true

Size: 855 Bytes

Versions: 4

Compression:

Stored size: 855 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::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.11.3 spec/github/search/legacy/email_spec.rb
github_api-0.11.2 spec/github/search/legacy/email_spec.rb
github_api-0.11.1 spec/github/search/legacy/email_spec.rb
github_api-0.11.0 spec/github/search/legacy/email_spec.rb