Sha256: 963e32121f55cc9cbeb543cee1851083c65e646e4926a248d0552e16e393b593

Contents?: true

Size: 1.11 KB

Versions: 9

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 => '{}', :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 => '{}', :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

9 entries across 9 versions & 1 rubygems

Version Path
github_api-0.12.3 spec/integration/multiple_invocations_spec.rb
github_api-0.12.2 spec/integration/multiple_invocations_spec.rb
github_api-0.12.1 spec/integration/multiple_invocations_spec.rb
github_api-0.12.0 spec/integration/multiple_invocations_spec.rb
github_api-0.11.3 spec/integration/multiple_invocations_spec.rb
github_api-0.11.2 spec/integration/multiple_invocations_spec.rb
github_api-0.11.1 spec/integration/multiple_invocations_spec.rb
github_api-0.11.0 spec/integration/multiple_invocations_spec.rb
github_api-0.10.2 spec/integration/multiple_invocations_spec.rb