Sha256: c549a8f80719600b3e18f91ec07ce4eab19f794b1b2103c92c756c94348e6653

Contents?: true

Size: 1.05 KB

Versions: 14

Compression:

Stored size: 1.05 KB

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::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

14 entries across 14 versions & 1 rubygems

Version Path
github_api-0.11.3 spec/github/repos/collaborators/remove_spec.rb
github_api-0.11.2 spec/github/repos/collaborators/remove_spec.rb
github_api-0.11.1 spec/github/repos/collaborators/remove_spec.rb
github_api-0.11.0 spec/github/repos/collaborators/remove_spec.rb
github_api-0.10.2 spec/github/repos/collaborators/remove_spec.rb
github_api-0.10.1 spec/github/repos/collaborators/remove_spec.rb
github_api-0.10.0 spec/github/repos/collaborators/remove_spec.rb
github_api-0.9.7 spec/github/repos/collaborators/remove_spec.rb
github_api-0.9.6 spec/github/repos/collaborators/remove_spec.rb
github_api-0.9.5 spec/github/repos/collaborators/remove_spec.rb
github_api-0.9.4 spec/github/repos/collaborators/remove_spec.rb
github_api-0.9.3 spec/github/repos/collaborators/remove_spec.rb
github_api-0.9.2 spec/github/repos/collaborators/remove_spec.rb
github_api-0.9.1 spec/github/repos/collaborators/remove_spec.rb