Sha256: d5f09d4d09c0c8200d8a893bffb02f287987747ada6dde44a4ce04181881cedc

Contents?: true

Size: 1.11 KB

Versions: 7

Compression:

Stored size: 1.11 KB

Contents

# encoding: utf-8

require 'spec_helper'

describe Github, 'invocations' do

  context 'repo commits with sha' do
    let(:user) { "peter-murach" }
    let(:repo) { "github" }
    let(:sha)  { "ceb66b61264657898cd6608c7e9ed78072169664" }

    let(:request_path) { "/repos/#{user}/#{repo}/commits/#{sha}" }

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

    it 'requests commit information twice' do
      subject.repos.commits.get user, repo, sha
      subject.repos.commits.get user, repo, sha
      a_get(request_path).should have_been_made.times(2)
    end
  end

  context 'organization info' do
    let(:org)  { "thoughtbot" }

    let(:request_path) { "/orgs/#{org}" }

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

    it 'requests organization information twice' do
      subject.orgs.get org
      subject.orgs.get org
      a_get(request_path).should have_been_made.times(2)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
github_api-0.10.1 spec/integration/multiple_invocations_spec.rb
github_api-0.10.0 spec/integration/multiple_invocations_spec.rb
github_api-0.9.7 spec/integration/multiple_invocations_spec.rb
github_api-0.9.6 spec/integration/multiple_invocations_spec.rb
github_api-0.9.5 spec/integration/multiple_invocations_spec.rb
github_api-0.9.4 spec/integration/multiple_invocations_spec.rb
github_api-0.9.3 spec/integration/multiple_invocations_spec.rb