Sha256: 79810f7d1e96a93ab4beb427d66fe1a87562ee8d3e163fdd92b916172e4ccae0

Contents?: true

Size: 1.12 KB

Versions: 6

Compression:

Stored size: 1.12 KB

Contents

require File.expand_path('../../spec_helper', __FILE__)

describe Yammer::Api::PendingAttachment do

  before :all do
    @client = Yammer::Client.new(
      :site_url     => 'https://www.yammer.com',
      :client_id     => 'PRbTcg9qjgKsp4jjpm1pw',
      :client_secret => 'Xn7kp7Ly0TCY4GtZWkmSsqGEPg10DmMADyjWkf2U',
      :access_token  => 'TolNOFka9Uls2DxahNi78A'
    )
  end

  subject { @client }

  describe '#get_pending_attachment' do
    it 'should fetch a pending attachment' do
      subject.should_receive(:get).with('/api/v1/pending_attachments/2')
      subject.get_pending_attachment(2)
    end
  end

  describe '#delete_pending_attachment' do
    it 'should delete a pending attachment' do
      subject.should_receive(:delete).with('/api/v1/pending_attachments/1')
      subject.delete_pending_attachment(1)
    end
  end

  describe '#create_pending_attachment' do
    it 'should create a pending attachment' do
      attachment = upload('attachment.txt')
      subject.should_receive(:post).with('/api/v1/pending_attachments', :attachment => attachment)
      subject.create_pending_attachment(attachment)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
yammer-client-0.1.8 spec/api/pending_attachment_spec.rb
yammer-client-0.1.7 spec/api/pending_attachment_spec.rb
yammer-client-0.1.6 spec/api/pending_attachment_spec.rb
yammer-client-0.1.5 spec/api/pending_attachment_spec.rb
yammer-client-0.1.4 spec/api/pending_attachment_spec.rb
yammer-client-0.1.3 spec/api/pending_attachment_spec.rb