Sha256: f8055388712c8fb8939bd6b933c289ea6924d262849a0a8b6dcb4765263c2256

Contents?: true

Size: 791 Bytes

Versions: 4

Compression:

Stored size: 791 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::Gists, '#delete' do
  let(:gist_id)   { 1 }
  let(:request_path) { "/gists/#{gist_id}" }
  let(:body) { fixture('gists/gist.json') }
  let(:status) { 204 }

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

  after { reset_authentication_for(subject) }

  it 'should raise error if gist id not present' do
    expect { subject.delete nil }.to raise_error(ArgumentError)
  end

  it "should remove resource successfully" do
    subject.delete gist_id
    a_delete(request_path).should have_been_made
  end

  it_should_behave_like 'request failure' do
    let(:requestable) { subject.delete gist_id }
  end

end # delete

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
github_api-0.9.0 spec/github/gists/delete_spec.rb
github_api-0.8.11 spec/github/gists/delete_spec.rb
github_api-0.8.10 spec/github/gists/delete_spec.rb
github_api-0.8.9 spec/github/gists/delete_spec.rb