forked from bufferapp/buffer-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuffer_spec.rb
More file actions
36 lines (29 loc) · 851 Bytes
/
buffer_spec.rb
File metadata and controls
36 lines (29 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require 'spec_helper'
describe Buffer::Client do
let(:id) { "5160746d54f04a5e3a00000f" }
subject do
Buffer::Client.new("some_token")
end
describe "#initialize" do
it "allows a token to be set and retrieved" do
subject.access_token.should eq("some_token")
end
end
describe "#connection" do
it "assigns the connection instance variable" do
subject.connection.should eq(subject.instance_variable_get(:@connection))
end
end
describe "#info" do
before do
stub_request(:get, "#{base_path}/info/configuration.json?access_token=some_token").
to_return(fixture("info.txt"))
end
it "connects to the correct endpoint" do
subject.info
end
it "retrieves the correct name" do
subject.info.services.twitter.types.profile.name.should eq("Twitter")
end
end
end