Sha256: 267f5ef1094f19ebd1f41f19bbd719061901c99869b9988ea9d82dcc5e3df669

Contents?: true

Size: 1.11 KB

Versions: 18

Compression:

Stored size: 1.11 KB

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::Orgs::Teams, '#remove_repo' do
  let(:team_id)   { 1 }
  let(:user) { 'peter-murach' }
  let(:repo) { 'github' }
  let(:request_path) { "/teams/#{team_id}/repos/#{user}/#{repo}" }

  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 deleted" do
    let(:body) { }
    let(:status) { 204 }

    it "should fail to delete resource if 'team' input is nil" do
      expect { subject.remove_repo nil, user, repo }.to raise_error(ArgumentError)
    end

    it "should fail to delete resource if 'user' input is nil" do
      expect { subject.remove_repo team_id, nil, repo }.to raise_error(ArgumentError)
    end

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

  it_should_behave_like 'request failure' do
    let(:requestable) { subject.remove_repo team_id, user, repo }
  end

end # remove_repo

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
github_api-0.11.3 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.11.2 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.11.1 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.11.0 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.10.2 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.10.1 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.10.0 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.9.7 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.9.6 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.9.5 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.9.4 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.9.3 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.9.2 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.9.1 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.9.0 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.8.11 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.8.10 spec/github/orgs/teams/remove_repo_spec.rb
github_api-0.8.9 spec/github/orgs/teams/remove_repo_spec.rb