Sha256: f8b015bd27f5b123c61ff2ffc5744a8d9e31074876a25fb8898af1551f4538c5

Contents?: true

Size: 1003 Bytes

Versions: 14

Compression:

Stored size: 1003 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::Repos::Commits, '#compare' do
  let(:user) { 'peter-murach' }
  let(:repo) { 'github' }
  let(:base) { 'master' }
  let(:head) { 'topic' }
  let(:request_path) { "/repos/#{user}/#{repo}/compare/#{base}...#{head}" }

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

  after { reset_authentication_for(subject) }

  it "should fail to get resource without base" do
    expect {
      subject.compare user, repo, nil, head
    }.to raise_error(ArgumentError)
  end

  it "should compare successfully" do
    subject.compare user, repo, base, head
    a_get(request_path).should have_been_made
  end

  it "should get comparison information" do
    commit = subject.compare user, repo, base, head
    commit.base_commit.commit.author.name.should == 'Monalisa Octocat'
  end

end # compare

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
github_api-0.9.0 spec/github/repos/commits/compare_spec.rb
github_api-0.8.11 spec/github/repos/commits/compare_spec.rb
github_api-0.8.10 spec/github/repos/commits/compare_spec.rb
github_api-0.8.9 spec/github/repos/commits/compare_spec.rb
github_api-0.8.8 spec/github/repos/commits/compare_spec.rb
github_api-0.8.7 spec/github/repos/commits/compare_spec.rb
github_api-0.8.6 spec/github/repos/commits/compare_spec.rb
github_api-0.8.5 spec/github/repos/commits/compare_spec.rb
github_api-0.8.4 spec/github/repos/commits/compare_spec.rb
github_api-0.8.3 spec/github/repos/commits/compare_spec.rb
github_api-0.8.2 spec/github/repos/commits/compare_spec.rb
github_api-0.8.1 spec/github/repos/commits/compare_spec.rb
github_api-0.8.0 spec/github/repos/commits/compare_spec.rb
github_api-0.7.2 spec/github/repos/commits/compare_spec.rb