Sha256: 8e80f52c5d93c277f09ba37f44878ab184736d32d2e9e4a1f4489bf528bbe215

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

require 'helper'

describe Octokit::Client::Pulls do

  before do
    @client = Octokit::Client.new(:login => 'sferik')
  end

  describe ".create_pull_request" do

    it "should create a pull request" do
      stub_post("pulls/sferik/rails_admin").
        with(:pull => {:base => "master", :head => "pengwynn:master", :title => "Title", :body => "Body"}).
        to_return(:body => fixture("pulls.json"))
      issues = @client.create_pull_request("sferik/rails_admin", "master", "pengwynn:master", "Title", "Body")
      issues.first.number.should == 251
    end

  end

  describe ".pull_requests" do

    it "should return all pull requests" do
      stub_get("pulls/sferik/rails_admin/open").
        to_return(:body => fixture("pulls.json"))
      pulls = @client.pulls("sferik/rails_admin")
      pulls.first.number.should == 251
    end

  end

  describe ".pull_request" do

    it "should return a pull request" do
      stub_get("pulls/sferik/rails_admin/251").
        to_return(:body => fixture("pull.json"))
      pull = @client.pull("sferik/rails_admin", 251)
      pull.number.should == 251
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
octokit-0.6.1 spec/octokit/client/pulls_spec.rb
octokit-0.6.0 spec/octokit/client/pulls_spec.rb