diff --git a/.circleci/config.yml b/.circleci/config.yml index e157f8f223ba7934ca54e5a9fc217ceedce52414..318f4d2be1984ec0afc611b2e9785b0a3cb79d57 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -153,7 +153,7 @@ jobs: - run: command: ./bin/rails db:migrate name: Run all pre-deployment migrations - evironment: + environment: SKIP_POST_DEPLOYMENT_MIGRATIONS: true - run: command: ./bin/rails db:migrate diff --git a/.env.production.sample b/.env.production.sample index 8eeff3794aa062699bc60b873416a134bfdedd42..4fc58072f1d455d4f57157af33c1918097d4e7c9 100644 --- a/.env.production.sample +++ b/.env.production.sample @@ -58,7 +58,7 @@ SMTP_SERVER=smtp.mailgun.org SMTP_PORT=587 SMTP_LOGIN= SMTP_PASSWORD= -SMTP_FROM_ADDRESS=notificatons@example.com +SMTP_FROM_ADDRESS=notifications@example.com # File storage (optional) # ----------------------- diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e9d6ea1d8f1f7d6b2cc1452924ddd5a6dbd7ca9..d8fde27fe309afc76e073c950a37907331a3410f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,7 +87,7 @@ All notable changes to this project will be documented in this file. - Fix suspended accounts statuses being merged back into timelines ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16628)) - Fix crash when encountering invalid account fields ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16598)) - Fix invalid blurhash handling for remote activities ([noellabo](https://github.com/mastodon/mastodon/pull/16583)) -- Fix newlines being added to accout notes when an account moves ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16415), [noellabo](https://github.com/mastodon/mastodon/pull/16576)) +- Fix newlines being added to account notes when an account moves ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16415), [noellabo](https://github.com/mastodon/mastodon/pull/16576)) - Fix crash when creating an announcement with links ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16941)) - Fix logging out from one browser logging out all other sessions ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/16943)) @@ -420,7 +420,7 @@ All notable changes to this project will be documented in this file. - Fix inefficiency when fetching bookmarks ([akihikodaki](https://github.com/mastodon/mastodon/pull/14674)) - Fix inefficiency when fetching favourites ([akihikodaki](https://github.com/mastodon/mastodon/pull/14673)) - Fix inefficiency when fetching media-only account timeline ([akihikodaki](https://github.com/mastodon/mastodon/pull/14675)) -- Fix inefficieny when deleting accounts ([Gargron](https://github.com/mastodon/mastodon/pull/15387), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15409), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15407), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15408), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15402), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15416), [Gargron](https://github.com/mastodon/mastodon/pull/15421)) +- Fix inefficiency when deleting accounts ([Gargron](https://github.com/mastodon/mastodon/pull/15387), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15409), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15407), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15408), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15402), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/15416), [Gargron](https://github.com/mastodon/mastodon/pull/15421)) - Fix redundant query when processing batch actions on custom emojis ([niwatori24](https://github.com/mastodon/mastodon/pull/14534)) - Fix slow distinct queries where grouped queries are faster ([Gargron](https://github.com/mastodon/mastodon/pull/15287)) - Fix performance on instances list in admin UI ([Gargron](https://github.com/mastodon/mastodon/pull/15282)) @@ -507,7 +507,7 @@ All notable changes to this project will be documented in this file. - Add blurhash to link previews ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13984), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14143), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13985), [Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/14267), [Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/14278), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14126), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14261), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14260)) - In web UI, toots cannot be marked as sensitive unless there is media attached - However, it's possible to do via API or ActivityPub - - Thumnails of link previews of such posts now use blurhash in web UI + - Thumbnails of link previews of such posts now use blurhash in web UI - The Card entity in REST API has a new `blurhash` attribute - Add support for `summary` field for media description in ActivityPub ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13763)) - Add hints about incomplete remote content to web UI ([Gargron](https://github.com/mastodon/mastodon/pull/14031), [noellabo](https://github.com/mastodon/mastodon/pull/14195)) @@ -530,7 +530,7 @@ All notable changes to this project will be documented in this file. - The `meta` attribute on the Media Attachment entity in REST API can now have a `colors` attribute which in turn contains three hex colors: `background`, `foreground`, and `accent` - The background color is chosen from the most dominant color around the edges of the thumbnail - The foreground and accent colors are chosen from the colors that are the most different from the background color using the CIEDE2000 algorithm - - The most satured color of the two is designated as the accent color + - The most saturated color of the two is designated as the accent color - The one with the highest W3C contrast is designated as the foreground color - If there are not enough colors in the thumbnail, new ones are generated using a monochrome pattern - Add a visibility indicator to toots in web UI ([noellabo](https://github.com/mastodon/mastodon/pull/14123), [highemerly](https://github.com/mastodon/mastodon/pull/14292)) @@ -556,7 +556,7 @@ All notable changes to this project will be documented in this file. - Change boost button to no longer serve as visibility indicator in web UI ([noellabo](https://github.com/mastodon/mastodon/pull/14132), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14373)) - Change contrast of flash messages ([cchoi12](https://github.com/mastodon/mastodon/pull/13892)) - Change wording from "Hide media" to "Hide image/images" in web UI ([ariasuni](https://github.com/mastodon/mastodon/pull/13834)) -- Change appearence of settings pages to be more consistent ([ariasuni](https://github.com/mastodon/mastodon/pull/13938)) +- Change appearance of settings pages to be more consistent ([ariasuni](https://github.com/mastodon/mastodon/pull/13938)) - Change "Add media" tooltip to not include long list of formats in web UI ([ariasuni](https://github.com/mastodon/mastodon/pull/13954)) - Change how badly contrasting emoji are rendered in web UI ([leo60228](https://github.com/mastodon/mastodon/pull/13773), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13772), [mfmfuyu](https://github.com/mastodon/mastodon/pull/14020), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/14015)) - Change structure of unavailable content section on about page ([ariasuni](https://github.com/mastodon/mastodon/pull/13930)) @@ -578,8 +578,8 @@ All notable changes to this project will be documented in this file. ### Fixed - Fix `following` param not working when exact match is found in account search ([noellabo](https://github.com/mastodon/mastodon/pull/14394)) -- Fix sometimes occuring duplicate mention notifications ([noellabo](https://github.com/mastodon/mastodon/pull/14378)) -- Fix RSS feeds not being cachable ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14368)) +- Fix sometimes occurring duplicate mention notifications ([noellabo](https://github.com/mastodon/mastodon/pull/14378)) +- Fix RSS feeds not being cacheable ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14368)) - Fix lack of locking around processing of Announce activities in ActivityPub ([noellabo](https://github.com/mastodon/mastodon/pull/14365)) - Fix boosted toots from blocked account not being retroactively removed from TL ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/14339)) - Fix large shortened numbers (like 1.2K) using incorrect pluralization ([Sasha-Sorokin](https://github.com/mastodon/mastodon/pull/14061)) @@ -706,7 +706,7 @@ All notable changes to this project will be documented in this file. - Fix poll refresh button not being debounced in web UI ([rasjonell](https://github.com/mastodon/mastodon/pull/13485), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/13490)) - Fix confusing error when failing to add an alias to an unknown account ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13480)) - Fix "Email changed" notification sometimes having wrong e-mail ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13475)) -- Fix varioues issues on the account aliases page ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13452)) +- Fix various issues on the account aliases page ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13452)) - Fix API footer link in web UI ([bubblineyuri](https://github.com/mastodon/mastodon/pull/13441)) - Fix pagination of following, followers, follow requests, blocks and mutes lists in web UI ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13445)) - Fix styling of polls in JS-less fallback on public pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/13436)) @@ -1496,7 +1496,7 @@ All notable changes to this project will be documented in this file. - Change Docker image to use Ubuntu with jemalloc ([Sir-Boops](https://github.com/mastodon/mastodon/pull/10100), [BenLubar](https://github.com/mastodon/mastodon/pull/10212)) - Change public pages to be cacheable by proxies ([BenLubar](https://github.com/mastodon/mastodon/pull/9059)) - Change the 410 gone response for suspended accounts to be cacheable by proxies ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10339)) -- Change web UI to not not empty timeline of blocked users on block ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10359)) +- Change web UI to not empty timeline of blocked users on block ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/10359)) - Change JSON serializer to remove unused `@context` values ([Gargron](https://github.com/mastodon/mastodon/pull/10378)) - Change GIFV file size limit to be the same as for other videos ([rinsuki](https://github.com/mastodon/mastodon/pull/9924)) - Change Webpack to not use @babel/preset-env to compile node_modules ([ykzts](https://github.com/mastodon/mastodon/pull/10289)) @@ -1673,7 +1673,7 @@ All notable changes to this project will be documented in this file. - Limit maximum visibility of local silenced users to unlisted ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9583)) - Change API error message for unconfirmed accounts ([noellabo](https://github.com/mastodon/mastodon/pull/9625)) - Change the icon to "reply-all" when it's a reply to other accounts ([mayaeh](https://github.com/mastodon/mastodon/pull/9378)) -- Do not ignore federated reports targetting already-reported accounts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9534)) +- Do not ignore federated reports targeting already-reported accounts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/9534)) - Upgrade default Ruby version to 2.6.0 ([Gargron](https://github.com/mastodon/mastodon/pull/9688)) - Change e-mail digest frequency ([Gargron](https://github.com/mastodon/mastodon/pull/9689)) - Change Docker images for Tor support in docker-compose.yml ([Sir-Boops](https://github.com/mastodon/mastodon/pull/9438)) diff --git a/app/javascript/mastodon/components/scrollable_list.js b/app/javascript/mastodon/components/scrollable_list.js index 68a178512271c3112e7849b1aac22a152f3abfb2..91d04bf4d8e933957929de7d5d88d4da77e4c67e 100644 --- a/app/javascript/mastodon/components/scrollable_list.js +++ b/app/javascript/mastodon/components/scrollable_list.js @@ -151,7 +151,7 @@ class ScrollableList extends PureComponent { attachFullscreenListener(this.onFullScreenChange); - // Handle initial scroll posiiton + // Handle initial scroll position this.handleScroll(); } diff --git a/app/javascript/mastodon/containers/media_container.js b/app/javascript/mastodon/containers/media_container.js index 2f42a084fd0619495da9f17bc8d6a0618826a617..6ee1f0bd8850daa1c05d7bda425927c3c57327d5 100644 --- a/app/javascript/mastodon/containers/media_container.js +++ b/app/javascript/mastodon/containers/media_container.js @@ -43,7 +43,7 @@ export default class MediaContainer extends PureComponent { handleOpenVideo = (options) => { const { components } = this.props; - const { media } = JSON.parse(components[options.componetIndex].getAttribute('data-props')); + const { media } = JSON.parse(components[options.componentIndex].getAttribute('data-props')); const mediaList = fromJS(media); document.body.classList.add('with-modals--active'); @@ -87,7 +87,7 @@ export default class MediaContainer extends PureComponent { ...(hashtag ? { hashtag: fromJS(hashtag) } : {}), ...(componentName === 'Video' ? { - componetIndex: i, + componentIndex: i, onOpenVideo: this.handleOpenVideo, } : { onOpenMedia: this.handleOpenMedia, diff --git a/app/javascript/mastodon/features/report/category.js b/app/javascript/mastodon/features/report/category.js index 122b51c7cdd0b06ef2d5e5fda0b6f5a0c6aa8042..a36dc81b123aacaf37e84e26039f7547eaee6e34 100644 --- a/app/javascript/mastodon/features/report/category.js +++ b/app/javascript/mastodon/features/report/category.js @@ -8,7 +8,7 @@ const messages = defineMessages({ dislike: { id: 'report.reasons.dislike', defaultMessage: 'I don\'t like it' }, dislike_description: { id: 'report.reasons.dislike_description', defaultMessage: 'It is not something you want to see' }, spam: { id: 'report.reasons.spam', defaultMessage: 'It\'s spam' }, - spam_description: { id: 'report.reasons.spam_description', defaultMessage: 'Malicious links, fake engagement, or repetetive replies' }, + spam_description: { id: 'report.reasons.spam_description', defaultMessage: 'Malicious links, fake engagement, or repetitive replies' }, violation: { id: 'report.reasons.violation', defaultMessage: 'It violates server rules' }, violation_description: { id: 'report.reasons.violation_description', defaultMessage: 'You are aware that it breaks specific rules' }, other: { id: 'report.reasons.other', defaultMessage: 'It\'s something else' }, diff --git a/app/javascript/mastodon/features/video/index.js b/app/javascript/mastodon/features/video/index.js index 70e3cd6e88e78a814045543741f2fe0f67df4a2f..8d47e479a84b557dd407006b7da2a9de4ced6217 100644 --- a/app/javascript/mastodon/features/video/index.js +++ b/app/javascript/mastodon/features/video/index.js @@ -121,7 +121,7 @@ class Video extends React.PureComponent { autoPlay: PropTypes.bool, volume: PropTypes.number, muted: PropTypes.bool, - componetIndex: PropTypes.number, + componentIndex: PropTypes.number, }; static defaultProps = { @@ -502,7 +502,7 @@ class Video extends React.PureComponent { startTime: this.video.currentTime, autoPlay: !this.state.paused, defaultVolume: this.state.volume, - componetIndex: this.props.componetIndex, + componentIndex: this.props.componentIndex, }); } diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index e87541e2846671aa48bbb910621618e801d84d81..c3d23795ba7ad39490dd5eea55c28aaa0ad1e341 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -409,7 +409,7 @@ "report.reasons.other": "It's something else", "report.reasons.other_description": "The issue does not fit into other categories", "report.reasons.spam": "It's spam", - "report.reasons.spam_description": "Malicious links, fake engagement, or repetetive replies", + "report.reasons.spam_description": "Malicious links, fake engagement, or repetitive replies", "report.reasons.violation": "It violates server rules", "report.reasons.violation_description": "You are aware that it breaks specific rules", "report.rules.subtitle": "Select all that apply", diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 6b18ca6f211d2551c4c4bdde25c42a5712b299fb..b8c3dba6156fe775e270ab02d74c91ca145418f7 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -4315,7 +4315,7 @@ a.status-card.compact:hover { } } -.upload-progess__message { +.upload-progress__message { flex: 1 1 auto; } diff --git a/app/javascript/styles/mastodon/polls.scss b/app/javascript/styles/mastodon/polls.scss index e33fc798359e98a085d9304677f6491051e84583..a719044ea216df5e88f6647e23d68e386101a59c 100644 --- a/app/javascript/styles/mastodon/polls.scss +++ b/app/javascript/styles/mastodon/polls.scss @@ -69,7 +69,7 @@ display: none; } - .autossugest-input { + .autosuggest-input { flex: 1 1 auto; } diff --git a/app/policies/user_policy.rb b/app/policies/user_policy.rb index 6695a0ddf89f17af832ff05dfc492f9201af3b16..92e2c4f4bba7dc7a4ba259bc6e5c185f14f84b2e 100644 --- a/app/policies/user_policy.rb +++ b/app/policies/user_policy.rb @@ -42,7 +42,7 @@ class UserPolicy < ApplicationPolicy end def promote? - admin? && promoteable? + admin? && promotable? end def demote? @@ -51,7 +51,7 @@ class UserPolicy < ApplicationPolicy private - def promoteable? + def promotable? record.approved? && (!record.staff? || !record.admin?) end diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index 19d59f1551cde9e8a5e9008aa3d4c6b37e172264..1a041ad481b0bc0e98813a361f9cf261b05b9254 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -1,5 +1,5 @@ Rails.application.config.middleware.use OmniAuth::Builder do - # Vanilla omniauth stategies + # Vanilla omniauth strategies end Devise.setup do |config| diff --git a/config/locales/en_GB.yml b/config/locales/en_GB.yml index d3461474b16c0423076003cca88fa3419c04efa8..de74e0f61117bdcd20174ef63d5259c34a7542cf 100644 --- a/config/locales/en_GB.yml +++ b/config/locales/en_GB.yml @@ -986,7 +986,7 @@ en_GB: enabled: Two-factor authentication is enabled enabled_success: Two-factor authentication successfully enabled generate_recovery_codes: Generate recovery codes - instructions_html: "<strong>Scan this QR code into Google Authenticator or a similiar TOTP app on your phone</strong>. From now on, that app will generate tokens that you will have to enter when logging in." + instructions_html: "<strong>Scan this QR code into Google Authenticator or a similar TOTP app on your phone</strong>. From now on, that app will generate tokens that you will have to enter when logging in." lost_recovery_codes: Recovery codes allow you to regain access to your account if you lose your phone. If you've lost your recovery codes, you can regenerate them here. Your old recovery codes will be invalidated. manual_instructions: 'If you can''t scan the QR code and need to enter it manually, here is the plain-text secret:' recovery_codes: Backup recovery codes diff --git a/db/migrate/20170920032311_fix_reblogs_in_feeds.rb b/db/migrate/20170920032311_fix_reblogs_in_feeds.rb index bcd4b913765c5f8dfea97dae33fe60e4493d951b..4ab68e8f3299b5fb2a763614c159ed02c27e50d3 100644 --- a/db/migrate/20170920032311_fix_reblogs_in_feeds.rb +++ b/db/migrate/20170920032311_fix_reblogs_in_feeds.rb @@ -16,7 +16,7 @@ class FixReblogsInFeeds < ActiveRecord::Migration[5.1] # is once again set to the reblogging status' ID, and the value # is set to the reblogged status' ID). This is safe for Redis' # float conversion because in this reblog tracking zset, we only - # need the rebloggging status' ID to be able to stop tracking + # need the reblogging status' ID to be able to stop tracking # entries after they have gotten too far down the feed, which # does not require an exact value. diff --git a/db/migrate/20180608213548_reject_following_blocked_users.rb b/db/migrate/20180608213548_reject_following_blocked_users.rb index 302db6b68d0d92269fb2a62cd1ce39a10dc8e226..78f8df53837232543c5181a98170e4a095c63478 100644 --- a/db/migrate/20180608213548_reject_following_blocked_users.rb +++ b/db/migrate/20180608213548_reject_following_blocked_users.rb @@ -22,13 +22,13 @@ class RejectFollowingBlockedUsers < ActiveRecord::Migration[5.2] follows.each do |follow| blocked_account = follow.account - followed_acccount = follow.target_account + followed_account = follow.target_account next follow.destroy! if blocked_account.local? - reject_follow_json = Oj.dump(ActivityPub::LinkedDataSignature.new(ActiveModelSerializers::SerializableResource.new(follow, serializer: ActivityPub::RejectFollowSerializer, adapter: ActivityPub::Adapter).as_json).sign!(followed_acccount)) + reject_follow_json = Oj.dump(ActivityPub::LinkedDataSignature.new(ActiveModelSerializers::SerializableResource.new(follow, serializer: ActivityPub::RejectFollowSerializer, adapter: ActivityPub::Adapter).as_json).sign!(followed_account)) - ActivityPub::DeliveryWorker.perform_async(reject_follow_json, followed_acccount, blocked_account.inbox_url) + ActivityPub::DeliveryWorker.perform_async(reject_follow_json, followed_account, blocked_account.inbox_url) follow.destroy! end diff --git a/lib/mastodon/maintenance_cli.rb b/lib/mastodon/maintenance_cli.rb index 00861df7743475cab181b8802153d4211e959f2d..1e047d96c61b5a9c916765eac139758e04c2799e 100644 --- a/lib/mastodon/maintenance_cli.rb +++ b/lib/mastodon/maintenance_cli.rb @@ -510,7 +510,7 @@ module Mastodon accounts = accounts.sort_by(&:id).reverse @prompt.warn "Multiple local accounts were found for username '#{accounts.first.username}'." - @prompt.warn 'All those accounts are distinct accounts but only the most recently-created one is fully-functionnal.' + @prompt.warn 'All those accounts are distinct accounts but only the most recently-created one is fully-functional.' accounts.each_with_index do |account, idx| @prompt.say '%2d. %s: created at: %s; updated at: %s; last logged in at: %s; statuses: %5d; last status at: %s' % [idx, account.username, account.created_at, account.updated_at, account.user&.last_sign_in_at&.to_s || 'N/A', account.account_stat&.statuses_count || 0, account.account_stat&.last_status_at || 'N/A'] diff --git a/lib/mastodon/statuses_cli.rb b/lib/mastodon/statuses_cli.rb index 91b08813b38bf59b10a6da237a341268411f38a6..d4c2e6cf2a7e477162c57f5bbcea467f53a238ea 100644 --- a/lib/mastodon/statuses_cli.rb +++ b/lib/mastodon/statuses_cli.rb @@ -156,7 +156,7 @@ module Mastodon ActiveRecord::Base.connection.add_index(:statuses, :conversation_id, name: :index_statuses_conversation_id, algorithm: :concurrently, if_not_exists: true) - say('Extract the deletion target from coversations... This might take a while...') + say('Extract the deletion target from conversations... This might take a while...') ActiveRecord::Base.connection.create_table('conversations_to_be_deleted', force: true) diff --git a/spec/controllers/accounts_controller_spec.rb b/spec/controllers/accounts_controller_spec.rb index 73d12402919dc2a052faec9e9b9265c4a87bbb80..662a89927d48ed4bc9d9b45fb6c293e7bb8c3273 100644 --- a/spec/controllers/accounts_controller_spec.rb +++ b/spec/controllers/accounts_controller_spec.rb @@ -5,7 +5,7 @@ RSpec.describe AccountsController, type: :controller do let(:account) { Fabricate(:account) } - shared_examples 'cachable response' do + shared_examples 'cacheable response' do it 'does not set cookies' do expect(response.cookies).to be_empty expect(response.headers['Set-Cookies']).to be nil @@ -374,7 +374,7 @@ RSpec.describe AccountsController, type: :controller do expect(response.media_type).to eq 'application/activity+json' end - it_behaves_like 'cachable response' + it_behaves_like 'cacheable response' it 'renders account' do json = body_as_json @@ -432,7 +432,7 @@ RSpec.describe AccountsController, type: :controller do expect(response.media_type).to eq 'application/activity+json' end - it_behaves_like 'cachable response' + it_behaves_like 'cacheable response' it 'renders account' do json = body_as_json @@ -499,7 +499,7 @@ RSpec.describe AccountsController, type: :controller do expect(response).to have_http_status(200) end - it_behaves_like 'cachable response' + it_behaves_like 'cacheable response' end context do diff --git a/spec/controllers/activitypub/collections_controller_spec.rb b/spec/controllers/activitypub/collections_controller_spec.rb index 21a0339458b2f20d73b97b29562a141b1a9d6acf..4d87f80ced57877f87c2ae93ce596e20fa418dc1 100644 --- a/spec/controllers/activitypub/collections_controller_spec.rb +++ b/spec/controllers/activitypub/collections_controller_spec.rb @@ -7,7 +7,7 @@ RSpec.describe ActivityPub::CollectionsController, type: :controller do let!(:private_pinned) { Fabricate(:status, account: account, text: 'secret private stuff', visibility: :private) } let(:remote_account) { nil } - shared_examples 'cachable response' do + shared_examples 'cacheable response' do it 'does not set cookies' do expect(response.cookies).to be_empty expect(response.headers['Set-Cookies']).to be nil @@ -48,7 +48,7 @@ RSpec.describe ActivityPub::CollectionsController, type: :controller do expect(response.media_type).to eq 'application/activity+json' end - it_behaves_like 'cachable response' + it_behaves_like 'cacheable response' it 'returns orderedItems with pinned statuses' do expect(body[:orderedItems]).to be_an Array @@ -101,7 +101,7 @@ RSpec.describe ActivityPub::CollectionsController, type: :controller do expect(response.media_type).to eq 'application/activity+json' end - it_behaves_like 'cachable response' + it_behaves_like 'cacheable response' it 'returns orderedItems with pinned statuses' do json = body_as_json diff --git a/spec/controllers/activitypub/outboxes_controller_spec.rb b/spec/controllers/activitypub/outboxes_controller_spec.rb index 1722690db1bff1fc8365ebd354e21369ce419341..04f03644729633642fed35b391b3ce7104c4392d 100644 --- a/spec/controllers/activitypub/outboxes_controller_spec.rb +++ b/spec/controllers/activitypub/outboxes_controller_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' RSpec.describe ActivityPub::OutboxesController, type: :controller do let!(:account) { Fabricate(:account) } - shared_examples 'cachable response' do + shared_examples 'cacheable response' do it 'does not set cookies' do expect(response.cookies).to be_empty expect(response.headers['Set-Cookies']).to be nil @@ -53,7 +53,7 @@ RSpec.describe ActivityPub::OutboxesController, type: :controller do expect(body[:totalItems]).to eq 4 end - it_behaves_like 'cachable response' + it_behaves_like 'cacheable response' it 'does not have a Vary header' do expect(response.headers['Vary']).to be_nil @@ -98,7 +98,7 @@ RSpec.describe ActivityPub::OutboxesController, type: :controller do expect(body[:orderedItems].all? { |item| item[:to].include?(ActivityPub::TagManager::COLLECTIONS[:public]) || item[:cc].include?(ActivityPub::TagManager::COLLECTIONS[:public]) }).to be true end - it_behaves_like 'cachable response' + it_behaves_like 'cacheable response' it 'returns Vary header with Signature' do expect(response.headers['Vary']).to include 'Signature' diff --git a/spec/controllers/activitypub/replies_controller_spec.rb b/spec/controllers/activitypub/replies_controller_spec.rb index a2c7f336ff5ec2de3ca46d1761b137ff5d957222..a35957f24c2fc8d4a8b019f5f93453a6c4f3548d 100644 --- a/spec/controllers/activitypub/replies_controller_spec.rb +++ b/spec/controllers/activitypub/replies_controller_spec.rb @@ -8,7 +8,7 @@ RSpec.describe ActivityPub::RepliesController, type: :controller do let(:remote_reply_id) { 'https://foobar.com/statuses/1234' } let(:remote_querier) { nil } - shared_examples 'cachable response' do + shared_examples 'cacheable response' do it 'does not set cookies' do expect(response.cookies).to be_empty expect(response.headers['Set-Cookies']).to be nil @@ -93,7 +93,7 @@ RSpec.describe ActivityPub::RepliesController, type: :controller do expect(response.media_type).to eq 'application/activity+json' end - it_behaves_like 'cachable response' + it_behaves_like 'cacheable response' context 'without only_other_accounts' do it "returns items with thread author's replies" do diff --git a/spec/controllers/api/v1/accounts/notes_controller_spec.rb b/spec/controllers/api/v1/accounts/notes_controller_spec.rb index 47d595c705f8679e7f55fa7d7b4133d0719e0719..42c2d8a86f09e190d0bb8535136a196c18265341 100644 --- a/spec/controllers/api/v1/accounts/notes_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/notes_controller_spec.rb @@ -31,7 +31,7 @@ describe Api::V1::Accounts::NotesController do end end - context 'when account note exceends allowed length' do + context 'when account note exceeds allowed length' do let(:comment) { 'a' * 2_001 } it 'returns 422' do diff --git a/spec/controllers/api/v1/admin/accounts_controller_spec.rb b/spec/controllers/api/v1/admin/accounts_controller_spec.rb index bf79ee520277f237aee6d8b6128a8ef62b1c3a6b..3f61bbc0ba33bffb37ba3439a1f7203363be72bd 100644 --- a/spec/controllers/api/v1/admin/accounts_controller_spec.rb +++ b/spec/controllers/api/v1/admin/accounts_controller_spec.rb @@ -140,7 +140,7 @@ RSpec.describe Api::V1::Admin::AccountsController, type: :controller do expect(response).to have_http_status(200) end - it 'unsensitives account' do + it 'unsensitizes account' do expect(account.reload.sensitized?).to be false end end diff --git a/spec/controllers/api/v1/statuses/favourited_by_accounts_controller_spec.rb b/spec/controllers/api/v1/statuses/favourited_by_accounts_controller_spec.rb index 439a4738df56b6ea2a518ae50b8a6d11d14d62ee..7cc77f43080141aa85353accc37a75d3e7dad1ee 100644 --- a/spec/controllers/api/v1/statuses/favourited_by_accounts_controller_spec.rb +++ b/spec/controllers/api/v1/statuses/favourited_by_accounts_controller_spec.rb @@ -56,7 +56,7 @@ RSpec.describe Api::V1::Statuses::FavouritedByAccountsController, type: :control Fabricate(:favourite, status: status) end - it 'returns http unautharized' do + it 'returns http unauthorized' do get :index, params: { status_id: status.id } expect(response).to have_http_status(404) end diff --git a/spec/controllers/api/v1/statuses/reblogged_by_accounts_controller_spec.rb b/spec/controllers/api/v1/statuses/reblogged_by_accounts_controller_spec.rb index 31320349df07eb8aa37de3b5d5f46f3a3f4312c0..8d4a6f91ca9c8011f69fcdb611c36b8ea85888c9 100644 --- a/spec/controllers/api/v1/statuses/reblogged_by_accounts_controller_spec.rb +++ b/spec/controllers/api/v1/statuses/reblogged_by_accounts_controller_spec.rb @@ -56,7 +56,7 @@ RSpec.describe Api::V1::Statuses::RebloggedByAccountsController, type: :controll Fabricate(:status, reblog_of_id: status.id) end - it 'returns http unautharized' do + it 'returns http unauthorized' do get :index, params: { status_id: status.id } expect(response).to have_http_status(404) end diff --git a/spec/controllers/api/v1/statuses_controller_spec.rb b/spec/controllers/api/v1/statuses_controller_spec.rb index 190dfad117d14b5328dd0b445c44b8406ab636bc..2eb30af74be3bb2c4e4e514cbd1956f95ed32367 100644 --- a/spec/controllers/api/v1/statuses_controller_spec.rb +++ b/spec/controllers/api/v1/statuses_controller_spec.rb @@ -130,7 +130,7 @@ RSpec.describe Api::V1::StatusesController, type: :controller do let(:status) { Fabricate(:status, account: user.account, visibility: :private) } describe 'GET #show' do - it 'returns http unautharized' do + it 'returns http unauthorized' do get :show, params: { id: status.id } expect(response).to have_http_status(404) end @@ -141,7 +141,7 @@ RSpec.describe Api::V1::StatusesController, type: :controller do Fabricate(:status, account: user.account, thread: status) end - it 'returns http unautharized' do + it 'returns http unauthorized' do get :context, params: { id: status.id } expect(response).to have_http_status(404) end diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 0fb4ddbcf5c211182e3980fb759c4753d2d97ce4..53e163d493c2b7fd348dcf01f90f721f3ff4c266 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -187,30 +187,30 @@ describe ApplicationController, type: :controller do controller do before_action :require_admin! - def sucesss + def success head 200 end end before do - routes.draw { get 'sucesss' => 'anonymous#sucesss' } + routes.draw { get 'success' => 'anonymous#success' } end it 'returns a 403 if current user is not admin' do sign_in(Fabricate(:user, admin: false)) - get 'sucesss' + get 'success' expect(response).to have_http_status(403) end it 'returns a 403 if current user is only a moderator' do sign_in(Fabricate(:user, moderator: true)) - get 'sucesss' + get 'success' expect(response).to have_http_status(403) end it 'does nothing if current user is admin' do sign_in(Fabricate(:user, admin: true)) - get 'sucesss' + get 'success' expect(response).to have_http_status(200) end end @@ -219,30 +219,30 @@ describe ApplicationController, type: :controller do controller do before_action :require_staff! - def sucesss + def success head 200 end end before do - routes.draw { get 'sucesss' => 'anonymous#sucesss' } + routes.draw { get 'success' => 'anonymous#success' } end it 'returns a 403 if current user is not admin or moderator' do sign_in(Fabricate(:user, admin: false, moderator: false)) - get 'sucesss' + get 'success' expect(response).to have_http_status(403) end it 'does nothing if current user is moderator' do sign_in(Fabricate(:user, moderator: true)) - get 'sucesss' + get 'success' expect(response).to have_http_status(200) end it 'does nothing if current user is admin' do sign_in(Fabricate(:user, admin: true)) - get 'sucesss' + get 'success' expect(response).to have_http_status(200) end end diff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb index 9986efa51d27d9ca504fb1dc5acaeb919fc26039..05fae67fab1d971e4bffefd027b1aafd8e7d0bb5 100644 --- a/spec/controllers/statuses_controller_spec.rb +++ b/spec/controllers/statuses_controller_spec.rb @@ -5,7 +5,7 @@ require 'rails_helper' describe StatusesController do render_views - shared_examples 'cachable response' do + shared_examples 'cacheable response' do it 'does not set cookies' do expect(response.cookies).to be_empty expect(response.headers['Set-Cookies']).to be nil @@ -108,7 +108,7 @@ describe StatusesController do expect(response.headers['Vary']).to eq 'Accept' end - it_behaves_like 'cachable response' + it_behaves_like 'cacheable response' it 'returns Content-Type header' do expect(response.headers['Content-Type']).to include 'application/activity+json' @@ -496,7 +496,7 @@ describe StatusesController do expect(response.headers['Vary']).to eq 'Accept' end - it_behaves_like 'cachable response' + it_behaves_like 'cacheable response' it 'returns Content-Type header' do expect(response.headers['Content-Type']).to include 'application/activity+json' diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index f09e32ecc2bd1b69dbfd49da111440f171d52a16..b9d38d8c68937b30d77ef6c0aa15ade838887838 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -60,7 +60,7 @@ describe ApplicationHelper do end describe 'favicon_path' do - it 'returns /favicon.ico on production enviromnent' do + it 'returns /favicon.ico on production environment' do expect(Rails.env).to receive(:production?).and_return(true) expect(helper.favicon_path).to eq '/favicon.ico' end diff --git a/spec/lib/tag_manager_spec.rb b/spec/lib/tag_manager_spec.rb index 2230f971037a9c868065490cfde4de6628c94b75..cd9fb936cd4ebb3bc0e4fe055944079ced9bff72 100644 --- a/spec/lib/tag_manager_spec.rb +++ b/spec/lib/tag_manager_spec.rb @@ -6,7 +6,7 @@ RSpec.describe TagManager do around do |example| original_local_domain = Rails.configuration.x.local_domain - Rails.configuration.x.local_domain = 'domain.test' + Rails.configuration.x.local_domain = 'domain.example.com' example.run @@ -18,11 +18,11 @@ RSpec.describe TagManager do end it 'returns true if the slash-stripped string equals to local domain' do - expect(TagManager.instance.local_domain?('DoMaIn.Test/')).to eq true + expect(TagManager.instance.local_domain?('DoMaIn.Example.com/')).to eq true end it 'returns false for irrelevant string' do - expect(TagManager.instance.local_domain?('DoMaIn.Test!')).to eq false + expect(TagManager.instance.local_domain?('DoMaIn.Example.com!')).to eq false end end @@ -31,7 +31,7 @@ RSpec.describe TagManager do around do |example| original_web_domain = Rails.configuration.x.web_domain - Rails.configuration.x.web_domain = 'domain.test' + Rails.configuration.x.web_domain = 'domain.example.com' example.run @@ -43,11 +43,11 @@ RSpec.describe TagManager do end it 'returns true if the slash-stripped string equals to web domain' do - expect(TagManager.instance.web_domain?('DoMaIn.Test/')).to eq true + expect(TagManager.instance.web_domain?('DoMaIn.Example.com/')).to eq true end it 'returns false for string with irrelevant characters' do - expect(TagManager.instance.web_domain?('DoMaIn.Test!')).to eq false + expect(TagManager.instance.web_domain?('DoMaIn.Example.com!')).to eq false end end @@ -57,7 +57,7 @@ RSpec.describe TagManager do end it 'returns normalized domain' do - expect(TagManager.instance.normalize_domain('DoMaIn.Test/')).to eq 'domain.test' + expect(TagManager.instance.normalize_domain('DoMaIn.Example.com/')).to eq 'domain.example.com' end end @@ -69,18 +69,18 @@ RSpec.describe TagManager do end it 'returns true if the normalized string with port is local URL' do - Rails.configuration.x.web_domain = 'domain.test:42' - expect(TagManager.instance.local_url?('https://DoMaIn.Test:42/')).to eq true + Rails.configuration.x.web_domain = 'domain.example.com:42' + expect(TagManager.instance.local_url?('https://DoMaIn.Example.com:42/')).to eq true end it 'returns true if the normalized string without port is local URL' do - Rails.configuration.x.web_domain = 'domain.test' - expect(TagManager.instance.local_url?('https://DoMaIn.Test/')).to eq true + Rails.configuration.x.web_domain = 'domain.example.com' + expect(TagManager.instance.local_url?('https://DoMaIn.Example.com/')).to eq true end it 'returns false for string with irrelevant characters' do - Rails.configuration.x.web_domain = 'domain.test' - expect(TagManager.instance.local_url?('https://domainn.test/')).to eq false + Rails.configuration.x.web_domain = 'domain.example.com' + expect(TagManager.instance.local_url?('https://domain.example.net/')).to eq false end end end diff --git a/spec/models/report_spec.rb b/spec/models/report_spec.rb index 3d29c021954f007c69cc153fde14a4a9784b6c75..df32a7c9d5672f18ecdef73943983e192e732ab0 100644 --- a/spec/models/report_spec.rb +++ b/spec/models/report_spec.rb @@ -119,7 +119,7 @@ describe Report do end end - describe 'validatiions' do + describe 'validations' do it 'has a valid fabricator' do report = Fabricate(:report) report.valid? diff --git a/spec/policies/user_policy_spec.rb b/spec/policies/user_policy_spec.rb index 1933ee014fb3349002385e32cb7ceba939949bcb..731c041d11ef7f2ce924a03343735559df641acb 100644 --- a/spec/policies/user_policy_spec.rb +++ b/spec/policies/user_policy_spec.rb @@ -114,13 +114,13 @@ RSpec.describe UserPolicy do permissions :promote? do context 'admin?' do - context 'promoteable?' do + context 'promotable?' do it 'permits' do expect(subject).to permit(admin, john.user) end end - context '!promoteable?' do + context '!promotable?' do it 'denies' do expect(subject).to_not permit(admin, admin.user) end diff --git a/spec/services/unsuspend_account_service_spec.rb b/spec/services/unsuspend_account_service_spec.rb index d52cb6cc008e98c3da8306af2c57266977deef10..0593beb6f2748a8a19c486c762c0a5f8c923794b 100644 --- a/spec/services/unsuspend_account_service_spec.rb +++ b/spec/services/unsuspend_account_service_spec.rb @@ -63,20 +63,20 @@ RSpec.describe UnsuspendAccountService, type: :service do describe 'unsuspending a remote account' do include_examples 'common behavior' do let!(:account) { Fabricate(:account, domain: 'bob.com', uri: 'https://bob.com', inbox_url: 'https://bob.com/inbox', protocol: :activitypub) } - let!(:reslove_account_service) { double } + let!(:resolve_account_service) { double } before do - allow(ResolveAccountService).to receive(:new).and_return(reslove_account_service) + allow(ResolveAccountService).to receive(:new).and_return(resolve_account_service) end context 'when the account is not remotely suspended' do before do - allow(reslove_account_service).to receive(:call).with(account).and_return(account) + allow(resolve_account_service).to receive(:call).with(account).and_return(account) end it 're-fetches the account' do subject.call - expect(reslove_account_service).to have_received(:call).with(account) + expect(resolve_account_service).to have_received(:call).with(account) end it "merges back into local followers' feeds" do @@ -92,7 +92,7 @@ RSpec.describe UnsuspendAccountService, type: :service do context 'when the account is remotely suspended' do before do - allow(reslove_account_service).to receive(:call).with(account) do |account| + allow(resolve_account_service).to receive(:call).with(account) do |account| account.suspend!(origin: :remote) account end @@ -100,7 +100,7 @@ RSpec.describe UnsuspendAccountService, type: :service do it 're-fetches the account' do subject.call - expect(reslove_account_service).to have_received(:call).with(account) + expect(resolve_account_service).to have_received(:call).with(account) end it "does not merge back into local followers' feeds" do @@ -116,12 +116,12 @@ RSpec.describe UnsuspendAccountService, type: :service do context 'when the account is remotely deleted' do before do - allow(reslove_account_service).to receive(:call).with(account).and_return(nil) + allow(resolve_account_service).to receive(:call).with(account).and_return(nil) end it 're-fetches the account' do subject.call - expect(reslove_account_service).to have_received(:call).with(account) + expect(resolve_account_service).to have_received(:call).with(account) end it "does not merge back into local followers' feeds" do diff --git a/spec/support/stories/profile_stories.rb b/spec/support/stories/profile_stories.rb index 75b413330fc1da6339ec6c723b86e2d3f05c965f..0c4a14d1c965cc3f091dc4d9ca93270a38282290 100644 --- a/spec/support/stories/profile_stories.rb +++ b/spec/support/stories/profile_stories.rb @@ -22,7 +22,7 @@ module ProfileStories def with_alice_as_local_user @alice_bio = '@alice and @bob are fictional characters commonly used as'\ 'placeholder names in #cryptology, as well as #science and'\ - 'engineering 📖 literature. Not affilated with @pepe.' + 'engineering 📖 literature. Not affiliated with @pepe.' @alice = Fabricate( :user,