Sha256: e1cd2920f74dcb9f6c287e40c4efbc39c4b543bd9cdc031ecb782df676562deb

Contents?: true

Size: 1.05 KB

Versions: 11

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

describe TumblrWrapper::Blog do
  let(:token) { mock(:token) }
  subject(:blog) { TumblrWrapper::Blog.new('myblog.tumblr.com') }

  it "is a blog resource" do
    TumblrWrapper::Blog.superclass.should == TumblrWrapper::BlogResource
  end

  describe '.info' do
    it "makes an api request" do
      blog.should_receive(:http_get).with('info')

      blog.info
    end
  end

  describe "followers" do
    it "makes an oauth request" do
      blog.should_receive(:http_get).with('followers', {signed: true}, {})

      blog.followers
    end

    it "accepts parameters" do
      blog.should_receive(:http_get).with('followers', {signed: true}, { limit: 20, offset: 5 })

      blog.followers({ limit: 20, offset: 5 })
    end
  end

  describe "posts" do
    it "makes an api request" do
      blog.should_receive(:http_get).with('posts/', {signed: false}, {})

      blog.posts
    end

    it "accepts type parameter" do
      blog.should_receive(:http_get).with('posts/', {signed: false}, type: 'text')

      blog.posts(type: 'text')
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tumblr_wrapper-0.4.2 spec/blog_spec.rb
tumblr_wrapper-0.4.1 spec/blog_spec.rb
tumblr_wrapper-0.4.0 spec/blog_spec.rb
tumblr_wrapper-0.3.4 spec/blog_spec.rb
tumblr_wrapper-0.3.3 spec/blog_spec.rb
tumblr_wrapper-0.3.2 spec/blog_spec.rb
tumblr_wrapper-0.3.1 spec/blog_spec.rb
tumblr_wrapper-0.3.0 spec/blog_spec.rb
tumblr_wrapper-0.2.1 spec/blog_spec.rb
tumblr_wrapper-0.2.0 spec/blog_spec.rb
tumblr_wrapper-0.1.1 spec/blog_spec.rb