mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Merge 6635a6f71d
into a50c8e951f
This commit is contained in:
commit
66b3db35c5
1 changed files with 13 additions and 10 deletions
|
@ -8,22 +8,25 @@ RSpec.describe 'Tag' do
|
||||||
let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) }
|
let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) }
|
||||||
let(:headers) { { 'Authorization' => "Bearer #{token.token}" } }
|
let(:headers) { { 'Authorization' => "Bearer #{token.token}" } }
|
||||||
|
|
||||||
shared_examples 'a successful request to the tag timeline' do
|
|
||||||
it 'returns the expected statuses', :aggregate_failures do
|
|
||||||
subject
|
|
||||||
|
|
||||||
expect(response).to have_http_status(200)
|
|
||||||
expect(body_as_json.pluck(:id)).to match_array(expected_statuses.map { |status| status.id.to_s })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'GET /api/v1/timelines/tag/:hashtag' do
|
describe 'GET /api/v1/timelines/tag/:hashtag' do
|
||||||
subject do
|
subject do
|
||||||
get "/api/v1/timelines/tag/#{hashtag}", headers: headers, params: params
|
get "/api/v1/timelines/tag/#{hashtag}", headers: headers, params: params
|
||||||
end
|
end
|
||||||
|
|
||||||
|
shared_examples 'a successful request to the tag timeline' do
|
||||||
|
it 'returns the expected statuses', :aggregate_failures do
|
||||||
|
subject
|
||||||
|
|
||||||
|
expect(response)
|
||||||
|
.to have_http_status(200)
|
||||||
|
expect(body_as_json.pluck(:id))
|
||||||
|
.to match_array(expected_statuses.map { |status| status.id.to_s })
|
||||||
|
.and not_include(private_status.id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
let(:account) { Fabricate(:account) }
|
let(:account) { Fabricate(:account) }
|
||||||
let!(:private_status) { PostStatusService.new.call(account, visibility: :private, text: '#life could be a dream') } # rubocop:disable RSpec/LetSetup
|
let!(:private_status) { PostStatusService.new.call(account, visibility: :private, text: '#life could be a dream') }
|
||||||
let!(:life_status) { PostStatusService.new.call(account, text: 'tell me what is my #life without your #love') }
|
let!(:life_status) { PostStatusService.new.call(account, text: 'tell me what is my #life without your #love') }
|
||||||
let!(:war_status) { PostStatusService.new.call(user.account, text: '#war, war never changes') }
|
let!(:war_status) { PostStatusService.new.call(user.account, text: '#war, war never changes') }
|
||||||
let!(:love_status) { PostStatusService.new.call(account, text: 'what is #love?') }
|
let!(:love_status) { PostStatusService.new.call(account, text: 'what is #love?') }
|
||||||
|
|
Loading…
Reference in a new issue