Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream changes up to 5ef26d8fd50081c642b858a82bf0c5431b1c7e83 #2444

Merged
merged 73 commits into from
Oct 19, 2023
Merged
Changes from 1 commit
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
7d2cd71
Add variable delay before link verification of remote account links (…
ClearlyClaire Oct 11, 2023
66becf9
Fix haml-lint `InstanceVariables` rule for admin/reports/actions (#27…
mjankowski Oct 11, 2023
0111e48
Update dependency sidekiq to v6.5.12 (#27358)
renovate[bot] Oct 11, 2023
f9abe70
Fix haml-lint `InstanceVariables` rule for auth/registrations/status …
mjankowski Oct 11, 2023
1afb7f4
Update dependency lograge to v0.14.0 (#27363)
renovate[bot] Oct 11, 2023
608cd66
Update README requirements from node 14 to node 16 (#27369)
znarf Oct 11, 2023
d0a3331
Update dependency rubocop to v1.57.0 (#27371)
renovate[bot] Oct 11, 2023
f1ae72b
New Crowdin Translations (automated) (#27364)
github-actions[bot] Oct 11, 2023
d7a8f6b
Fix haml-lint `InstanceVariables` rule for relationships/account (#27…
mjankowski Oct 11, 2023
85b36fb
Update dependency devise to v4.9.3 (#27373)
renovate[bot] Oct 12, 2023
d4c2dca
Fix haml-lint `InstanceVariables` rule for auth/sessions/two_factor/o…
mjankowski Oct 12, 2023
c348b90
New Crowdin Translations (automated) (#27376)
github-actions[bot] Oct 12, 2023
c86ad45
Change PWA start URL from `/home` to `/` (#27377)
ClearlyClaire Oct 12, 2023
133f218
Add system specs for admin area `batch` actions (#25027)
mjankowski Oct 13, 2023
6a9aab3
Update dependency devise-two-factor to v4.1.1 (#27382)
renovate[bot] Oct 13, 2023
773d25e
New Crowdin Translations (automated) (#27388)
github-actions[bot] Oct 13, 2023
45bdd60
Fix when unfollow a tag, my post also disappears from the home timeli…
kmycode Oct 13, 2023
5c287c4
Update dependency rubocop to v1.57.1 (#27389)
renovate[bot] Oct 13, 2023
77098c6
Delete .github/FUNDING.yml (#27390)
renchap Oct 13, 2023
4230d1e
Migrate to request specs in `/api/v1/timelines/tag/:hashtag` (#25797)
danielmbrasil Oct 13, 2023
7664e3b
Migrate to request specs in `/api/v1/statuses/:status_id/source` (#25…
danielmbrasil Oct 13, 2023
ecdb31d
Migrate to request specs in `/api/v1/favourites` (#25518)
danielmbrasil Oct 13, 2023
fd9dea2
DB speedup in `API::` controller/request specs (#25516)
mjankowski Oct 13, 2023
bc6cd27
Migrate to request specs in `/api/v1/followed_tags` (#25472)
danielmbrasil Oct 13, 2023
abf0e1f
Move `SignedReqestHelpers` rspec config to separate file (#25453)
mjankowski Oct 13, 2023
058f73a
Add request specs for `/api/v1/reports` (#25475)
danielmbrasil Oct 13, 2023
cad8cc9
Speed-up on `MoveWorker` spec (#25528)
mjankowski Oct 13, 2023
71cfdd7
Fix duplicate tests (#27395)
ClearlyClaire Oct 13, 2023
1b195ce
Speed-up on `Rack::Attack` spec (#25542)
mjankowski Oct 13, 2023
82beeb2
Migrate to request specs in `/api/v1/admin/trends/links` (#25739)
danielmbrasil Oct 13, 2023
e0da64b
Fix empty ENV variables not using default nil value (#27400)
renchap Oct 13, 2023
f0ef87b
Update dependency i18n-tasks to v1.0.13 (#27403)
renovate[bot] Oct 16, 2023
a00fc83
Update dependency bufferutil to v4.0.8 (#27412)
renovate[bot] Oct 16, 2023
13456ef
New Crowdin Translations (automated) (#27410)
github-actions[bot] Oct 16, 2023
23f8e93
Fixes #23135 - Allow cross origin request for /nodeinfo/2.0 API (#27413)
palant Oct 16, 2023
299aa71
Fix handling of `inLanguage` attribute in preview card processing (#2…
ClearlyClaire Oct 16, 2023
00e92b4
Add coverage for `CLI::Statuses` command (#25321)
mjankowski Oct 16, 2023
f8afa0f
Remove unused stub json ld context (#25454)
mjankowski Oct 16, 2023
f5bc1f2
Add coverage for `ExistingUsernameValidator` (#25592)
mjankowski Oct 16, 2023
d9caa6e
Migrate to request specs in `/api/v1/admin/accounts` (#25563)
danielmbrasil Oct 16, 2023
8e61165
Migrate to request specs in `/api/v1/blocks` (#25517)
danielmbrasil Oct 16, 2023
cafdaec
Migrate to request specs in `/api/v1/lists/:id/accounts` (#25468)
danielmbrasil Oct 16, 2023
c91c017
Extract `card` partial from `disputes/strikes/show` view (#27426)
mjankowski Oct 16, 2023
08a376c
Fix `Style/CombinableLoops` cop (#27429)
mjankowski Oct 16, 2023
e0ed0f8
Migrate to request specs in `/api/v1/notifications` (#25553)
danielmbrasil Oct 16, 2023
708299b
Misc coverage improvements for `Admin::` and `Settings::` controllers…
mjankowski Oct 16, 2023
893b2f3
Extract shared example for cacheable response in specs (#25388)
mjankowski Oct 16, 2023
8d0f12f
Extract partials from `admin/accounts/show` view (#27428)
mjankowski Oct 16, 2023
33b073f
Extract partials from `admin/reports/show` view (#27427)
mjankowski Oct 16, 2023
fc9ab61
Expand spec coverage of `CLI::Media` (#27437)
mjankowski Oct 16, 2023
1084703
Update changelog (#27440)
ClearlyClaire Oct 17, 2023
19900f6
Add coverage for `UnreservedUsernameValidator` (#25590)
mjankowski Oct 17, 2023
d54fec2
Add coverage for `CLI::PreviewCards#remove` command (#27441)
mjankowski Oct 17, 2023
12bb7be
Spec speed ups on `AccountsController` spec (#25391)
mjankowski Oct 17, 2023
c4bddc9
Add spec for poll model (#23399)
leevic31 Oct 17, 2023
935d541
Fix missing redirections to make sure /home redirect to the advanced …
Signez Oct 17, 2023
1fb4e40
Run scheduled actions only on the main repo (#27343)
renchap Oct 17, 2023
c0cda1a
Let use http_hidden_proxy on docker-compose (#27054)
tribela Oct 17, 2023
b34a2b1
Fix errors in CLI specs (#27399)
ClearlyClaire Oct 17, 2023
65cd070
Refactor domains cli to remove model call from regex (#25878)
mjankowski Oct 17, 2023
1996fb6
Update dependency puma to v6.4.0 (#27006)
renovate[bot] Oct 17, 2023
2528a07
Update `rubocop-capybara` to version 2.19.0 (#26982)
mjankowski Oct 17, 2023
ad44d83
Support "in:public" search filter (#26976)
tribela Oct 17, 2023
0036de4
Update dependency rubocop-performance to v1.19.1 (#26949)
renovate[bot] Oct 17, 2023
71447ab
Fix `Capybara/ClickLinkOrButtonStyle` cop in spec/features/admin area…
mjankowski Oct 17, 2023
5ef26d8
Add RSpec GitHub annotations gem (#24040)
nschonni Oct 17, 2023
656a41d
Merge commit '77098c6f1c25958960df98a1510b28352a39704f' into glitch-s…
ClearlyClaire Oct 17, 2023
b867d45
Merge commit 'c91c0175db1cc8b954a977d29472886234ce9586' into glitch-s…
ClearlyClaire Oct 17, 2023
c10a667
Merge commit '935d54124e80e9fe5365c724e5c8827a2b3ed5b3' into glitch-s…
ClearlyClaire Oct 17, 2023
8bbbd01
[Glitch] Fix missing redirections to make sure /home redirect to the …
Signez Oct 17, 2023
63179f0
Merge commit '5ef26d8fd50081c642b858a82bf0c5431b1c7e83' into glitch-s…
ClearlyClaire Oct 17, 2023
0d18c47
Enable scheduled actions only on glitch-soc's repo
ClearlyClaire Oct 17, 2023
68401fc
[Glitch] Support "in:public" search filter
tribela Oct 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Migrate to request specs in /api/v1/timelines/tag/:hashtag (mastodo…
danielmbrasil authored Oct 13, 2023
commit 4230d1ee0a0752e0259e96e1590f7eb9fb1ebb9b
71 changes: 0 additions & 71 deletions spec/controllers/api/v1/timelines/tag_controller_spec.rb

This file was deleted.

112 changes: 112 additions & 0 deletions spec/requests/api/v1/timelines/tag_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe 'Tag' do
let(:user) { Fabricate(:user) }
let(:scopes) { 'read:statuses' }
let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) }
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
subject do
get "/api/v1/timelines/tag/#{hashtag}", headers: headers, params: params
end

let(:account) { Fabricate(:account) }
let!(:private_status) { PostStatusService.new.call(account, visibility: :private, text: '#life could be a dream') } # rubocop:disable RSpec/LetSetup
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!(:love_status) { PostStatusService.new.call(account, text: 'what is #love?') }
let(:params) { {} }
let(:hashtag) { 'life' }

context 'when given only one hashtag' do
let(:expected_statuses) { [life_status] }

it_behaves_like 'a successful request to the tag timeline'
end

context 'with any param' do
let(:expected_statuses) { [life_status, love_status] }
let(:params) { { any: %(love) } }

it_behaves_like 'a successful request to the tag timeline'
end

context 'with all param' do
let(:expected_statuses) { [life_status] }
let(:params) { { all: %w(love) } }

it_behaves_like 'a successful request to the tag timeline'
end

context 'with none param' do
let(:expected_statuses) { [war_status] }
let(:hashtag) { 'war' }
let(:params) { { none: %w(life love) } }

it_behaves_like 'a successful request to the tag timeline'
end

context 'with limit param' do
let(:hashtag) { 'love' }
let(:params) { { limit: 1 } }

it 'returns only the requested number of statuses' do
subject

expect(body_as_json.size).to eq(params[:limit])
end

it 'sets the correct pagination headers', :aggregate_failures do
subject

headers = response.headers['Link']

expect(headers.find_link(%w(rel prev)).href).to eq(api_v1_timelines_tag_url(limit: 1, min_id: love_status.id.to_s))
expect(headers.find_link(%w(rel next)).href).to eq(api_v1_timelines_tag_url(limit: 1, max_id: love_status.id.to_s))
end
end

context 'when the instance allows public preview' do
context 'when the user is not authenticated' do
let(:headers) { {} }
let(:expected_statuses) { [life_status] }

it_behaves_like 'a successful request to the tag timeline'
end
end

context 'when the instance does not allow public preview' do
before do
Form::AdminSettings.new(timeline_preview: false).save
end

context 'when the user is not authenticated' do
let(:headers) { {} }

it 'returns http unauthorized' do
subject

expect(response).to have_http_status(401)
end
end

context 'when the user is authenticated' do
let(:expected_statuses) { [life_status] }

it_behaves_like 'a successful request to the tag timeline'
end
end
end
end