fixed activity_streams::photo controller spec
This commit is contained in:
parent
0c5bdece5a
commit
ba08c38a74
2 changed files with 27 additions and 1 deletions
|
|
@ -21,6 +21,8 @@ class ActivityStreams::PhotosController < ApplicationController
|
|||
current_user.dispatch_post(@photo, :url => post_url(@photo))
|
||||
|
||||
render :nothing => true, :status => 201
|
||||
else
|
||||
render :nothing => true, :status => 422
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,31 @@ describe ActivityStreams::PhotosController do
|
|||
describe '#create' do
|
||||
before do
|
||||
@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
|
||||
end
|
||||
it 'allows token authentication' do
|
||||
|
|
|
|||
Loading…
Reference in a new issue