Sha256: b9cebcdd4488b881aed7ea8170554351080c3d43eb1c2cd748083a0c53cf88d6

Contents?: true

Size: 1016 Bytes

Versions: 4

Compression:

Stored size: 1016 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::Client::Orgs::Members, '#publicize' do
  let(:org)    { 'github' }
  let(:member) { 'peter-murach' }
  let(:request_path) { "/orgs/#{org}/public_members/#{member}" }

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

  after { reset_authentication_for(subject) }

  context "request perfomed successfully" do
    let(:body) { fixture('orgs/members.json') }
    let(:status) { 204 }

    it "should fail to get resource without org name" do
      expect { subject.publicize }.to raise_error(ArgumentError)
    end

    it { expect { subject.publicize org }.to raise_error(ArgumentError) }

    it "should get the resources" do
      subject.publicize org, member
      a_put(request_path).should have_been_made
    end
  end

  it_should_behave_like 'request failure' do
    let(:requestable) { subject.publicize org, member }
  end
end # publicize

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
github_api-0.12.3 spec/github/client/orgs/members/publicize_spec.rb
github_api-0.12.2 spec/github/client/orgs/members/publicize_spec.rb
github_api-0.12.1 spec/github/client/orgs/members/publicize_spec.rb
github_api-0.12.0 spec/github/client/orgs/members/publicize_spec.rb