Fix bug in relationships API introduced by #6482 (#6527)

It was merge when it needed to be deep_merge. And added some tests
This commit is contained in:
Eugen Rochko
2018-02-21 23:22:12 +01:00
committed by GitHub
parent 61ed133fea
commit 4bc625166e
3 changed files with 24 additions and 2 deletions

View File

@ -66,6 +66,28 @@ describe Api::V1::Accounts::RelationshipsController do
expect(json.second[:requested]).to be false
expect(json.second[:domain_blocking]).to be false
end
it 'returns JSON with correct data on cached requests too' do
get :index, params: { id: [simon.id] }
json = body_as_json
expect(json).to be_a Enumerable
expect(json.first[:following]).to be true
expect(json.first[:showing_reblogs]).to be true
end
it 'returns JSON with correct data after change too' do
user.account.unfollow!(simon)
get :index, params: { id: [simon.id] }
json = body_as_json
expect(json).to be_a Enumerable
expect(json.first[:following]).to be false
expect(json.first[:showing_reblogs]).to be false
end
end
end
end