Sha256: 61be86ba1524e1f42814c7dfd11d8cda98f3d48b34d24cedf3340152b659b39b
Contents?: true
Size: 1.41 KB
Versions: 3
Compression:
Stored size: 1.41 KB
Contents
require File.expand_path('../../spec_helper', __FILE__) describe Yammer::Message do context 'class methods' do subject { Yammer::Message } describe '#create' do it 'creates a new group' do stub_request(:post, "https://www.yammer.com/api/v1/messages").with( :body => { :name => 'rails team', :privacy => 'public' }, :headers => { 'Accept' => 'application/json', 'Authorization' => "Bearer #{Yammer.access_token}", 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => "Yammer Ruby Gem #{Yammer::Version}" } ).to_return( :status => 201, :body => '', :headers => {'Location' => 'https://www.yammer.com/api/v1/messages/2'} ) subject.create(:name => 'rails team', :privacy => 'public') end end describe '#get' do it 'returns message response' do stub_request(:get, "https://www.yammer.com/api/v1/messages/1").with( :headers => { 'Accept' => 'application/json', 'Authorization' => "Bearer #{Yammer.access_token}", 'User-Agent' => "Yammer Ruby Gem #{Yammer::Version}" } ).to_return( :status => 200, :body => fixture('message.json'), :headers => {} ) subject.get(1) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
yammer-client-0.1.2 | spec/model/message_spec.rb |
yammer-client-0.1.1 | spec/model/message_spec.rb |
yammer-client-0.1.0 | spec/model/message_spec.rb |