Sha256: fbcb9e0f4e76a0543438586cea7c7478641cb90d8062fe8469ee8c4d521f65b4

Contents?: true

Size: 996 Bytes

Versions: 4

Compression:

Stored size: 996 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::Client::PullRequests::Comments, '#delete' do
  let(:user)   { 'peter-murach' }
  let(:repo)   { 'github' }
  let(:number) { 1 }

  let(:request_path) { "/repos/#{user}/#{repo}/pulls/comments/#{number}" }
  let(:status) { 204 }
  let(:body) { fixture('pull_requests/comment.json') }

  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 'resource removed' do
    it 'should raise error if number not present' do
      expect { subject.delete user, repo }.to raise_error(ArgumentError)
    end

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
github_api-0.12.3 spec/github/client/pull_requests/comments/delete_spec.rb
github_api-0.12.2 spec/github/client/pull_requests/comments/delete_spec.rb
github_api-0.12.1 spec/github/client/pull_requests/comments/delete_spec.rb
github_api-0.12.0 spec/github/client/pull_requests/comments/delete_spec.rb