Sha256: 09defb0fa203c38340d532a8416e9ec5456156832eae81d2d6850d0fef1f9443

Contents?: true

Size: 1.63 KB

Versions: 3

Compression:

Stored size: 1.63 KB

Contents

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

describe Yammer::Api::Group do

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

  subject { @client }

  describe '#all_groups' do
    it 'should fetch all groups in network' do
      subject.should_receive(:get).with('/api/v1/groups', {})
      subject.all_groups
    end
  end

  describe '#groups_for_user' do
    it 'should fetch all groups for user' do
      subject.should_receive(:get).with('/api/v1/groups/for_user/2')
      subject.groups_for_user(2)
    end
  end

  describe '#get_group' do
    it 'should fetch a thread' do
      subject.should_receive(:get).with('/api/v1/groups/1')
      subject.get_group(1)
    end
  end

  describe '#create_group' do
    it 'should fetch a thread' do
      subject.should_receive(:post).with('/api/v1/groups', {
        :name => 'my group',
        :description => 'A test group',
        :private => false
      })
      subject.create_group(:name => 'my group', :description => 'A test group', :private => false)
    end
  end

  describe '#update_group' do
    it 'should fetch a thread' do
      subject.should_receive(:post).with('/api/v1/groups/2', {
        :name => 'another group',
        :description => 'A modified group description',
      })
      subject.update_group(2, :name => 'another group', :description => 'A modified group description')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yammer-client-0.1.2 spec/api/group_spec.rb
yammer-client-0.1.1 spec/api/group_spec.rb
yammer-client-0.1.0 spec/api/group_spec.rb