fixed activity_streams::photo controller spec

This commit is contained in:
MrZYX 2011-05-26 00:01:10 +02:00
parent 0c5bdece5a
commit ba08c38a74
2 changed files with 27 additions and 1 deletions

View file

@ -21,6 +21,8 @@ class ActivityStreams::PhotosController < ApplicationController
current_user.dispatch_post(@photo, :url => post_url(@photo)) current_user.dispatch_post(@photo, :url => post_url(@photo))
render :nothing => true, :status => 201 render :nothing => true, :status => 201
else
render :nothing => true, :status => 422
end end
end end

View file

@ -4,7 +4,31 @@ describe ActivityStreams::PhotosController do
describe '#create' do describe '#create' do
before do before do
@json = JSON.parse <<JSON @json = JSON.parse <<JSON
{"activity":{"actor":{"url":"http://cubbi.es/daniel","displayName":"daniel","objectType":"person"},"published":"2011-05-19T18:12:23Z","verb":"save","object":{"objectType":"photo","url":"http://i658.photobucket.com/albums/uu308/R3b3lAp3/Swagger_dog.jpg","image":{"url":"http://i658.photobucket.com/albums/uu308/R3b3lAp3/Swagger_dog.jpg","width":637,"height":469}},"provider":{"url":"http://cubbi.es/","displayName":"Cubbi.es"}}} {
"activity": {
"actor": {
"url":"http://cubbi.es/daniel",
"displayName":"daniel",
"objectType":"person"
},
"published":"2011-05-19T18:12:23Z",
"verb":"save",
"object": {
"objectType":"photo",
"url":"http://i658.photobucket.com/albums/uu308/R3b3lAp3/Swagger_dog.jpg",
"id":"http://i658.photobucket.com/albums/uu308/R3b3lAp3/Swagger_dog.jpg",
"image": {
"url":"http://i658.photobucket.com/albums/uu308/R3b3lAp3/Swagger_dog.jpg",
"width":637,
"height":469
}
},
"provider": {
"url":"http://cubbi.es/",
"displayName":"Cubbi.es"
}
}
}
JSON JSON
end end
it 'allows token authentication' do it 'allows token authentication' do