Sha256: 1d03013daa5de7b324a09d578797c82b63ce05633b9e8f8985ae019de713a7a8

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::Client::Repos::Collaborators, '#remove' do
  let(:user) { 'peter-murach' }
  let(:repo) { 'github' }
  let(:collaborator) { 'octocat' }
  let(:request_path) { "/repos/#{user}/#{repo}/collaborators/#{collaborator}" }

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

  after { reset_authentication_for(subject) }

  context "resouce removed" do
    let(:body) { '' }
    let(:status) { 204 }

    it { expect { subject.remove }.to raise_error(ArgumentError) }

    it "should fail to add resource if 'collaborator' input is missing" do
      expect { subject.remove user, repo }.to raise_error(ArgumentError)
    end

    it "should add resource successfully" do
      subject.remove user, repo, collaborator
      a_delete(request_path).should have_been_made
    end
  end

  it_should_behave_like 'request failure' do
    let(:requestable) { subject.remove user, repo, collaborator }
  end
end # remove

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
github_api-0.12.3 spec/github/client/repos/collaborators/remove_spec.rb
github_api-0.12.2 spec/github/client/repos/collaborators/remove_spec.rb
github_api-0.12.1 spec/github/client/repos/collaborators/remove_spec.rb
github_api-0.12.0 spec/github/client/repos/collaborators/remove_spec.rb