require 'spec_helper' describe ActivityStreams::PhotosController do describe '#create' do before do @json = JSON.parse < token.access_token) response.should be_success end it 'denies an invalid oauth token' do post @url, @json.merge!(:oauth_token => "aoijgosidjg") response.status.should == 401 response.body.should be_empty end it 'allows token authentication' do bob.reset_authentication_token! post @url, @json.merge!(:auth_token => bob.authentication_token) response.should be_success end it 'correctly denies an invalid token' do post @url, @json.merge!(:auth_token => "iudsfghpsdifugh") response.status.should == 401 end end end