0
0
Fork 0

Change ActivityPub paging to match spec. Clean up ActivityPub outbox changes. (#2410)

* Change ActivityPub paging to match spec. Clean up ActivityPub outbox changes.

* Fix code style and test failures for OutboxController.

* Attempt to fix CI errors.
This commit is contained in:
Evan Minto 2017-04-25 06:06:06 -07:00 committed by Eugen Rochko
parent 8b5179d006
commit 122d59ac41
14 changed files with 182 additions and 110 deletions

View file

@ -11,7 +11,7 @@ RSpec.describe Api::Activitypub::NotesController, type: :controller do
public_status = nil
before do
public_status = Status.create!(account: user_alice.account, text: 'Hello world', visibility: :public)
public_status = Fabricate(:status, account: user_alice.account, text: 'Hello world', visibility: :public)
@request.env['HTTP_ACCEPT'] = 'application/activity+json'
get :show, params: { id: public_status.id }
@ -25,10 +25,6 @@ RSpec.describe Api::Activitypub::NotesController, type: :controller do
expect(response.header['Content-Type']).to include 'application/activity+json'
end
it 'sets Access-Control-Allow-Origin header to *' do
expect(response.header['Access-Control-Allow-Origin']).to eq '*'
end
it 'returns http success' do
json_data = JSON.parse(response.body)
expect(json_data).to include('@context' => 'https://www.w3.org/ns/activitystreams')
@ -46,8 +42,8 @@ RSpec.describe Api::Activitypub::NotesController, type: :controller do
reply = nil
before do
original = Status.create!(account: user_alice.account, text: 'Hello world', visibility: :public)
reply = Status.create!(account: user_bob.account, text: 'Hello world', in_reply_to_id: original.id, visibility: :public)
original = Fabricate(:status, account: user_alice.account, text: 'Hello world', visibility: :public)
reply = Fabricate(:status, account: user_bob.account, text: 'Hello world', in_reply_to_id: original.id, visibility: :public)
@request.env['HTTP_ACCEPT'] = 'application/activity+json'
get :show, params: { id: reply.id }
@ -61,10 +57,6 @@ RSpec.describe Api::Activitypub::NotesController, type: :controller do
expect(response.header['Content-Type']).to include 'application/activity+json'
end
it 'sets Access-Control-Allow-Origin header to *' do
expect(response.header['Access-Control-Allow-Origin']).to eq '*'
end
it 'returns http success' do
json_data = JSON.parse(response.body)
expect(json_data).to include('@context' => 'https://www.w3.org/ns/activitystreams')