Sha256: b1cdf483d6c72590c5910f55cb55dd8408907faa3807f862f62f6234f38cdd51

Contents?: true

Size: 743 Bytes

Versions: 4

Compression:

Stored size: 743 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::Client::Repos::Contents, '#readme' do
  let(:user) { 'peter-murach' }
  let(:repo) { 'github' }
  let(:request_path) { "/repos/#{user}/#{repo}/readme" }

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

  after { reset_authentication_for(subject) }

  let(:body) { fixture('repos/readme.json') }
  let(:status) { 200 }

  it "should get the resources" do
    subject.readme user, repo
    a_get(request_path).should have_been_made
  end

  it "should get readme information" do
    readme = subject.readme user, repo
    readme.name.should == 'README.md'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
github_api-0.12.3 spec/github/client/repos/contents/readme_spec.rb
github_api-0.12.2 spec/github/client/repos/contents/readme_spec.rb
github_api-0.12.1 spec/github/client/repos/contents/readme_spec.rb
github_api-0.12.0 spec/github/client/repos/contents/readme_spec.rb