Sha256: e64c4bee7fed159d33c712f077fc32aadec89e08274730f2ed63b7cbd150846e

Contents?: true

Size: 730 Bytes

Versions: 1

Compression:

Stored size: 730 Bytes

Contents

require 'ostruct'
require 'iremix/user'

module Iremix
  describe User do
    describe ".current" do
      it "returns the user" do
        token = OpenStruct.new(:token => '123abc')
        response = OpenStruct.new(:parsed => {"id"=>31637, "first_name"=>"nick", "last_name"=>"nick", "name"=>"nick", "email"=>"nick@neotericdesign.com", "profile_photo"=>nil, "created_at"=>"2012-04-23T14:41:20-05:00", "updated_at"=>"2012-05-04T09:28:56-05:00", "status"=>200})

        token.should_receive(:get)
              .with('/api/v1/people/current.json',
                    :params => { :access_token => '123abc' })
              .and_return(response)

        Iremix::User.current(token).id.should == 31637
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
iremix-ruby-0.0.5 spec/iremix/user_spec.rb