mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Merge commit from fork
This commit is contained in:
parent
71ae4cf2cf
commit
c1fb6893c5
2 changed files with 26 additions and 3 deletions
|
|
@ -3,9 +3,10 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'Severed Relationships' do
|
||||
let(:account_rs_event) { Fabricate :account_relationship_severance_event }
|
||||
let(:account_rs_event) { Fabricate(:account_relationship_severance_event) }
|
||||
let(:user) { account_rs_event.account.user }
|
||||
|
||||
before { sign_in Fabricate(:user) }
|
||||
before { sign_in user }
|
||||
|
||||
describe 'GET /severed_relationships/:id/following' do
|
||||
it 'returns a CSV file with correct data' do
|
||||
|
|
@ -22,6 +23,17 @@ RSpec.describe 'Severed Relationships' do
|
|||
expect(response.body)
|
||||
.to include('Account address')
|
||||
end
|
||||
|
||||
context 'when the user is not the subject of the event' do
|
||||
let(:user) { Fabricate(:user) }
|
||||
|
||||
it 'returns a 404' do
|
||||
get following_severed_relationship_path(account_rs_event, format: :csv)
|
||||
|
||||
expect(response)
|
||||
.to have_http_status(404)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'GET /severed_relationships/:id/followers' do
|
||||
|
|
@ -39,5 +51,16 @@ RSpec.describe 'Severed Relationships' do
|
|||
expect(response.body)
|
||||
.to include('Account address')
|
||||
end
|
||||
|
||||
context 'when the user is not the subject of the event' do
|
||||
let(:user) { Fabricate(:user) }
|
||||
|
||||
it 'returns a 404' do
|
||||
get followers_severed_relationship_path(account_rs_event, format: :csv)
|
||||
|
||||
expect(response)
|
||||
.to have_http_status(404)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue