require 'ostruct' require 'iremix/user' module Iremix describe User do describe ".current" do it "returns the parsed user" do token = OpenStruct.new(:access_token => '123abc') response = OpenStruct.new(:parsed => 'user_json_parsed') token.should_receive(:get) .with('/api/v1/people/current.json', :params => { :access_token => '123abc' }) .and_return(response) Iremix::User.current(token).should == 'user_json_parsed' end end end end