diff --git a/.rspec b/.rspec index 4d520043cf8..91185b89382 100644 --- a/.rspec +++ b/.rspec @@ -1,2 +1 @@ ---colour --require 'rails_helper' diff --git a/plugins/discourse-details/spec/components/pretty_text_spec.rb b/plugins/discourse-details/spec/components/pretty_text_spec.rb index 7c74a53c281..bbbcb6ba277 100644 --- a/plugins/discourse-details/spec/components/pretty_text_spec.rb +++ b/plugins/discourse-details/spec/components/pretty_text_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' require 'pretty_text' -describe PrettyText do +RSpec.describe PrettyText do let(:post) { Fabricate(:post) } diff --git a/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb b/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb index c365ffaf5e9..326c9dabb3e 100644 --- a/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb +++ b/plugins/discourse-local-dates/spec/lib/pretty_text_spec.rb @@ -14,7 +14,7 @@ def generate_html(text, opts = {}) output + "

" end -describe PrettyText do +RSpec.describe PrettyText do before do freeze_time end diff --git a/plugins/discourse-local-dates/spec/models/post_spec.rb b/plugins/discourse-local-dates/spec/models/post_spec.rb index 9cdaa724953..98d5e6e3d29 100644 --- a/plugins/discourse-local-dates/spec/models/post_spec.rb +++ b/plugins/discourse-local-dates/spec/models/post_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Post do +RSpec.describe Post do before do Jobs.run_immediately! diff --git a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/new_user_narrative_spec.rb b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/new_user_narrative_spec.rb index f2aea1e2e10..59fd663099c 100644 --- a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/new_user_narrative_spec.rb +++ b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/new_user_narrative_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe DiscourseNarrativeBot::NewUserNarrative do +RSpec.describe DiscourseNarrativeBot::NewUserNarrative do fab!(:welcome_topic) { Fabricate(:topic, title: 'Welcome to Discourse') } fab!(:narrative_bot) { ::DiscourseNarrativeBot::Base.new } fab!(:discobot_user) { narrative_bot.discobot_user } diff --git a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/store_spec.rb b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/store_spec.rb index 0f8af31f155..2f42a2ee3ca 100644 --- a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/store_spec.rb +++ b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/store_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe DiscourseNarrativeBot::Store do +RSpec.describe DiscourseNarrativeBot::Store do describe '.set' do it 'should set the right value in the plugin store' do key = 'somekey' diff --git a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/track_selector_spec.rb b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/track_selector_spec.rb index a82c3eb9b24..f1b68d154d0 100644 --- a/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/track_selector_spec.rb +++ b/plugins/discourse-narrative-bot/spec/discourse_narrative_bot/track_selector_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe DiscourseNarrativeBot::TrackSelector do +RSpec.describe DiscourseNarrativeBot::TrackSelector do let(:user) { Fabricate(:user) } let(:narrative_bot) { ::DiscourseNarrativeBot::Base.new } let(:discobot_user) { narrative_bot.discobot_user } diff --git a/plugins/discourse-narrative-bot/spec/jobs/onceoff/remap_old_bot_images_spec.rb b/plugins/discourse-narrative-bot/spec/jobs/onceoff/remap_old_bot_images_spec.rb index 5179edbeffd..6b0326b7f59 100644 --- a/plugins/discourse-narrative-bot/spec/jobs/onceoff/remap_old_bot_images_spec.rb +++ b/plugins/discourse-narrative-bot/spec/jobs/onceoff/remap_old_bot_images_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::DiscourseNarrativeBot::RemapOldBotImages do +RSpec.describe Jobs::DiscourseNarrativeBot::RemapOldBotImages do context "when bot's post contains an old link" do let!(:post) do Fabricate(:post, diff --git a/plugins/discourse-narrative-bot/spec/requests/discobot_certificate_spec.rb b/plugins/discourse-narrative-bot/spec/requests/discobot_certificate_spec.rb index 4fcc04666d1..803b4887a4b 100644 --- a/plugins/discourse-narrative-bot/spec/requests/discobot_certificate_spec.rb +++ b/plugins/discourse-narrative-bot/spec/requests/discobot_certificate_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe "Discobot Certificate" do +RSpec.describe "Discobot Certificate" do let(:user) { Fabricate(:user, name: 'Jeff Atwood') } let(:params) { diff --git a/plugins/discourse-narrative-bot/spec/requests/discobot_welcome_post_spec.rb b/plugins/discourse-narrative-bot/spec/requests/discobot_welcome_post_spec.rb index b9ed97d9442..6fa4be2b9d4 100644 --- a/plugins/discourse-narrative-bot/spec/requests/discobot_welcome_post_spec.rb +++ b/plugins/discourse-narrative-bot/spec/requests/discobot_welcome_post_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe "Discobot welcome post" do +RSpec.describe "Discobot welcome post" do let(:user) { Fabricate(:user) } before do diff --git a/plugins/discourse-narrative-bot/spec/user_spec.rb b/plugins/discourse-narrative-bot/spec/user_spec.rb index 4018ea4acf8..7b3d51b6f05 100644 --- a/plugins/discourse-narrative-bot/spec/user_spec.rb +++ b/plugins/discourse-narrative-bot/spec/user_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe User do +RSpec.describe User do let(:user) { Fabricate(:user) } let(:profile_page_url) { "#{Discourse.base_url}/users/#{user.username}" } diff --git a/plugins/discourse-presence/spec/integration/presence_spec.rb b/plugins/discourse-presence/spec/integration/presence_spec.rb index 6c6c480f655..b884a88adad 100644 --- a/plugins/discourse-presence/spec/integration/presence_spec.rb +++ b/plugins/discourse-presence/spec/integration/presence_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe "discourse-presence" do +RSpec.describe "discourse-presence" do describe 'PresenceChannel configuration' do fab!(:user) { Fabricate(:user) } fab!(:user2) { Fabricate(:user) } diff --git a/plugins/poll/spec/controllers/polls_controller_spec.rb b/plugins/poll/spec/controllers/polls_controller_spec.rb index 6eb55205155..a37fc7413f2 100644 --- a/plugins/poll/spec/controllers/polls_controller_spec.rb +++ b/plugins/poll/spec/controllers/polls_controller_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" -describe ::DiscoursePoll::PollsController do +RSpec.describe ::DiscoursePoll::PollsController do routes { ::DiscoursePoll::Engine.routes } let!(:user) { log_in } diff --git a/plugins/poll/spec/controllers/posts_controller_spec.rb b/plugins/poll/spec/controllers/posts_controller_spec.rb index 5cc316a9b42..dec4cf0190b 100644 --- a/plugins/poll/spec/controllers/posts_controller_spec.rb +++ b/plugins/poll/spec/controllers/posts_controller_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" -describe PostsController do +RSpec.describe PostsController do let!(:user) { log_in } let!(:title) { "Testing Poll Plugin" } diff --git a/plugins/poll/spec/integration/poll_endpoints_spec.rb b/plugins/poll/spec/integration/poll_endpoints_spec.rb index 68eb963c9e4..0fd37236466 100644 --- a/plugins/poll/spec/integration/poll_endpoints_spec.rb +++ b/plugins/poll/spec/integration/poll_endpoints_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" -describe "DiscoursePoll endpoints" do +RSpec.describe "DiscoursePoll endpoints" do describe "fetch voters for a poll" do fab!(:user) { Fabricate(:user) } fab!(:post) { Fabricate(:post, raw: "[poll public=true]\n- A\n- B\n[/poll]") } diff --git a/plugins/poll/spec/jobs/regular/close_poll_spec.rb b/plugins/poll/spec/jobs/regular/close_poll_spec.rb index 8bd8004c78b..891b35c9c14 100644 --- a/plugins/poll/spec/jobs/regular/close_poll_spec.rb +++ b/plugins/poll/spec/jobs/regular/close_poll_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" -describe Jobs::ClosePoll do +RSpec.describe Jobs::ClosePoll do let(:post) { Fabricate(:post, raw: "[poll]\n- A\n- B\n[/poll]") } describe 'missing arguments' do diff --git a/plugins/poll/spec/lib/new_post_manager_spec.rb b/plugins/poll/spec/lib/new_post_manager_spec.rb index 5f4c975cfc9..fb10d9cf2de 100644 --- a/plugins/poll/spec/lib/new_post_manager_spec.rb +++ b/plugins/poll/spec/lib/new_post_manager_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" -describe NewPostManager do +RSpec.describe NewPostManager do let(:user) { Fabricate(:newuser) } let(:admin) { Fabricate(:admin) } diff --git a/plugins/poll/spec/lib/poll_spec.rb b/plugins/poll/spec/lib/poll_spec.rb index 289cccf19dd..1b885947f7b 100644 --- a/plugins/poll/spec/lib/poll_spec.rb +++ b/plugins/poll/spec/lib/poll_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe DiscoursePoll::Poll do +RSpec.describe DiscoursePoll::Poll do fab!(:user) { Fabricate(:user) } fab!(:user_2) { Fabricate(:user) } diff --git a/plugins/poll/spec/lib/polls_updater_spec.rb b/plugins/poll/spec/lib/polls_updater_spec.rb index 371eb57a181..b6dde6817a6 100644 --- a/plugins/poll/spec/lib/polls_updater_spec.rb +++ b/plugins/poll/spec/lib/polls_updater_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe DiscoursePoll::PollsUpdater do +RSpec.describe DiscoursePoll::PollsUpdater do def update(post, polls) DiscoursePoll::PollsUpdater.update(post, polls) diff --git a/plugins/poll/spec/lib/polls_validator_spec.rb b/plugins/poll/spec/lib/polls_validator_spec.rb index 761fc359f17..2ad690c81c5 100644 --- a/plugins/poll/spec/lib/polls_validator_spec.rb +++ b/plugins/poll/spec/lib/polls_validator_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" -describe ::DiscoursePoll::PollsValidator do +RSpec.describe ::DiscoursePoll::PollsValidator do let(:post) { Fabricate(:post) } subject { described_class.new(post) } diff --git a/plugins/poll/spec/lib/pretty_text_spec.rb b/plugins/poll/spec/lib/pretty_text_spec.rb index e427db0dc70..6c4c48c188e 100644 --- a/plugins/poll/spec/lib/pretty_text_spec.rb +++ b/plugins/poll/spec/lib/pretty_text_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe PrettyText do +RSpec.describe PrettyText do def n(html) html.strip diff --git a/plugins/poll/spec/models/poll_spec.rb b/plugins/poll/spec/models/poll_spec.rb index 7ab5cab0d63..9b72a4a9ec9 100644 --- a/plugins/poll/spec/models/poll_spec.rb +++ b/plugins/poll/spec/models/poll_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe ::DiscoursePoll::Poll do +RSpec.describe ::DiscoursePoll::Poll do describe ".transform_for_user_field_override" do it "Transforms UserField name if a matching CustomUserField is present" do user_field_name = "Something Cool" diff --git a/plugins/poll/spec/requests/users_controller_spec.rb b/plugins/poll/spec/requests/users_controller_spec.rb index fa18d6f6d37..87b354ea488 100644 --- a/plugins/poll/spec/requests/users_controller_spec.rb +++ b/plugins/poll/spec/requests/users_controller_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" -describe Admin::UsersController do +RSpec.describe Admin::UsersController do let(:admin) { Fabricate(:admin) } diff --git a/plugins/poll/spec/serializers/poll_option_serializer_spec.rb b/plugins/poll/spec/serializers/poll_option_serializer_spec.rb index 90b53536f88..1a31df98381 100644 --- a/plugins/poll/spec/serializers/poll_option_serializer_spec.rb +++ b/plugins/poll/spec/serializers/poll_option_serializer_spec.rb @@ -8,7 +8,7 @@ def serialize_option(option, user) ) end -describe PollOptionSerializer do +RSpec.describe PollOptionSerializer do let(:voter) { Fabricate(:user) } let(:poll) { post.polls.first } diff --git a/plugins/styleguide/spec/integration/access_spec.rb b/plugins/styleguide/spec/integration/access_spec.rb index bd35e1ee1db..cf5081f299d 100644 --- a/plugins/styleguide/spec/integration/access_spec.rb +++ b/plugins/styleguide/spec/integration/access_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe 'SiteSetting.styleguide_admin_only' do +RSpec.describe 'SiteSetting.styleguide_admin_only' do before do SiteSetting.styleguide_enabled = true end @@ -34,7 +34,7 @@ describe 'SiteSetting.styleguide_admin_only' do end end -describe 'SiteSetting.styleguide_enabled' do +RSpec.describe 'SiteSetting.styleguide_enabled' do before do sign_in(Fabricate(:admin)) end diff --git a/plugins/styleguide/spec/integration/assets_spec.rb b/plugins/styleguide/spec/integration/assets_spec.rb index eb056a0fbb1..ad555711a60 100644 --- a/plugins/styleguide/spec/integration/assets_spec.rb +++ b/plugins/styleguide/spec/integration/assets_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe 'Styleguide assets' do +RSpec.describe 'Styleguide assets' do before do SiteSetting.styleguide_enabled = true sign_in(Fabricate(:admin)) diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 84138e8ec1b..a972e62cdcd 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -1,7 +1,7 @@ # coding: utf-8 # frozen_string_literal: true -describe ApplicationHelper do +RSpec.describe ApplicationHelper do describe "preload_script" do def preload_link(url) diff --git a/spec/helpers/topics_helper_spec.rb b/spec/helpers/topics_helper_spec.rb index 2d1780bda1a..5f0462fd97c 100644 --- a/spec/helpers/topics_helper_spec.rb +++ b/spec/helpers/topics_helper_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe TopicsHelper do +RSpec.describe TopicsHelper do describe "#categories_breadcrumb" do let(:user) { Fabricate(:user) } diff --git a/spec/helpers/user_notifications_helper_spec.rb b/spec/helpers/user_notifications_helper_spec.rb index 4f356d813bc..175c7bbb641 100644 --- a/spec/helpers/user_notifications_helper_spec.rb +++ b/spec/helpers/user_notifications_helper_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe UserNotificationsHelper do +RSpec.describe UserNotificationsHelper do let(:upload_path) { Discourse.store.upload_path } describe '#email_excerpt' do diff --git a/spec/import_export/category_exporter_spec.rb b/spec/import_export/category_exporter_spec.rb index 6f943d69376..5fda50252b9 100644 --- a/spec/import_export/category_exporter_spec.rb +++ b/spec/import_export/category_exporter_spec.rb @@ -2,7 +2,7 @@ require "import_export" -describe ImportExport::CategoryExporter do +RSpec.describe ImportExport::CategoryExporter do fab!(:category) { Fabricate(:category) } fab!(:group) { Fabricate(:group) } diff --git a/spec/import_export/category_structure_exporter_spec.rb b/spec/import_export/category_structure_exporter_spec.rb index cd06e2dc2b7..b5ee22fbdee 100644 --- a/spec/import_export/category_structure_exporter_spec.rb +++ b/spec/import_export/category_structure_exporter_spec.rb @@ -2,7 +2,7 @@ require "import_export/category_structure_exporter" -describe ImportExport::CategoryStructureExporter do +RSpec.describe ImportExport::CategoryStructureExporter do before do STDOUT.stubs(:write) diff --git a/spec/import_export/group_exporter_spec.rb b/spec/import_export/group_exporter_spec.rb index e70e549db79..8fd5c0f908a 100644 --- a/spec/import_export/group_exporter_spec.rb +++ b/spec/import_export/group_exporter_spec.rb @@ -2,7 +2,7 @@ require "import_export/group_exporter" -describe ImportExport::GroupExporter do +RSpec.describe ImportExport::GroupExporter do before do STDOUT.stubs(:write) diff --git a/spec/import_export/importer_spec.rb b/spec/import_export/importer_spec.rb index 217c68da570..ad75f2ade70 100644 --- a/spec/import_export/importer_spec.rb +++ b/spec/import_export/importer_spec.rb @@ -2,7 +2,7 @@ require "import_export" -describe ImportExport::Importer do +RSpec.describe ImportExport::Importer do before do STDOUT.stubs(:write) diff --git a/spec/import_export/topic_exporter_spec.rb b/spec/import_export/topic_exporter_spec.rb index bf10d59d7f6..809189158c3 100644 --- a/spec/import_export/topic_exporter_spec.rb +++ b/spec/import_export/topic_exporter_spec.rb @@ -2,7 +2,7 @@ require "import_export" -describe ImportExport::TopicExporter do +RSpec.describe ImportExport::TopicExporter do before do STDOUT.stubs(:write) diff --git a/spec/initializers/track_setting_changes_spec.rb b/spec/initializers/track_setting_changes_spec.rb index 14704cc1477..bab78a1d334 100644 --- a/spec/initializers/track_setting_changes_spec.rb +++ b/spec/initializers/track_setting_changes_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe 'Setting changes' do +RSpec.describe 'Setting changes' do describe '#must_approve_users' do before { SiteSetting.must_approve_users = false } diff --git a/spec/integration/api_keys_spec.rb b/spec/integration/api_keys_spec.rb index 4998f847eba..be9e790a681 100644 --- a/spec/integration/api_keys_spec.rb +++ b/spec/integration/api_keys_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe 'api keys' do +RSpec.describe 'api keys' do let(:user) { Fabricate(:user) } let(:api_key) { ApiKey.create!(user_id: user.id, created_by_id: Discourse.system_user) } @@ -61,7 +61,7 @@ describe 'api keys' do end end -describe 'user api keys' do +RSpec.describe 'user api keys' do let(:user) { Fabricate(:user) } let(:user_api_key) { Fabricate(:readonly_user_api_key, user: user) } diff --git a/spec/integration/auto_reject_reviewable_users_spec.rb b/spec/integration/auto_reject_reviewable_users_spec.rb index 25029eb987a..f51d41705c7 100644 --- a/spec/integration/auto_reject_reviewable_users_spec.rb +++ b/spec/integration/auto_reject_reviewable_users_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe "auto reject reviewable users" do +RSpec.describe "auto reject reviewable users" do context "reviewable users" do fab!(:old_user) { Fabricate(:reviewable, created_at: 80.days.ago) } diff --git a/spec/integration/blocked_hotlinked_media_spec.rb b/spec/integration/blocked_hotlinked_media_spec.rb index 5ea328c4f5c..c727210c48d 100644 --- a/spec/integration/blocked_hotlinked_media_spec.rb +++ b/spec/integration/blocked_hotlinked_media_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe "hotlinked media blocking" do +RSpec.describe "hotlinked media blocking" do let(:hotlinked_url) { "http://example.com/images/2/2e/Longcat1.png" } let(:onebox_url) { "http://example.com/onebox" } let(:png) { Base64.decode64("R0lGODlhAQABALMAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwICAgP8AAAD/AP//AAAA//8A/wD//wBiZCH5BAEAAA8ALAAAAAABAAEAAAQC8EUAOw==") } diff --git a/spec/integration/category_tag_spec.rb b/spec/integration/category_tag_spec.rb index 6e3399846e6..4650f02cd3a 100644 --- a/spec/integration/category_tag_spec.rb +++ b/spec/integration/category_tag_spec.rb @@ -1,7 +1,7 @@ # encoding: UTF-8 # frozen_string_literal: true -describe "category tag restrictions" do +RSpec.describe "category tag restrictions" do def filter_allowed_tags(opts = {}) DiscourseTagging.filter_allowed_tags(Guardian.new(user), opts) @@ -427,7 +427,7 @@ describe "category tag restrictions" do end end -describe "tag topic counts per category" do +RSpec.describe "tag topic counts per category" do fab!(:admin) { Fabricate(:admin) } fab!(:category) { Fabricate(:category) } fab!(:category2) { Fabricate(:category) } diff --git a/spec/integration/content_security_policy_spec.rb b/spec/integration/content_security_policy_spec.rb index 0b6dcea3462..69a56acc65b 100644 --- a/spec/integration/content_security_policy_spec.rb +++ b/spec/integration/content_security_policy_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe 'content security policy integration' do +RSpec.describe 'content security policy integration' do it "adds the csp headers correctly" do SiteSetting.content_security_policy = false diff --git a/spec/integration/email_outbound_spec.rb b/spec/integration/email_outbound_spec.rb index 25d441d5170..eaeebbe3ea9 100644 --- a/spec/integration/email_outbound_spec.rb +++ b/spec/integration/email_outbound_spec.rb @@ -4,7 +4,7 @@ # with mailer specific mailer specs like UserEmail, but sometimes we need # to test things along the whole outbound flow including the MessageBuilder # and the Sender. -describe "Outbound Email" do +RSpec.describe "Outbound Email" do def send_email(opts = {}) message = TestMailer.send_test("test@test.com", opts) result = Email::Sender.new(message, :test_message).send diff --git a/spec/integration/email_style_spec.rb b/spec/integration/email_style_spec.rb index d00ab661cfe..b23cbe35e56 100644 --- a/spec/integration/email_style_spec.rb +++ b/spec/integration/email_style_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe EmailStyle do +RSpec.describe EmailStyle do context "ERB evaluation" do it "does not evaluate ERB outside of the email itself" do diff --git a/spec/integration/flags_spec.rb b/spec/integration/flags_spec.rb index bdc0ed8c9a9..74591747577 100644 --- a/spec/integration/flags_spec.rb +++ b/spec/integration/flags_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe PostAction do +RSpec.describe PostAction do it "triggers the 'flag_reviewed' event when there was at least one flag" do admin = Fabricate(:admin) diff --git a/spec/integration/group_spec.rb b/spec/integration/group_spec.rb index b32abb9fcff..0573053b68c 100644 --- a/spec/integration/group_spec.rb +++ b/spec/integration/group_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Group do +RSpec.describe Group do let(:group) do Fabricate( :group, diff --git a/spec/integration/invalid_request_spec.rb b/spec/integration/invalid_request_spec.rb index 4f1bde6d9a3..e3e4e0bad77 100644 --- a/spec/integration/invalid_request_spec.rb +++ b/spec/integration/invalid_request_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe 'invalid requests', type: :request do +RSpec.describe 'invalid requests', type: :request do before do @orig_logger = Rails.logger Rails.logger = @fake_logger = FakeLogger.new diff --git a/spec/integration/invite_only_registration_spec.rb b/spec/integration/invite_only_registration_spec.rb index 5dd2aedfa88..a30869094ea 100644 --- a/spec/integration/invite_only_registration_spec.rb +++ b/spec/integration/invite_only_registration_spec.rb @@ -1,7 +1,7 @@ # encoding: UTF-8 # frozen_string_literal: true -describe 'invite only' do +RSpec.describe 'invite only' do describe '#create invite only' do it 'can create user via API' do diff --git a/spec/integration/message_bus_spec.rb b/spec/integration/message_bus_spec.rb index 571eabf008c..a2f961ddc55 100644 --- a/spec/integration/message_bus_spec.rb +++ b/spec/integration/message_bus_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe 'message bus integration' do +RSpec.describe 'message bus integration' do it "allows anonymous requests to the messagebus" do post "/message-bus/poll" diff --git a/spec/integration/multisite_cookies_spec.rb b/spec/integration/multisite_cookies_spec.rb index c5d2a3b2ef1..15bad1c74bb 100644 --- a/spec/integration/multisite_cookies_spec.rb +++ b/spec/integration/multisite_cookies_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe 'multisite', type: [:multisite, :request] do +RSpec.describe 'multisite', type: [:multisite, :request] do it "works" do get "http://test.localhost/session/csrf.json" expect(response.status).to eq(200) diff --git a/spec/integration/multisite_spec.rb b/spec/integration/multisite_spec.rb index 46859666e20..d53c4435606 100644 --- a/spec/integration/multisite_spec.rb +++ b/spec/integration/multisite_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe 'multisite', type: [:multisite, :request] do +RSpec.describe 'multisite', type: [:multisite, :request] do it "should always allow /srv/status through" do get "http://unknown.com/srv/status" expect(response.status).to eq(200) diff --git a/spec/integration/rate_limiting_spec.rb b/spec/integration/rate_limiting_spec.rb index 8bf499aee8b..ebf24e909b3 100644 --- a/spec/integration/rate_limiting_spec.rb +++ b/spec/integration/rate_limiting_spec.rb @@ -1,7 +1,7 @@ # encoding: UTF-8 # frozen_string_literal: true -describe 'rate limiter integration' do +RSpec.describe 'rate limiter integration' do before do RateLimiter.enable diff --git a/spec/integration/same_ip_spammers_spec.rb b/spec/integration/same_ip_spammers_spec.rb index 1ce26b8cbe4..b7cde6e3f63 100644 --- a/spec/integration/same_ip_spammers_spec.rb +++ b/spec/integration/same_ip_spammers_spec.rb @@ -1,7 +1,7 @@ # encoding: UTF-8 # frozen_string_literal: true -describe "spammers on same IP" do +RSpec.describe "spammers on same IP" do let(:ip_address) { '182.189.119.174' } let!(:spammer1) { Fabricate(:user, ip_address: ip_address) } diff --git a/spec/integration/spam_rules_spec.rb b/spec/integration/spam_rules_spec.rb index cbd95df0809..cfc22442d8e 100644 --- a/spec/integration/spam_rules_spec.rb +++ b/spec/integration/spam_rules_spec.rb @@ -1,7 +1,7 @@ # encoding: UTF-8 # frozen_string_literal: true -describe "spam rules for users" do +RSpec.describe "spam rules for users" do describe 'auto-silence users based on flagging' do fab!(:admin) { Fabricate(:admin) } # needed to send a system message diff --git a/spec/integration/topic_auto_close_spec.rb b/spec/integration/topic_auto_close_spec.rb index 3ec395c075f..11d851678ec 100644 --- a/spec/integration/topic_auto_close_spec.rb +++ b/spec/integration/topic_auto_close_spec.rb @@ -1,7 +1,7 @@ # encoding: UTF-8 # frozen_string_literal: true -describe Topic do +RSpec.describe Topic do let(:job_klass) { Jobs::CloseTopic } context 'creating a topic without auto-close' do diff --git a/spec/integration/topic_thumbnail_spec.rb b/spec/integration/topic_thumbnail_spec.rb index db67e603b14..9245716b149 100644 --- a/spec/integration/topic_thumbnail_spec.rb +++ b/spec/integration/topic_thumbnail_spec.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -describe "Topic Thumbnails" do +RSpec.describe "Topic Thumbnails" do before do SiteSetting.create_thumbnails = true ImageSizer.stubs(:resize).returns([9, 9]) diff --git a/spec/integration/watched_words_spec.rb b/spec/integration/watched_words_spec.rb index 5d4052e3286..0aec8298d18 100644 --- a/spec/integration/watched_words_spec.rb +++ b/spec/integration/watched_words_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe WatchedWord do +RSpec.describe WatchedWord do fab!(:tl2_user) { Fabricate(:user, trust_level: TrustLevel[2]) } fab!(:admin) { Fabricate(:admin) } fab!(:moderator) { Fabricate(:moderator) } diff --git a/spec/integrity/coding_style_spec.rb b/spec/integrity/coding_style_spec.rb index 123b03ba284..b51e6da61f2 100644 --- a/spec/integrity/coding_style_spec.rb +++ b/spec/integrity/coding_style_spec.rb @@ -17,7 +17,7 @@ def grep_file(file, regex) lines.count > 0 ? file : nil end -describe 'Coding style' do +RSpec.describe 'Coding style' do describe 'Javascript' do it 'prevents this.get("foo") pattern' do js_files = list_js_files('app/assets/javascripts') diff --git a/spec/integrity/common_mark_spec.rb b/spec/integrity/common_mark_spec.rb index 07ebdd0768e..01cc77683f6 100644 --- a/spec/integrity/common_mark_spec.rb +++ b/spec/integrity/common_mark_spec.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -describe "CommonMark" do +RSpec.describe "CommonMark" do it 'passes spec' do SiteSetting.traditional_markdown_linebreaks = true diff --git a/spec/integrity/i18n_spec.rb b/spec/integrity/i18n_spec.rb index 2ab21f50699..0205584c24d 100644 --- a/spec/integrity/i18n_spec.rb +++ b/spec/integrity/i18n_spec.rb @@ -20,7 +20,7 @@ def is_yaml_compatible?(english, translated) true end -describe "i18n integrity checks" do +RSpec.describe "i18n integrity checks" do it "has an i18n key for each Site Setting" do SiteSetting.all_settings.each do |s| next if s[:setting][/^test_/] @@ -97,7 +97,7 @@ describe "i18n integrity checks" do end end -describe "fallbacks" do +RSpec.describe "fallbacks" do before do I18n.backend = I18n::Backend::DiscourseI18n.new I18n.fallbacks = I18n::Backend::FallbackLocaleList.new diff --git a/spec/integrity/js_constants_spec.rb b/spec/integrity/js_constants_spec.rb index 50b81d3565b..fe13669d549 100644 --- a/spec/integrity/js_constants_spec.rb +++ b/spec/integrity/js_constants_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe "constants match ruby" do +RSpec.describe "constants match ruby" do let(:ctx) { MiniRacer::Context.new } diff --git a/spec/integrity/oj_spec.rb b/spec/integrity/oj_spec.rb index c0ccdecf2f3..799f7578f2b 100644 --- a/spec/integrity/oj_spec.rb +++ b/spec/integrity/oj_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe 'Oj' do +RSpec.describe 'Oj' do it "is enabled" do classes = Set.new tracer = TracePoint.new(:c_call) { |tp| classes << tp.defined_class } diff --git a/spec/integrity/onceoff_integrity_spec.rb b/spec/integrity/onceoff_integrity_spec.rb index ebc0e685f67..e913d2c8160 100644 --- a/spec/integrity/onceoff_integrity_spec.rb +++ b/spec/integrity/onceoff_integrity_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe ::Jobs::Onceoff do +RSpec.describe ::Jobs::Onceoff do it "can run all once off jobs without errors" do # Load all once offs Dir[Rails.root + 'app/jobs/onceoff/*.rb'].each do |f| diff --git a/spec/integrity/site_setting_spec.rb b/spec/integrity/site_setting_spec.rb index 51d17551837..8779af45769 100644 --- a/spec/integrity/site_setting_spec.rb +++ b/spec/integrity/site_setting_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe "site setting integrity checks" do +RSpec.describe "site setting integrity checks" do let(:site_setting_file) { File.join(Rails.root, 'config', 'site_settings.yml') } let(:yaml) { YAML.load_file(site_setting_file) } diff --git a/spec/jobs/about_stats_spec.rb b/spec/jobs/about_stats_spec.rb index fd30464d683..3a2e5d6aa90 100644 --- a/spec/jobs/about_stats_spec.rb +++ b/spec/jobs/about_stats_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::AboutStats do +RSpec.describe Jobs::AboutStats do it 'caches the stats' do begin stats = About.fetch_stats.to_json diff --git a/spec/jobs/activation_reminder_emails_spec.rb b/spec/jobs/activation_reminder_emails_spec.rb index 32a59ff9f4b..d7956d3dcdf 100644 --- a/spec/jobs/activation_reminder_emails_spec.rb +++ b/spec/jobs/activation_reminder_emails_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::ActivationReminderEmails do +RSpec.describe Jobs::ActivationReminderEmails do before { Jobs.run_immediately! } # should be between 2 and 3 days diff --git a/spec/jobs/auto_queue_handler_spec.rb b/spec/jobs/auto_queue_handler_spec.rb index 39c98700c77..ece2af84735 100644 --- a/spec/jobs/auto_queue_handler_spec.rb +++ b/spec/jobs/auto_queue_handler_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::AutoQueueHandler do +RSpec.describe Jobs::AutoQueueHandler do subject { Jobs::AutoQueueHandler.new.execute({}) } diff --git a/spec/jobs/automatic_group_membership_spec.rb b/spec/jobs/automatic_group_membership_spec.rb index dac188f4ee2..5ad6140895e 100644 --- a/spec/jobs/automatic_group_membership_spec.rb +++ b/spec/jobs/automatic_group_membership_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::AutomaticGroupMembership do +RSpec.describe Jobs::AutomaticGroupMembership do it "raises an error when the group id is missing" do expect { Jobs::AutomaticGroupMembership.new.execute({}) }.to raise_error(Discourse::InvalidParameters) diff --git a/spec/jobs/bulk_grant_trust_level_spec.rb b/spec/jobs/bulk_grant_trust_level_spec.rb index b91dd142820..bfda953eba1 100644 --- a/spec/jobs/bulk_grant_trust_level_spec.rb +++ b/spec/jobs/bulk_grant_trust_level_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::BulkGrantTrustLevel do +RSpec.describe Jobs::BulkGrantTrustLevel do it "raises an error when trust_level is missing" do expect { Jobs::BulkGrantTrustLevel.new.execute(user_ids: [1, 2]) }.to raise_error(Discourse::InvalidParameters) diff --git a/spec/jobs/bulk_invite_spec.rb b/spec/jobs/bulk_invite_spec.rb index 66c1cf03772..0bbddc17b48 100644 --- a/spec/jobs/bulk_invite_spec.rb +++ b/spec/jobs/bulk_invite_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::BulkInvite do +RSpec.describe Jobs::BulkInvite do describe '#execute' do fab!(:user) { Fabricate(:user) } fab!(:admin) { Fabricate(:admin) } diff --git a/spec/jobs/bump_topic_spec.rb b/spec/jobs/bump_topic_spec.rb index 0f1359eb08a..ed7668d9c53 100644 --- a/spec/jobs/bump_topic_spec.rb +++ b/spec/jobs/bump_topic_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::BumpTopic do +RSpec.describe Jobs::BumpTopic do fab!(:admin) { Fabricate(:admin) } fab!(:user) { Fabricate(:user) } diff --git a/spec/jobs/clean_dismissed_topic_users_spec.rb b/spec/jobs/clean_dismissed_topic_users_spec.rb index b74a534043a..187ce7c79d0 100644 --- a/spec/jobs/clean_dismissed_topic_users_spec.rb +++ b/spec/jobs/clean_dismissed_topic_users_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::CleanDismissedTopicUsers do +RSpec.describe Jobs::CleanDismissedTopicUsers do fab!(:user) { Fabricate(:user, created_at: 1.days.ago, previous_visit_at: 1.days.ago) } fab!(:topic) { Fabricate(:topic, created_at: 5.hours.ago) } fab!(:dismissed_topic_user) { Fabricate(:dismissed_topic_user, user: user, topic: topic) } diff --git a/spec/jobs/clean_up_associated_accounts_spec.rb b/spec/jobs/clean_up_associated_accounts_spec.rb index 18a81d34398..433c5fcaaca 100644 --- a/spec/jobs/clean_up_associated_accounts_spec.rb +++ b/spec/jobs/clean_up_associated_accounts_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::CleanUpAssociatedAccounts do +RSpec.describe Jobs::CleanUpAssociatedAccounts do subject { Jobs::CleanUpAssociatedAccounts.new.execute({}) } it "deletes the correct records" do diff --git a/spec/jobs/clean_up_crawler_stats_spec.rb b/spec/jobs/clean_up_crawler_stats_spec.rb index 48d0d80d94d..8f954b4334d 100644 --- a/spec/jobs/clean_up_crawler_stats_spec.rb +++ b/spec/jobs/clean_up_crawler_stats_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::CleanUpCrawlerStats do +RSpec.describe Jobs::CleanUpCrawlerStats do subject { Jobs::CleanUpCrawlerStats.new.execute({}) } it "deletes records older than 30 days old" do diff --git a/spec/jobs/clean_up_email_change_requests_spec.rb b/spec/jobs/clean_up_email_change_requests_spec.rb index f8e6de63fee..f7432990c7a 100644 --- a/spec/jobs/clean_up_email_change_requests_spec.rb +++ b/spec/jobs/clean_up_email_change_requests_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::CleanUpEmailChangeRequests do +RSpec.describe Jobs::CleanUpEmailChangeRequests do it "deletes records older than 1 month" do very_old = Fabricate(:email_change_request, updated_at: 32.days.ago) yesterday = Fabricate(:email_change_request, updated_at: 1.day.ago) diff --git a/spec/jobs/clean_up_email_logs_spec.rb b/spec/jobs/clean_up_email_logs_spec.rb index 78fcca1228b..3d0ec29b09a 100644 --- a/spec/jobs/clean_up_email_logs_spec.rb +++ b/spec/jobs/clean_up_email_logs_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::CleanUpEmailLogs do +RSpec.describe Jobs::CleanUpEmailLogs do fab!(:email_log) { Fabricate(:email_log, created_at: 2.years.ago) } fab!(:email_log2) { Fabricate(:email_log, created_at: 2.weeks.ago) } fab!(:email_log3) { Fabricate(:email_log, created_at: 2.days.ago) } diff --git a/spec/jobs/clean_up_uploads_spec.rb b/spec/jobs/clean_up_uploads_spec.rb index d6448995d68..842f3e0d1be 100644 --- a/spec/jobs/clean_up_uploads_spec.rb +++ b/spec/jobs/clean_up_uploads_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::CleanUpUploads do +RSpec.describe Jobs::CleanUpUploads do def fabricate_upload(attributes = {}) Fabricate(:upload, { created_at: 2.hours.ago }.merge(attributes)) diff --git a/spec/jobs/cleanup_imap_sync_log_spec.rb b/spec/jobs/cleanup_imap_sync_log_spec.rb index ca906dc9296..2ca22f17f98 100644 --- a/spec/jobs/cleanup_imap_sync_log_spec.rb +++ b/spec/jobs/cleanup_imap_sync_log_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::CleanupImapSyncLog do +RSpec.describe Jobs::CleanupImapSyncLog do let(:job_class) { Jobs::CleanupImapSyncLog.new } it "deletes logs older than RETAIN_LOGS_DAYS" do diff --git a/spec/jobs/close_topic_spec.rb b/spec/jobs/close_topic_spec.rb index 248e74a329c..a3b24a82fd3 100644 --- a/spec/jobs/close_topic_spec.rb +++ b/spec/jobs/close_topic_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::CloseTopic do +RSpec.describe Jobs::CloseTopic do fab!(:admin) { Fabricate(:admin) } fab!(:topic) do diff --git a/spec/jobs/correct_missing_dualstack_urls_spec.rb b/spec/jobs/correct_missing_dualstack_urls_spec.rb index fe900a9b6a3..09c35a3abd6 100644 --- a/spec/jobs/correct_missing_dualstack_urls_spec.rb +++ b/spec/jobs/correct_missing_dualstack_urls_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::CorrectMissingDualstackUrls do +RSpec.describe Jobs::CorrectMissingDualstackUrls do it 'corrects the urls' do setup_s3 SiteSetting.s3_region = "us-east-1" diff --git a/spec/jobs/crawl_topic_link_spec.rb b/spec/jobs/crawl_topic_link_spec.rb index bef14cee113..2ced470cff1 100644 --- a/spec/jobs/crawl_topic_link_spec.rb +++ b/spec/jobs/crawl_topic_link_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::CrawlTopicLink do +RSpec.describe Jobs::CrawlTopicLink do let(:job) { Jobs::CrawlTopicLink.new } diff --git a/spec/jobs/create_linked_topic_spec.rb b/spec/jobs/create_linked_topic_spec.rb index e8ff6745542..95831164691 100644 --- a/spec/jobs/create_linked_topic_spec.rb +++ b/spec/jobs/create_linked_topic_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::CreateLinkedTopic do +RSpec.describe Jobs::CreateLinkedTopic do it "returns when the post cannot be found" do expect { Jobs::CreateLinkedTopic.new.perform(post_id: 1, sync_exec: true) }.not_to raise_error end diff --git a/spec/jobs/create_missing_avatars_spec.rb b/spec/jobs/create_missing_avatars_spec.rb index d4995a331da..cd74e9c0342 100644 --- a/spec/jobs/create_missing_avatars_spec.rb +++ b/spec/jobs/create_missing_avatars_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::CreateMissingAvatars do +RSpec.describe Jobs::CreateMissingAvatars do it "runs correctly without crashing" do Jobs::CreateMissingAvatars.new.execute(nil) end diff --git a/spec/jobs/create_recent_post_search_indexes_spec.rb b/spec/jobs/create_recent_post_search_indexes_spec.rb index aea66a761b0..fa7e9a931ed 100644 --- a/spec/jobs/create_recent_post_search_indexes_spec.rb +++ b/spec/jobs/create_recent_post_search_indexes_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::CreateRecentPostSearchIndexes do +RSpec.describe Jobs::CreateRecentPostSearchIndexes do subject { described_class.new } fab!(:post) do diff --git a/spec/jobs/create_user_reviewable_spec.rb b/spec/jobs/create_user_reviewable_spec.rb index c0529874887..1a9634af94b 100644 --- a/spec/jobs/create_user_reviewable_spec.rb +++ b/spec/jobs/create_user_reviewable_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::CreateUserReviewable do +RSpec.describe Jobs::CreateUserReviewable do let(:user) { Fabricate(:user) } diff --git a/spec/jobs/dashboard_stats_spec.rb b/spec/jobs/dashboard_stats_spec.rb index 87485406be8..02682958d1f 100644 --- a/spec/jobs/dashboard_stats_spec.rb +++ b/spec/jobs/dashboard_stats_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe ::Jobs::DashboardStats do +RSpec.describe ::Jobs::DashboardStats do let(:group_message) { GroupMessage.new(Group[:admins].name, :dashboard_problems, limit_once_per: 7.days.to_i) } def clear_recently_sent! diff --git a/spec/jobs/delete_replies_spec.rb b/spec/jobs/delete_replies_spec.rb index 70e1704f533..7bd9e219db9 100644 --- a/spec/jobs/delete_replies_spec.rb +++ b/spec/jobs/delete_replies_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::DeleteReplies do +RSpec.describe Jobs::DeleteReplies do fab!(:admin) { Fabricate(:admin) } fab!(:topic) { Fabricate(:topic) } diff --git a/spec/jobs/delete_topic_spec.rb b/spec/jobs/delete_topic_spec.rb index a70323dcf6e..a65fb3052b8 100644 --- a/spec/jobs/delete_topic_spec.rb +++ b/spec/jobs/delete_topic_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::DeleteTopic do +RSpec.describe Jobs::DeleteTopic do fab!(:admin) { Fabricate(:admin) } fab!(:topic) do diff --git a/spec/jobs/disable_bootstrap_mode_spec.rb b/spec/jobs/disable_bootstrap_mode_spec.rb index 1b9e1cfb7df..3d5b8d4e13c 100644 --- a/spec/jobs/disable_bootstrap_mode_spec.rb +++ b/spec/jobs/disable_bootstrap_mode_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::DisableBootstrapMode do +RSpec.describe Jobs::DisableBootstrapMode do describe '.execute' do fab!(:admin) { Fabricate(:admin) } diff --git a/spec/jobs/emit_web_hook_event_spec.rb b/spec/jobs/emit_web_hook_event_spec.rb index 9410c2e2c60..031c98c5249 100644 --- a/spec/jobs/emit_web_hook_event_spec.rb +++ b/spec/jobs/emit_web_hook_event_spec.rb @@ -2,7 +2,7 @@ require 'excon' -describe Jobs::EmitWebHookEvent do +RSpec.describe Jobs::EmitWebHookEvent do fab!(:post_hook) { Fabricate(:web_hook) } fab!(:inactive_hook) { Fabricate(:inactive_web_hook) } fab!(:post) { Fabricate(:post) } diff --git a/spec/jobs/enable_bootstrap_mode_spec.rb b/spec/jobs/enable_bootstrap_mode_spec.rb index 29a2284862b..583caa041e7 100644 --- a/spec/jobs/enable_bootstrap_mode_spec.rb +++ b/spec/jobs/enable_bootstrap_mode_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::EnableBootstrapMode do +RSpec.describe Jobs::EnableBootstrapMode do describe '.execute' do fab!(:admin) { Fabricate(:admin) } diff --git a/spec/jobs/enqueue_digest_emails_spec.rb b/spec/jobs/enqueue_digest_emails_spec.rb index e7ce8026806..958c7a5064a 100644 --- a/spec/jobs/enqueue_digest_emails_spec.rb +++ b/spec/jobs/enqueue_digest_emails_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::EnqueueDigestEmails do +RSpec.describe Jobs::EnqueueDigestEmails do describe '#target_users' do diff --git a/spec/jobs/enqueue_suspect_users_spec.rb b/spec/jobs/enqueue_suspect_users_spec.rb index 98ad4fc8497..d1c52285bac 100644 --- a/spec/jobs/enqueue_suspect_users_spec.rb +++ b/spec/jobs/enqueue_suspect_users_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::EnqueueSuspectUsers do +RSpec.describe Jobs::EnqueueSuspectUsers do before { SiteSetting.approve_suspect_users = true } it 'does nothing when there are no suspect users' do diff --git a/spec/jobs/export_csv_file_spec.rb b/spec/jobs/export_csv_file_spec.rb index 9b6fcb8b030..c126cbc9a85 100644 --- a/spec/jobs/export_csv_file_spec.rb +++ b/spec/jobs/export_csv_file_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::ExportCsvFile do +RSpec.describe Jobs::ExportCsvFile do describe '#execute' do let(:other_user) { Fabricate(:user) } diff --git a/spec/jobs/export_user_archive_spec.rb b/spec/jobs/export_user_archive_spec.rb index 234d26697d8..15eb36313ac 100644 --- a/spec/jobs/export_user_archive_spec.rb +++ b/spec/jobs/export_user_archive_spec.rb @@ -2,7 +2,7 @@ require 'csv' -describe Jobs::ExportUserArchive do +RSpec.describe Jobs::ExportUserArchive do fab!(:user) { Fabricate(:user, username: "john_doe") } fab!(:user2) { Fabricate(:user) } let(:extra) { {} } diff --git a/spec/jobs/feature_topic_users_spec.rb b/spec/jobs/feature_topic_users_spec.rb index 3d4aa0fe3d7..bae3f19a6d3 100644 --- a/spec/jobs/feature_topic_users_spec.rb +++ b/spec/jobs/feature_topic_users_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::FeatureTopicUsers do +RSpec.describe Jobs::FeatureTopicUsers do it "raises an error without a topic_id" do expect { Jobs::FeatureTopicUsers.new.execute({}) }.to raise_error(Discourse::InvalidParameters) end diff --git a/spec/jobs/grant_anniversary_badges_spec.rb b/spec/jobs/grant_anniversary_badges_spec.rb index 702e77cb010..e2e2b70c849 100644 --- a/spec/jobs/grant_anniversary_badges_spec.rb +++ b/spec/jobs/grant_anniversary_badges_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::GrantAnniversaryBadges do +RSpec.describe Jobs::GrantAnniversaryBadges do let(:granter) { described_class.new } diff --git a/spec/jobs/grant_new_user_of_the_month_badges_spec.rb b/spec/jobs/grant_new_user_of_the_month_badges_spec.rb index 8eb19a15b0c..419f709cad0 100644 --- a/spec/jobs/grant_new_user_of_the_month_badges_spec.rb +++ b/spec/jobs/grant_new_user_of_the_month_badges_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::GrantNewUserOfTheMonthBadges do +RSpec.describe Jobs::GrantNewUserOfTheMonthBadges do let(:granter) { described_class.new } diff --git a/spec/jobs/heartbeat_spec.rb b/spec/jobs/heartbeat_spec.rb index b1988bcfe11..f62043e2871 100644 --- a/spec/jobs/heartbeat_spec.rb +++ b/spec/jobs/heartbeat_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe ::Jobs::Heartbeat do +RSpec.describe ::Jobs::Heartbeat do after do Discourse.disable_readonly_mode end diff --git a/spec/jobs/ignored_users_summary_spec.rb b/spec/jobs/ignored_users_summary_spec.rb index d111652ecf8..1768161a7c8 100644 --- a/spec/jobs/ignored_users_summary_spec.rb +++ b/spec/jobs/ignored_users_summary_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::IgnoredUsersSummary do +RSpec.describe Jobs::IgnoredUsersSummary do before do SiteSetting.ignored_users_count_message_threshold = 1 SiteSetting.ignored_users_message_gap_days = 365 diff --git a/spec/jobs/invalidate_inactive_admins_spec.rb b/spec/jobs/invalidate_inactive_admins_spec.rb index 1ec5b7367f7..ca84c2e8577 100644 --- a/spec/jobs/invalidate_inactive_admins_spec.rb +++ b/spec/jobs/invalidate_inactive_admins_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::InvalidateInactiveAdmins do +RSpec.describe Jobs::InvalidateInactiveAdmins do fab!(:active_admin) { Fabricate(:admin, last_seen_at: 1.hour.ago) } before { active_admin.email_tokens.update_all(confirmed: true) } diff --git a/spec/jobs/invite_email_spec.rb b/spec/jobs/invite_email_spec.rb index e494f327ee5..ec4bae6c519 100644 --- a/spec/jobs/invite_email_spec.rb +++ b/spec/jobs/invite_email_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::InviteEmail do +RSpec.describe Jobs::InviteEmail do describe '.execute' do diff --git a/spec/jobs/jobs_base_spec.rb b/spec/jobs/jobs_base_spec.rb index a8030719d61..5225019b03d 100644 --- a/spec/jobs/jobs_base_spec.rb +++ b/spec/jobs/jobs_base_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe ::Jobs::Base do +RSpec.describe ::Jobs::Base do class GoodJob < ::Jobs::Base attr_accessor :count def execute(args) diff --git a/spec/jobs/jobs_spec.rb b/spec/jobs/jobs_spec.rb index 09a83d905e6..f5ce9e2ccdb 100644 --- a/spec/jobs/jobs_spec.rb +++ b/spec/jobs/jobs_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs do +RSpec.describe Jobs do describe 'enqueue' do diff --git a/spec/jobs/mass_award_badge_spec.rb b/spec/jobs/mass_award_badge_spec.rb index 435d4af59d9..024014a84a9 100644 --- a/spec/jobs/mass_award_badge_spec.rb +++ b/spec/jobs/mass_award_badge_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::MassAwardBadge do +RSpec.describe Jobs::MassAwardBadge do describe '#execute' do fab!(:badge) { Fabricate(:badge) } fab!(:user) { Fabricate(:user) } diff --git a/spec/jobs/migrate_badge_image_to_uploads_spec.rb b/spec/jobs/migrate_badge_image_to_uploads_spec.rb index 43794ee17dc..21dfabe7806 100644 --- a/spec/jobs/migrate_badge_image_to_uploads_spec.rb +++ b/spec/jobs/migrate_badge_image_to_uploads_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::MigrateBadgeImageToUploads do +RSpec.describe Jobs::MigrateBadgeImageToUploads do let(:image_url) { "https://omg.aws.somestack/test.png" } let(:badge) { Fabricate(:badge) } diff --git a/spec/jobs/notify_mailing_list_subscribers_spec.rb b/spec/jobs/notify_mailing_list_subscribers_spec.rb index 271bc26a45a..ceed63d598a 100644 --- a/spec/jobs/notify_mailing_list_subscribers_spec.rb +++ b/spec/jobs/notify_mailing_list_subscribers_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::NotifyMailingListSubscribers do +RSpec.describe Jobs::NotifyMailingListSubscribers do fab!(:mailing_list_user) { Fabricate(:user) } diff --git a/spec/jobs/notify_moved_posts_spec.rb b/spec/jobs/notify_moved_posts_spec.rb index 341a261f652..dda5fdbbe6d 100644 --- a/spec/jobs/notify_moved_posts_spec.rb +++ b/spec/jobs/notify_moved_posts_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::NotifyMovedPosts do +RSpec.describe Jobs::NotifyMovedPosts do it "raises an error without post_ids" do expect { Jobs::NotifyMovedPosts.new.execute(moved_by_id: 1234) }.to raise_error(Discourse::InvalidParameters) diff --git a/spec/jobs/notify_reviewable_spec.rb b/spec/jobs/notify_reviewable_spec.rb index aff1b32de97..d54c08f7041 100644 --- a/spec/jobs/notify_reviewable_spec.rb +++ b/spec/jobs/notify_reviewable_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::NotifyReviewable do +RSpec.describe Jobs::NotifyReviewable do describe '.execute' do fab!(:admin) { Fabricate(:admin, moderator: true) } fab!(:moderator) { Fabricate(:moderator) } diff --git a/spec/jobs/notify_tag_change_spec.rb b/spec/jobs/notify_tag_change_spec.rb index f5bb3883190..efe15c959fe 100644 --- a/spec/jobs/notify_tag_change_spec.rb +++ b/spec/jobs/notify_tag_change_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe ::Jobs::NotifyTagChange do +RSpec.describe ::Jobs::NotifyTagChange do fab!(:user) { Fabricate(:user) } fab!(:regular_user) { Fabricate(:trust_level_4) } diff --git a/spec/jobs/old_keys_reminder_spec.rb b/spec/jobs/old_keys_reminder_spec.rb index 8459ca1b06a..a6d4fb89db5 100644 --- a/spec/jobs/old_keys_reminder_spec.rb +++ b/spec/jobs/old_keys_reminder_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::OldKeysReminder do +RSpec.describe Jobs::OldKeysReminder do let!(:google_secret) { SiteSetting.create!(name: 'google_oauth2_client_secret', value: '123', data_type: 1) } let!(:github_secret) { SiteSetting.create!(name: 'github_client_secret', value: '123', data_type: 1) } let!(:api_key) { Fabricate(:api_key, description: 'api key description') } diff --git a/spec/jobs/open_topic_spec.rb b/spec/jobs/open_topic_spec.rb index 27d52cb3fef..9a401db7275 100644 --- a/spec/jobs/open_topic_spec.rb +++ b/spec/jobs/open_topic_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::OpenTopic do +RSpec.describe Jobs::OpenTopic do fab!(:admin) { Fabricate(:admin) } fab!(:topic) do diff --git a/spec/jobs/pending_queued_posts_reminder_spec.rb b/spec/jobs/pending_queued_posts_reminder_spec.rb index ccc6961be23..fde2b66e0be 100644 --- a/spec/jobs/pending_queued_posts_reminder_spec.rb +++ b/spec/jobs/pending_queued_posts_reminder_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::PendingQueuedPostsReminder do +RSpec.describe Jobs::PendingQueuedPostsReminder do let(:job) { described_class.new } context "notify_about_queued_posts_after is 0" do diff --git a/spec/jobs/pending_reviewables_reminder_spec.rb b/spec/jobs/pending_reviewables_reminder_spec.rb index 6658e3d6ff8..c93928c35dd 100644 --- a/spec/jobs/pending_reviewables_reminder_spec.rb +++ b/spec/jobs/pending_reviewables_reminder_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::PendingReviewablesReminder do +RSpec.describe Jobs::PendingReviewablesReminder do let(:job) { described_class.new } def create_flag(created_at) diff --git a/spec/jobs/pending_users_reminder_spec.rb b/spec/jobs/pending_users_reminder_spec.rb index 75f2bd6f04c..d3a9c4d011c 100644 --- a/spec/jobs/pending_users_reminder_spec.rb +++ b/spec/jobs/pending_users_reminder_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::PendingUsersReminder do +RSpec.describe Jobs::PendingUsersReminder do context 'must_approve_users is true' do before do diff --git a/spec/jobs/periodical_updates_spec.rb b/spec/jobs/periodical_updates_spec.rb index 5541cc181b2..f6282fb956f 100644 --- a/spec/jobs/periodical_updates_spec.rb +++ b/spec/jobs/periodical_updates_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::PeriodicalUpdates do +RSpec.describe Jobs::PeriodicalUpdates do it "works" do diff --git a/spec/jobs/poll_mailbox_spec.rb b/spec/jobs/poll_mailbox_spec.rb index 791a070bee0..1f5e59e7641 100644 --- a/spec/jobs/poll_mailbox_spec.rb +++ b/spec/jobs/poll_mailbox_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::PollMailbox do +RSpec.describe Jobs::PollMailbox do let(:poller) { Jobs::PollMailbox.new } diff --git a/spec/jobs/problem_checks_spec.rb b/spec/jobs/problem_checks_spec.rb index a0ccfb43dc6..7f254f001d7 100644 --- a/spec/jobs/problem_checks_spec.rb +++ b/spec/jobs/problem_checks_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::ProblemChecks do +RSpec.describe Jobs::ProblemChecks do after do Discourse.redis.flushdb AdminDashboardData.reset_problem_checks diff --git a/spec/jobs/process_bulk_invite_emails_spec.rb b/spec/jobs/process_bulk_invite_emails_spec.rb index 7cc1ffc6050..a177e244b80 100644 --- a/spec/jobs/process_bulk_invite_emails_spec.rb +++ b/spec/jobs/process_bulk_invite_emails_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::ProcessBulkInviteEmails do +RSpec.describe Jobs::ProcessBulkInviteEmails do describe '#execute' do it 'processes pending invites' do invite = Fabricate(:invite, emailed_status: Invite.emailed_status_types[:bulk_pending]) diff --git a/spec/jobs/process_email_spec.rb b/spec/jobs/process_email_spec.rb index 69ca615b263..eeedaf8ace3 100644 --- a/spec/jobs/process_email_spec.rb +++ b/spec/jobs/process_email_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::ProcessEmail do +RSpec.describe Jobs::ProcessEmail do let(:mail) { "From: foo@bar.com\nTo: bar@foo.com\nSubject: FOO BAR\n\nFoo foo bar bar?" } diff --git a/spec/jobs/process_post_spec.rb b/spec/jobs/process_post_spec.rb index ddcfe663551..98d843fcdc7 100644 --- a/spec/jobs/process_post_spec.rb +++ b/spec/jobs/process_post_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::ProcessPost do +RSpec.describe Jobs::ProcessPost do it "returns when the post cannot be found" do expect { Jobs::ProcessPost.new.perform(post_id: 1, sync_exec: true) }.not_to raise_error end diff --git a/spec/jobs/process_shelved_notifications_spec.rb b/spec/jobs/process_shelved_notifications_spec.rb index 4f406e46eed..fb100d36da7 100644 --- a/spec/jobs/process_shelved_notifications_spec.rb +++ b/spec/jobs/process_shelved_notifications_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::ProcessShelvedNotifications do +RSpec.describe Jobs::ProcessShelvedNotifications do fab!(:user) { Fabricate(:user) } let(:post) { Fabricate(:post) } diff --git a/spec/jobs/pull_hotlinked_images_spec.rb b/spec/jobs/pull_hotlinked_images_spec.rb index a9cfeeec453..c30f5a714ba 100644 --- a/spec/jobs/pull_hotlinked_images_spec.rb +++ b/spec/jobs/pull_hotlinked_images_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::PullHotlinkedImages do +RSpec.describe Jobs::PullHotlinkedImages do let(:image_url) { "http://wiki.mozilla.org/images/2/2e/Longcat1.png" } let(:broken_image_url) { "http://wiki.mozilla.org/images/2/2e/Longcat2.png" } let(:large_image_url) { "http://wiki.mozilla.org/images/2/2e/Longcat3.png" } diff --git a/spec/jobs/pull_user_profile_hotlinked_images_spec.rb b/spec/jobs/pull_user_profile_hotlinked_images_spec.rb index c6b77439057..2dbce8437fd 100644 --- a/spec/jobs/pull_user_profile_hotlinked_images_spec.rb +++ b/spec/jobs/pull_user_profile_hotlinked_images_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::PullUserProfileHotlinkedImages do +RSpec.describe Jobs::PullUserProfileHotlinkedImages do fab!(:user) { Fabricate(:user) } let(:image_url) { "http://wiki.mozilla.org/images/2/2e/Longcat1.png" } diff --git a/spec/jobs/purge_expired_ignored_users_spec.rb b/spec/jobs/purge_expired_ignored_users_spec.rb index 78ac68bc626..67f74e53310 100644 --- a/spec/jobs/purge_expired_ignored_users_spec.rb +++ b/spec/jobs/purge_expired_ignored_users_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::PurgeExpiredIgnoredUsers do +RSpec.describe Jobs::PurgeExpiredIgnoredUsers do subject { Jobs::PurgeExpiredIgnoredUsers.new.execute({}) } context "with no ignored users" do diff --git a/spec/jobs/regular/bulk_user_title_update_spec.rb b/spec/jobs/regular/bulk_user_title_update_spec.rb index 2f29f500b75..fa6c9b8da1b 100644 --- a/spec/jobs/regular/bulk_user_title_update_spec.rb +++ b/spec/jobs/regular/bulk_user_title_update_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::BulkUserTitleUpdate do +RSpec.describe Jobs::BulkUserTitleUpdate do fab!(:badge) { Fabricate(:badge, name: 'Protector of the Realm', allow_title: true) } fab!(:user) { Fabricate(:user) } fab!(:other_user) { Fabricate(:user) } diff --git a/spec/jobs/regular/update_post_uploads_secure_status_spec.rb b/spec/jobs/regular/update_post_uploads_secure_status_spec.rb index 34913bd7a2e..f8e2b7be530 100644 --- a/spec/jobs/regular/update_post_uploads_secure_status_spec.rb +++ b/spec/jobs/regular/update_post_uploads_secure_status_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe Jobs::UpdatePostUploadsSecureStatus do +RSpec.describe Jobs::UpdatePostUploadsSecureStatus do fab!(:post) { Fabricate(:post) } before do diff --git a/spec/jobs/reindex_search_spec.rb b/spec/jobs/reindex_search_spec.rb index 414de794cab..e61f9e71a82 100644 --- a/spec/jobs/reindex_search_spec.rb +++ b/spec/jobs/reindex_search_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::ReindexSearch do +RSpec.describe Jobs::ReindexSearch do before do SearchIndexer.enable Jobs.run_immediately! diff --git a/spec/jobs/remove_banner_spec.rb b/spec/jobs/remove_banner_spec.rb index b9026f1afcf..f218d801fc7 100644 --- a/spec/jobs/remove_banner_spec.rb +++ b/spec/jobs/remove_banner_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::RemoveBanner do +RSpec.describe Jobs::RemoveBanner do fab!(:topic) { Fabricate(:topic) } fab!(:user) { topic.user } diff --git a/spec/jobs/reviewable_priorities_spec.rb b/spec/jobs/reviewable_priorities_spec.rb index d4563229942..9b3ea9f0306 100644 --- a/spec/jobs/reviewable_priorities_spec.rb +++ b/spec/jobs/reviewable_priorities_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::ReviewablePriorities do +RSpec.describe Jobs::ReviewablePriorities do it "needs returns 0s with no existing reviewables" do Jobs::ReviewablePriorities.new.execute({}) diff --git a/spec/jobs/send_system_message_spec.rb b/spec/jobs/send_system_message_spec.rb index 5497e78dbfa..a21942d01fb 100644 --- a/spec/jobs/send_system_message_spec.rb +++ b/spec/jobs/send_system_message_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::SendSystemMessage do +RSpec.describe Jobs::SendSystemMessage do it "raises an error without a user_id" do expect { Jobs::SendSystemMessage.new.execute(message_type: 'welcome_invite') }.to raise_error(Discourse::InvalidParameters) end diff --git a/spec/jobs/suspicious_login_spec.rb b/spec/jobs/suspicious_login_spec.rb index 418374400c8..5d0ac1aa0aa 100644 --- a/spec/jobs/suspicious_login_spec.rb +++ b/spec/jobs/suspicious_login_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::SuspiciousLogin do +RSpec.describe Jobs::SuspiciousLogin do fab!(:user) { Fabricate(:moderator) } diff --git a/spec/jobs/sync_acls_for_uploads_spec.rb b/spec/jobs/sync_acls_for_uploads_spec.rb index c0c07b3f5d6..87d5e42d262 100644 --- a/spec/jobs/sync_acls_for_uploads_spec.rb +++ b/spec/jobs/sync_acls_for_uploads_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe Jobs::SyncAclsForUploads do +RSpec.describe Jobs::SyncAclsForUploads do let(:upload1) { Fabricate(:upload) } let(:upload2) { Fabricate(:upload) } let(:upload3) { Fabricate(:secure_upload) } diff --git a/spec/jobs/tl3_promotions_spec.rb b/spec/jobs/tl3_promotions_spec.rb index fadb6da3ce1..5c43b378e9c 100644 --- a/spec/jobs/tl3_promotions_spec.rb +++ b/spec/jobs/tl3_promotions_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::Tl3Promotions do +RSpec.describe Jobs::Tl3Promotions do def create_qualifying_stats(user) user.create_user_stat if user.user_stat.nil? diff --git a/spec/jobs/toggle_topic_closed_spec.rb b/spec/jobs/toggle_topic_closed_spec.rb index 65bc171394c..b7c8eacbc4e 100644 --- a/spec/jobs/toggle_topic_closed_spec.rb +++ b/spec/jobs/toggle_topic_closed_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::ToggleTopicClosed do +RSpec.describe Jobs::ToggleTopicClosed do fab!(:admin) { Fabricate(:admin) } fab!(:topic) do diff --git a/spec/jobs/truncate_user_flag_stats_spec.rb b/spec/jobs/truncate_user_flag_stats_spec.rb index 7682ff3bfca..3c64369ff20 100644 --- a/spec/jobs/truncate_user_flag_stats_spec.rb +++ b/spec/jobs/truncate_user_flag_stats_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::TruncateUserFlagStats do +RSpec.describe Jobs::TruncateUserFlagStats do fab!(:user) { Fabricate(:user) } fab!(:other_user) { Fabricate(:user) } diff --git a/spec/jobs/unsilence_users_spec.rb b/spec/jobs/unsilence_users_spec.rb index c9af68975b4..03e1ca4896b 100644 --- a/spec/jobs/unsilence_users_spec.rb +++ b/spec/jobs/unsilence_users_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::UnsilenceUsers do +RSpec.describe Jobs::UnsilenceUsers do it "unsilence users" do user = Fabricate(:user) UserSilencer.silence(user, Discourse.system_user, silenced_till: 2.days.ago) diff --git a/spec/jobs/update_animated_uploads_spec.rb b/spec/jobs/update_animated_uploads_spec.rb index 9541bf9feff..00fc83ef783 100644 --- a/spec/jobs/update_animated_uploads_spec.rb +++ b/spec/jobs/update_animated_uploads_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::UpdateAnimatedUploads do +RSpec.describe Jobs::UpdateAnimatedUploads do let!(:upload) { Fabricate(:upload) } let!(:gif_upload) { Fabricate(:upload, extension: "gif") } diff --git a/spec/jobs/update_gravatar_spec.rb b/spec/jobs/update_gravatar_spec.rb index 98addd98066..4b72fe95275 100644 --- a/spec/jobs/update_gravatar_spec.rb +++ b/spec/jobs/update_gravatar_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::UpdateGravatar do +RSpec.describe Jobs::UpdateGravatar do fab!(:user) { Fabricate(:user) } let(:temp) { Tempfile.new('test') } fab!(:upload) { Fabricate(:upload, user: user) } diff --git a/spec/jobs/update_s3_inventory_spec.rb b/spec/jobs/update_s3_inventory_spec.rb index 457c24d6441..ff8e032f040 100644 --- a/spec/jobs/update_s3_inventory_spec.rb +++ b/spec/jobs/update_s3_inventory_spec.rb @@ -2,7 +2,7 @@ require "file_store/s3_store" -describe Jobs::UpdateS3Inventory do +RSpec.describe Jobs::UpdateS3Inventory do before do setup_s3 SiteSetting.s3_upload_bucket = "special-bucket" diff --git a/spec/jobs/user_email_spec.rb b/spec/jobs/user_email_spec.rb index f15b02a7d72..3025fbe4742 100644 --- a/spec/jobs/user_email_spec.rb +++ b/spec/jobs/user_email_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Jobs::UserEmail do +RSpec.describe Jobs::UserEmail do before do SiteSetting.email_time_window_mins = 10 diff --git a/spec/lib/admin_confirmation_spec.rb b/spec/lib/admin_confirmation_spec.rb index e604289b27e..10e065c6036 100644 --- a/spec/lib/admin_confirmation_spec.rb +++ b/spec/lib/admin_confirmation_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'admin_confirmation' -describe AdminConfirmation do +RSpec.describe AdminConfirmation do fab!(:admin) { Fabricate(:admin) } fab!(:user) { Fabricate(:user) } diff --git a/spec/lib/admin_user_index_query_spec.rb b/spec/lib/admin_user_index_query_spec.rb index f9fb86b8d54..d9519d33eaa 100644 --- a/spec/lib/admin_user_index_query_spec.rb +++ b/spec/lib/admin_user_index_query_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe AdminUserIndexQuery do +RSpec.describe AdminUserIndexQuery do def real_users(query) query.find_users_query.where('users.id > 0') end diff --git a/spec/lib/archetype_spec.rb b/spec/lib/archetype_spec.rb index d20f1105f26..1f662c7b891 100644 --- a/spec/lib/archetype_spec.rb +++ b/spec/lib/archetype_spec.rb @@ -3,7 +3,7 @@ require 'archetype' -describe Archetype do +RSpec.describe Archetype do context 'default archetype' do diff --git a/spec/lib/auth/default_current_user_provider_spec.rb b/spec/lib/auth/default_current_user_provider_spec.rb index e3e93ee7489..b26d91afa97 100644 --- a/spec/lib/auth/default_current_user_provider_spec.rb +++ b/spec/lib/auth/default_current_user_provider_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Auth::DefaultCurrentUserProvider do +RSpec.describe Auth::DefaultCurrentUserProvider do # careful using fab! here is can lead to an erratic test # we want a distinct user object per test so last_seen_at is # handled correctly diff --git a/spec/lib/auth/discord_authenticator_spec.rb b/spec/lib/auth/discord_authenticator_spec.rb index 13ea3a44e0d..ab925bedc76 100644 --- a/spec/lib/auth/discord_authenticator_spec.rb +++ b/spec/lib/auth/discord_authenticator_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Auth::DiscordAuthenticator do +RSpec.describe Auth::DiscordAuthenticator do let(:hash) { OmniAuth::AuthHash.new( provider: "facebook", diff --git a/spec/lib/auth/facebook_authenticator_spec.rb b/spec/lib/auth/facebook_authenticator_spec.rb index 93a8778f39c..8237d3a67d0 100644 --- a/spec/lib/auth/facebook_authenticator_spec.rb +++ b/spec/lib/auth/facebook_authenticator_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Auth::FacebookAuthenticator do +RSpec.describe Auth::FacebookAuthenticator do let(:hash) { { provider: "facebook", diff --git a/spec/lib/auth/github_authenticator_spec.rb b/spec/lib/auth/github_authenticator_spec.rb index 33a9a7ac543..ce2dc264921 100644 --- a/spec/lib/auth/github_authenticator_spec.rb +++ b/spec/lib/auth/github_authenticator_spec.rb @@ -20,7 +20,7 @@ def auth_token_for(user) } end -describe Auth::GithubAuthenticator do +RSpec.describe Auth::GithubAuthenticator do let(:authenticator) { described_class.new } fab!(:user) { Fabricate(:user) } diff --git a/spec/lib/auth/google_oauth2_authenticator_spec.rb b/spec/lib/auth/google_oauth2_authenticator_spec.rb index 76ec7e9d76b..e00b51d40c0 100644 --- a/spec/lib/auth/google_oauth2_authenticator_spec.rb +++ b/spec/lib/auth/google_oauth2_authenticator_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Auth::GoogleOAuth2Authenticator do +RSpec.describe Auth::GoogleOAuth2Authenticator do it 'does not look up user unless email is verified' do # note, emails that come back from google via omniauth are always valid # this protects against future regressions diff --git a/spec/lib/auth/managed_authenticator_spec.rb b/spec/lib/auth/managed_authenticator_spec.rb index 8a7fbf1844c..e279ebf0486 100644 --- a/spec/lib/auth/managed_authenticator_spec.rb +++ b/spec/lib/auth/managed_authenticator_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Auth::ManagedAuthenticator do +RSpec.describe Auth::ManagedAuthenticator do let(:authenticator) { Class.new(described_class) do def name diff --git a/spec/lib/auth/omniauth_strategies/discourse_google_oauth2_spec.rb b/spec/lib/auth/omniauth_strategies/discourse_google_oauth2_spec.rb index d2ef65ceb4a..db4adc1c26b 100644 --- a/spec/lib/auth/omniauth_strategies/discourse_google_oauth2_spec.rb +++ b/spec/lib/auth/omniauth_strategies/discourse_google_oauth2_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Auth::OmniAuthStrategies::DiscourseGoogleOauth2 do +RSpec.describe Auth::OmniAuthStrategies::DiscourseGoogleOauth2 do let(:response_hash) do { email: 'user@domain.com', diff --git a/spec/lib/auth/result_spec.rb b/spec/lib/auth/result_spec.rb index f63e57b2d5d..2c9a83e0572 100644 --- a/spec/lib/auth/result_spec.rb +++ b/spec/lib/auth/result_spec.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -describe Auth::Result do +RSpec.describe Auth::Result do fab!(:initial_email) { "initialemail@example.org" } fab!(:initial_username) { "initialusername" } fab!(:initial_name) { "Initial Name" } diff --git a/spec/lib/auth/twitter_authenticator_spec.rb b/spec/lib/auth/twitter_authenticator_spec.rb index 3cf3fe861d4..0e2863c3f43 100644 --- a/spec/lib/auth/twitter_authenticator_spec.rb +++ b/spec/lib/auth/twitter_authenticator_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Auth::TwitterAuthenticator do +RSpec.describe Auth::TwitterAuthenticator do it "takes over account if email is supplied" do auth = Auth::TwitterAuthenticator.new diff --git a/spec/lib/backup_restore/backup_file_handler_multisite_spec.rb b/spec/lib/backup_restore/backup_file_handler_multisite_spec.rb index f5c6ac4717a..c7d44170936 100644 --- a/spec/lib/backup_restore/backup_file_handler_multisite_spec.rb +++ b/spec/lib/backup_restore/backup_file_handler_multisite_spec.rb @@ -2,7 +2,7 @@ require_relative "shared_context_for_backup_restore" -describe BackupRestore::BackupFileHandler, type: :multisite do +RSpec.describe BackupRestore::BackupFileHandler, type: :multisite do include_context "shared stuff" it "works with old backup file format" do diff --git a/spec/lib/backup_restore/backup_file_handler_spec.rb b/spec/lib/backup_restore/backup_file_handler_spec.rb index 1e0eaeeb58c..5b35a6c4ffe 100644 --- a/spec/lib/backup_restore/backup_file_handler_spec.rb +++ b/spec/lib/backup_restore/backup_file_handler_spec.rb @@ -2,7 +2,7 @@ require_relative 'shared_context_for_backup_restore' -describe BackupRestore::BackupFileHandler do +RSpec.describe BackupRestore::BackupFileHandler do include_context "shared stuff" it "works with current backup file format" do diff --git a/spec/lib/backup_restore/backuper_spec.rb b/spec/lib/backup_restore/backuper_spec.rb index affb41081ab..c66006d6313 100644 --- a/spec/lib/backup_restore/backuper_spec.rb +++ b/spec/lib/backup_restore/backuper_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe BackupRestore::Backuper do +RSpec.describe BackupRestore::Backuper do it 'returns a non-empty parameterized title when site title contains unicode' do SiteSetting.title = 'Ɣ' backuper = BackupRestore::Backuper.new(Discourse.system_user.id) diff --git a/spec/lib/backup_restore/database_restorer_multisite_spec.rb b/spec/lib/backup_restore/database_restorer_multisite_spec.rb index dea3029418f..ec3fc81954c 100644 --- a/spec/lib/backup_restore/database_restorer_multisite_spec.rb +++ b/spec/lib/backup_restore/database_restorer_multisite_spec.rb @@ -2,7 +2,7 @@ require_relative "shared_context_for_backup_restore" -describe BackupRestore::DatabaseRestorer, type: :multisite do +RSpec.describe BackupRestore::DatabaseRestorer, type: :multisite do include_context "shared stuff" let(:current_db) { RailsMultisite::ConnectionManagement.current_db } diff --git a/spec/lib/backup_restore/database_restorer_spec.rb b/spec/lib/backup_restore/database_restorer_spec.rb index 1655ec68eeb..1f2de1a8efd 100644 --- a/spec/lib/backup_restore/database_restorer_spec.rb +++ b/spec/lib/backup_restore/database_restorer_spec.rb @@ -2,7 +2,7 @@ require_relative 'shared_context_for_backup_restore' -describe BackupRestore::DatabaseRestorer do +RSpec.describe BackupRestore::DatabaseRestorer do include_context "shared stuff" let(:current_db) { RailsMultisite::ConnectionManagement.current_db } diff --git a/spec/lib/backup_restore/local_backup_store_spec.rb b/spec/lib/backup_restore/local_backup_store_spec.rb index 3d829ceab4e..faa01c4f165 100644 --- a/spec/lib/backup_restore/local_backup_store_spec.rb +++ b/spec/lib/backup_restore/local_backup_store_spec.rb @@ -3,7 +3,7 @@ require 'backup_restore/local_backup_store' require_relative 'shared_examples_for_backup_store' -describe BackupRestore::LocalBackupStore do +RSpec.describe BackupRestore::LocalBackupStore do before do @root_directory = Dir.mktmpdir @paths = [] diff --git a/spec/lib/backup_restore/meta_data_handler_spec.rb b/spec/lib/backup_restore/meta_data_handler_spec.rb index fb3229a2ab9..6ea18c48373 100644 --- a/spec/lib/backup_restore/meta_data_handler_spec.rb +++ b/spec/lib/backup_restore/meta_data_handler_spec.rb @@ -2,7 +2,7 @@ require_relative 'shared_context_for_backup_restore' -describe BackupRestore::MetaDataHandler do +RSpec.describe BackupRestore::MetaDataHandler do include_context "shared stuff" let!(:backup_filename) { 'discourse-2019-11-18-143242-v20191108000414.tar.gz' } diff --git a/spec/lib/backup_restore/s3_backup_store_spec.rb b/spec/lib/backup_restore/s3_backup_store_spec.rb index 4247001a0a1..dbe62f6c460 100644 --- a/spec/lib/backup_restore/s3_backup_store_spec.rb +++ b/spec/lib/backup_restore/s3_backup_store_spec.rb @@ -4,7 +4,7 @@ require 's3_helper' require 'backup_restore/s3_backup_store' require_relative 'shared_examples_for_backup_store' -describe BackupRestore::S3BackupStore do +RSpec.describe BackupRestore::S3BackupStore do before do @s3_client = Aws::S3::Client.new(stub_responses: true) @s3_options = { client: @s3_client } diff --git a/spec/lib/backup_restore/shared_context_for_backup_restore.rb b/spec/lib/backup_restore/shared_context_for_backup_restore.rb index 0fbc8ade158..66047d1bc38 100644 --- a/spec/lib/backup_restore/shared_context_for_backup_restore.rb +++ b/spec/lib/backup_restore/shared_context_for_backup_restore.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -shared_context "shared stuff" do +RSpec.shared_context "shared stuff" do let!(:logger) do Class.new do def log(message, ex = nil); end diff --git a/spec/lib/backup_restore/shared_examples_for_backup_store.rb b/spec/lib/backup_restore/shared_examples_for_backup_store.rb index 21f0a515bae..b65dadd9d88 100644 --- a/spec/lib/backup_restore/shared_examples_for_backup_store.rb +++ b/spec/lib/backup_restore/shared_examples_for_backup_store.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # rubocop:disable Discourse/OnlyTopLevelMultisiteSpecs -shared_context "backups" do +RSpec.shared_context "backups" do before { create_backups } after { remove_backups } @@ -15,7 +15,7 @@ shared_context "backups" do let(:backup5) { BackupFile.new(filename: "multi-2.tar.gz", size: 19, last_modified: Time.parse("2018-11-27T03:16:54Z")) } end -shared_examples "backup store" do +RSpec.shared_examples "backup store" do it "creates the correct backup store" do expect(store).to be_a(expected_type) end @@ -208,7 +208,7 @@ shared_examples "backup store" do end end -shared_examples "remote backup store" do +RSpec.shared_examples "remote backup store" do it "is a remote store" do expect(store.remote?).to eq(true) end diff --git a/spec/lib/backup_restore/system_interface_multisite_spec.rb b/spec/lib/backup_restore/system_interface_multisite_spec.rb index eeea97336ff..6587a716697 100644 --- a/spec/lib/backup_restore/system_interface_multisite_spec.rb +++ b/spec/lib/backup_restore/system_interface_multisite_spec.rb @@ -2,7 +2,7 @@ require_relative "shared_context_for_backup_restore" -describe BackupRestore::SystemInterface, type: :multisite do +RSpec.describe BackupRestore::SystemInterface, type: :multisite do include_context "shared stuff" subject { BackupRestore::SystemInterface.new(logger) } diff --git a/spec/lib/backup_restore/system_interface_spec.rb b/spec/lib/backup_restore/system_interface_spec.rb index edc7405c3c4..8c5c295c2f8 100644 --- a/spec/lib/backup_restore/system_interface_spec.rb +++ b/spec/lib/backup_restore/system_interface_spec.rb @@ -2,7 +2,7 @@ require_relative 'shared_context_for_backup_restore' -describe BackupRestore::SystemInterface do +RSpec.describe BackupRestore::SystemInterface do include_context "shared stuff" subject { BackupRestore::SystemInterface.new(logger) } diff --git a/spec/lib/backup_restore/uploads_restorer_spec.rb b/spec/lib/backup_restore/uploads_restorer_spec.rb index 02db3c50902..0b55fbeeba5 100644 --- a/spec/lib/backup_restore/uploads_restorer_spec.rb +++ b/spec/lib/backup_restore/uploads_restorer_spec.rb @@ -3,7 +3,7 @@ require_relative 'shared_context_for_backup_restore' -describe BackupRestore::UploadsRestorer do +RSpec.describe BackupRestore::UploadsRestorer do include_context "shared stuff" subject { BackupRestore::UploadsRestorer.new(logger) } diff --git a/spec/lib/browser_detection_spec.rb b/spec/lib/browser_detection_spec.rb index e0e5f695210..d0820bc511c 100644 --- a/spec/lib/browser_detection_spec.rb +++ b/spec/lib/browser_detection_spec.rb @@ -2,7 +2,7 @@ require 'browser_detection' -describe BrowserDetection do +RSpec.describe BrowserDetection do it "detects browser, device and operating system" do [ diff --git a/spec/lib/cache_spec.rb b/spec/lib/cache_spec.rb index 2a8d77a5ed4..19d79d81bae 100644 --- a/spec/lib/cache_spec.rb +++ b/spec/lib/cache_spec.rb @@ -2,7 +2,7 @@ require 'cache' -describe Cache do +RSpec.describe Cache do let :cache do Cache.new diff --git a/spec/lib/category_badge_spec.rb b/spec/lib/category_badge_spec.rb index 46d45c92915..c6d04cead2b 100644 --- a/spec/lib/category_badge_spec.rb +++ b/spec/lib/category_badge_spec.rb @@ -2,7 +2,7 @@ require 'category_badge' -describe CategoryBadge do +RSpec.describe CategoryBadge do it "escapes HTML in category names / descriptions" do c = Fabricate(:category, name: 'name', description: 'title') diff --git a/spec/lib/common_passwords/common_passwords_spec.rb b/spec/lib/common_passwords/common_passwords_spec.rb index cd0f9ab7b19..8d3ebf2499d 100644 --- a/spec/lib/common_passwords/common_passwords_spec.rb +++ b/spec/lib/common_passwords/common_passwords_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe CommonPasswords do +RSpec.describe CommonPasswords do it "the passwords file should exist" do expect(File.exist?(described_class::PASSWORD_FILE)).to eq(true) end diff --git a/spec/lib/composer_messages_finder_spec.rb b/spec/lib/composer_messages_finder_spec.rb index 735614bf740..e52ff3e73f3 100644 --- a/spec/lib/composer_messages_finder_spec.rb +++ b/spec/lib/composer_messages_finder_spec.rb @@ -3,7 +3,7 @@ require 'composer_messages_finder' -describe ComposerMessagesFinder do +RSpec.describe ComposerMessagesFinder do context "delegates work" do let(:user) { Fabricate.build(:user) } diff --git a/spec/lib/compression/engine_spec.rb b/spec/lib/compression/engine_spec.rb index a025eaf0431..913c5da0728 100644 --- a/spec/lib/compression/engine_spec.rb +++ b/spec/lib/compression/engine_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Compression::Engine do +RSpec.describe Compression::Engine do let(:available_size) { SiteSetting.decompressed_theme_max_file_size_mb } before do diff --git a/spec/lib/concern/cached_counting_spec.rb b/spec/lib/concern/cached_counting_spec.rb index 190fe105b09..44976a37374 100644 --- a/spec/lib/concern/cached_counting_spec.rb +++ b/spec/lib/concern/cached_counting_spec.rb @@ -14,7 +14,7 @@ class TestCachedCounting end end -describe CachedCounting do +RSpec.describe CachedCounting do it "should be default disabled in test" do expect(CachedCounting.enabled?).to eq(false) diff --git a/spec/lib/concern/category_hashtag_spec.rb b/spec/lib/concern/category_hashtag_spec.rb index 957c3c92f05..94bcb3f7d08 100644 --- a/spec/lib/concern/category_hashtag_spec.rb +++ b/spec/lib/concern/category_hashtag_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe CategoryHashtag do +RSpec.describe CategoryHashtag do describe '#query_from_hashtag_slug' do fab!(:parent_category) { Fabricate(:category) } fab!(:child_category) { Fabricate(:category, parent_category: parent_category) } diff --git a/spec/lib/concern/has_custom_fields_spec.rb b/spec/lib/concern/has_custom_fields_spec.rb index 0a8616bd3c4..698d82604cd 100644 --- a/spec/lib/concern/has_custom_fields_spec.rb +++ b/spec/lib/concern/has_custom_fields_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe HasCustomFields do +RSpec.describe HasCustomFields do context "custom_fields" do before do DB.exec("create temporary table custom_fields_test_items(id SERIAL primary key)") diff --git a/spec/lib/concern/has_search_data_spec.rb b/spec/lib/concern/has_search_data_spec.rb index 72795c3f6fb..e0a0583af1c 100644 --- a/spec/lib/concern/has_search_data_spec.rb +++ b/spec/lib/concern/has_search_data_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe HasSearchData do +RSpec.describe HasSearchData do context "belongs to its model" do before do DB.exec("create temporary table model_items(id SERIAL primary key)") diff --git a/spec/lib/concern/positionable_spec.rb b/spec/lib/concern/positionable_spec.rb index 76ca109ffa3..b491ab10902 100644 --- a/spec/lib/concern/positionable_spec.rb +++ b/spec/lib/concern/positionable_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Positionable do +RSpec.describe Positionable do def positions TestItem.order('position asc, id asc').pluck(:id) diff --git a/spec/lib/concern/searchable_spec.rb b/spec/lib/concern/searchable_spec.rb index 830ea311e41..75e3cafa08d 100644 --- a/spec/lib/concern/searchable_spec.rb +++ b/spec/lib/concern/searchable_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Searchable do +RSpec.describe Searchable do context "has search data" do before do DB.exec("create temporary table searchable_records(id SERIAL primary key)") diff --git a/spec/lib/content_buffer_spec.rb b/spec/lib/content_buffer_spec.rb index a6044210389..efc8ffe0053 100644 --- a/spec/lib/content_buffer_spec.rb +++ b/spec/lib/content_buffer_spec.rb @@ -2,7 +2,7 @@ require 'content_buffer' -describe ContentBuffer do +RSpec.describe ContentBuffer do it "handles deletion across lines properly" do c = ContentBuffer.new("a\nbc\nc") diff --git a/spec/lib/content_security_policy/builder_spec.rb b/spec/lib/content_security_policy/builder_spec.rb index 59e4bb505a9..fd0ad5ba103 100644 --- a/spec/lib/content_security_policy/builder_spec.rb +++ b/spec/lib/content_security_policy/builder_spec.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -describe ContentSecurityPolicy::Builder do +RSpec.describe ContentSecurityPolicy::Builder do let(:builder) { described_class.new(base_url: Discourse.base_url) } describe '#<<' do diff --git a/spec/lib/content_security_policy_spec.rb b/spec/lib/content_security_policy_spec.rb index bba9d45dc3e..504b2cdf3d9 100644 --- a/spec/lib/content_security_policy_spec.rb +++ b/spec/lib/content_security_policy_spec.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -describe ContentSecurityPolicy do +RSpec.describe ContentSecurityPolicy do after do DiscoursePluginRegistry.reset! end diff --git a/spec/lib/cooked_post_processor_spec.rb b/spec/lib/cooked_post_processor_spec.rb index 9f327dd9862..2dc678159c1 100644 --- a/spec/lib/cooked_post_processor_spec.rb +++ b/spec/lib/cooked_post_processor_spec.rb @@ -3,7 +3,7 @@ require "cooked_post_processor" require "file_store/s3_store" -describe CookedPostProcessor do +RSpec.describe CookedPostProcessor do fab!(:upload) { Fabricate(:upload) } let(:upload_path) { Discourse.store.upload_path } diff --git a/spec/lib/crawler_detection_spec.rb b/spec/lib/crawler_detection_spec.rb index 98a31fa8a53..905950a1e69 100644 --- a/spec/lib/crawler_detection_spec.rb +++ b/spec/lib/crawler_detection_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe CrawlerDetection do +RSpec.describe CrawlerDetection do def crawler!(user_agent, via = nil) if (!CrawlerDetection.crawler?(user_agent, via)) diff --git a/spec/lib/current_user_spec.rb b/spec/lib/current_user_spec.rb index 41beb1f0d61..73c27385cdd 100644 --- a/spec/lib/current_user_spec.rb +++ b/spec/lib/current_user_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe CurrentUser do +RSpec.describe CurrentUser do it "allows us to lookup a user from our environment" do user = Fabricate(:user, active: true) token = UserAuthToken.generate!(user_id: user.id) diff --git a/spec/lib/directory_helper_spec.rb b/spec/lib/directory_helper_spec.rb index cbbc79ec42d..dc5f1f64d45 100644 --- a/spec/lib/directory_helper_spec.rb +++ b/spec/lib/directory_helper_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe DirectoryHelper do +RSpec.describe DirectoryHelper do class DummyClass include DirectoryHelper end diff --git a/spec/lib/discourse_diff_spec.rb b/spec/lib/discourse_diff_spec.rb index 27596393aae..3413dab3e35 100644 --- a/spec/lib/discourse_diff_spec.rb +++ b/spec/lib/discourse_diff_spec.rb @@ -2,7 +2,7 @@ require 'discourse_diff' -describe DiscourseDiff do +RSpec.describe DiscourseDiff do describe "inline_html" do diff --git a/spec/lib/discourse_event_spec.rb b/spec/lib/discourse_event_spec.rb index ee7a0c73e9f..b3e49e5f96a 100644 --- a/spec/lib/discourse_event_spec.rb +++ b/spec/lib/discourse_event_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe DiscourseEvent do +RSpec.describe DiscourseEvent do describe "#events" do it "defaults to {}" do diff --git a/spec/lib/discourse_hub_spec.rb b/spec/lib/discourse_hub_spec.rb index e42cd4202c8..b80edb397bf 100644 --- a/spec/lib/discourse_hub_spec.rb +++ b/spec/lib/discourse_hub_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe DiscourseHub do +RSpec.describe DiscourseHub do describe '.discourse_version_check' do it 'should return just return the json that the hub returns' do hub_response = { 'success' => 'OK', 'latest_version' => '0.8.1', 'critical_updates' => false } diff --git a/spec/lib/discourse_js_processor_spec.rb b/spec/lib/discourse_js_processor_spec.rb index dd04584a3bc..4d48dc7a1c7 100644 --- a/spec/lib/discourse_js_processor_spec.rb +++ b/spec/lib/discourse_js_processor_spec.rb @@ -2,7 +2,7 @@ require 'discourse_js_processor' -describe DiscourseJsProcessor do +RSpec.describe DiscourseJsProcessor do describe 'should_transpile?' do it "returns false for empty strings" do diff --git a/spec/lib/discourse_plugin_registry_spec.rb b/spec/lib/discourse_plugin_registry_spec.rb index a212f9bc02e..78c8852670c 100644 --- a/spec/lib/discourse_plugin_registry_spec.rb +++ b/spec/lib/discourse_plugin_registry_spec.rb @@ -2,7 +2,7 @@ require 'discourse_plugin_registry' -describe DiscoursePluginRegistry do +RSpec.describe DiscoursePluginRegistry do class TestRegistry < DiscoursePluginRegistry; end diff --git a/spec/lib/discourse_redis_spec.rb b/spec/lib/discourse_redis_spec.rb index 215ba35738e..ba037580e7c 100644 --- a/spec/lib/discourse_redis_spec.rb +++ b/spec/lib/discourse_redis_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe DiscourseRedis do +RSpec.describe DiscourseRedis do it "ignore_readonly returns nil from a pure exception" do result = DiscourseRedis.ignore_readonly { raise Redis::CommandError.new("READONLY") } expect(result).to eq(nil) diff --git a/spec/lib/discourse_sourcemapping_url_processor_spec.rb b/spec/lib/discourse_sourcemapping_url_processor_spec.rb index 1c348c42ea7..6aad3809a86 100644 --- a/spec/lib/discourse_sourcemapping_url_processor_spec.rb +++ b/spec/lib/discourse_sourcemapping_url_processor_spec.rb @@ -2,7 +2,7 @@ require 'discourse_sourcemapping_url_processor' -describe DiscourseSourcemappingUrlProcessor do +RSpec.describe DiscourseSourcemappingUrlProcessor do def process(input) env = Sprockets::Environment.new env.context_class.class_eval do diff --git a/spec/lib/discourse_spec.rb b/spec/lib/discourse_spec.rb index 1438789a3eb..3d1401d0443 100644 --- a/spec/lib/discourse_spec.rb +++ b/spec/lib/discourse_spec.rb @@ -2,7 +2,7 @@ require 'discourse' -describe Discourse do +RSpec.describe Discourse do before do RailsMultisite::ConnectionManagement.stubs(:current_hostname).returns('foo.com') diff --git a/spec/lib/discourse_tagging_spec.rb b/spec/lib/discourse_tagging_spec.rb index 11b97e8ba1d..acf7f821fda 100644 --- a/spec/lib/discourse_tagging_spec.rb +++ b/spec/lib/discourse_tagging_spec.rb @@ -5,7 +5,7 @@ require 'discourse_tagging' # More tests are found in the category_tag_spec integration specs -describe DiscourseTagging do +RSpec.describe DiscourseTagging do fab!(:admin) { Fabricate(:admin) } fab!(:user) { Fabricate(:user) } diff --git a/spec/lib/discourse_updates_spec.rb b/spec/lib/discourse_updates_spec.rb index 59fb8b51bbb..140d7e33ca3 100644 --- a/spec/lib/discourse_updates_spec.rb +++ b/spec/lib/discourse_updates_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe DiscourseUpdates do +RSpec.describe DiscourseUpdates do def stub_data(latest, missing, critical, updated_at) DiscourseUpdates.latest_version = latest DiscourseUpdates.missing_versions_count = missing diff --git a/spec/lib/distributed_cache_spec.rb b/spec/lib/distributed_cache_spec.rb index 540dee32ceb..21ef2a3f51c 100644 --- a/spec/lib/distributed_cache_spec.rb +++ b/spec/lib/distributed_cache_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe "DistributedCache extensions" do +RSpec.describe "DistributedCache extensions" do let(:cache) { DistributedCache.new('mytest') } it "can defer_get_set" do diff --git a/spec/lib/distributed_memoizer_spec.rb b/spec/lib/distributed_memoizer_spec.rb index 256716aeccb..980a3a66783 100644 --- a/spec/lib/distributed_memoizer_spec.rb +++ b/spec/lib/distributed_memoizer_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe DistributedMemoizer do +RSpec.describe DistributedMemoizer do after do Discourse.redis.del(DistributedMemoizer.redis_key("hello")) Discourse.redis.del(DistributedMemoizer.redis_lock_key("hello")) diff --git a/spec/lib/distributed_mutex_spec.rb b/spec/lib/distributed_mutex_spec.rb index ec6db7f212a..aaa25161c73 100644 --- a/spec/lib/distributed_mutex_spec.rb +++ b/spec/lib/distributed_mutex_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe DistributedMutex do +RSpec.describe DistributedMutex do let(:key) { "test_mutex_key" } after do diff --git a/spec/lib/email/authentication_results_spec.rb b/spec/lib/email/authentication_results_spec.rb index 4a7b257a28d..3c32eb4dc2a 100644 --- a/spec/lib/email/authentication_results_spec.rb +++ b/spec/lib/email/authentication_results_spec.rb @@ -2,7 +2,7 @@ require "email/authentication_results" -describe Email::AuthenticationResults do +RSpec.describe Email::AuthenticationResults do describe "#results" do it "parses 'Nearly Trivial Case: Service Provided, but No Authentication Done' correctly" do # https://tools.ietf.org/html/rfc8601#appendix-B.2 diff --git a/spec/lib/email/cleaner_spec.rb b/spec/lib/email/cleaner_spec.rb index ad9e1a71d28..b4ae09403d1 100644 --- a/spec/lib/email/cleaner_spec.rb +++ b/spec/lib/email/cleaner_spec.rb @@ -2,7 +2,7 @@ require "email/receiver" -describe Email::Cleaner do +RSpec.describe Email::Cleaner do it 'removes attachments from raw message' do email = email(:attached_txt_file) diff --git a/spec/lib/email/email_spec.rb b/spec/lib/email/email_spec.rb index 084337a2a3f..46f8cd77f94 100644 --- a/spec/lib/email/email_spec.rb +++ b/spec/lib/email/email_spec.rb @@ -2,7 +2,7 @@ require 'email' -describe Email do +RSpec.describe Email do describe "is_valid?" do diff --git a/spec/lib/email/message_builder_spec.rb b/spec/lib/email/message_builder_spec.rb index 27a16d3f88e..0f0c795a196 100644 --- a/spec/lib/email/message_builder_spec.rb +++ b/spec/lib/email/message_builder_spec.rb @@ -2,7 +2,7 @@ require 'email/message_builder' -describe Email::MessageBuilder do +RSpec.describe Email::MessageBuilder do let(:to_address) { "jake@adventuretime.ooo" } let(:subject) { "Tree Trunks has made some apple pie!" } diff --git a/spec/lib/email/processor_spec.rb b/spec/lib/email/processor_spec.rb index 931aff5b11c..c0a52ffd1bd 100644 --- a/spec/lib/email/processor_spec.rb +++ b/spec/lib/email/processor_spec.rb @@ -2,7 +2,7 @@ require "email/processor" -describe Email::Processor do +RSpec.describe Email::Processor do after do Discourse.redis.flushdb end diff --git a/spec/lib/email/receiver_spec.rb b/spec/lib/email/receiver_spec.rb index 2a12c0d1a1c..de77d2acd1f 100644 --- a/spec/lib/email/receiver_spec.rb +++ b/spec/lib/email/receiver_spec.rb @@ -2,7 +2,7 @@ require "email/receiver" -describe Email::Receiver do +RSpec.describe Email::Receiver do before do SiteSetting.email_in = true diff --git a/spec/lib/email/renderer_spec.rb b/spec/lib/email/renderer_spec.rb index 78df067afd0..8e741154866 100644 --- a/spec/lib/email/renderer_spec.rb +++ b/spec/lib/email/renderer_spec.rb @@ -2,7 +2,7 @@ require 'email/renderer' -describe Email::Renderer do +RSpec.describe Email::Renderer do let(:message) do mail = Mail.new diff --git a/spec/lib/email/sender_spec.rb b/spec/lib/email/sender_spec.rb index 1dea67595f3..92c29a9423d 100644 --- a/spec/lib/email/sender_spec.rb +++ b/spec/lib/email/sender_spec.rb @@ -2,7 +2,7 @@ require 'email/sender' -describe Email::Sender do +RSpec.describe Email::Sender do before do SiteSetting.secure_media_allow_embed_images_in_emails = false end diff --git a/spec/lib/email/styles_spec.rb b/spec/lib/email/styles_spec.rb index 115ca404ef7..a150ea81765 100644 --- a/spec/lib/email/styles_spec.rb +++ b/spec/lib/email/styles_spec.rb @@ -2,7 +2,7 @@ require 'email' -describe Email::Styles do +RSpec.describe Email::Styles do let(:attachments) { {} } def basic_fragment(html) diff --git a/spec/lib/email_cook_spec.rb b/spec/lib/email_cook_spec.rb index 128a23502bd..19ac9c4f38b 100644 --- a/spec/lib/email_cook_spec.rb +++ b/spec/lib/email_cook_spec.rb @@ -3,7 +3,7 @@ require 'email_cook' require 'pretty_text' -describe EmailCook do +RSpec.describe EmailCook do it "uses to PrettyText when there is no [plaintext] in raw" do raw = "**Hello world!**" expect(cook(raw)).to eq(PrettyText.cook(raw)) diff --git a/spec/lib/email_updater_spec.rb b/spec/lib/email_updater_spec.rb index a407383802b..7416fd9127f 100644 --- a/spec/lib/email_updater_spec.rb +++ b/spec/lib/email_updater_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe EmailUpdater do +RSpec.describe EmailUpdater do let(:old_email) { 'old.email@example.com' } let(:new_email) { 'new.email@example.com' } diff --git a/spec/lib/encodings_spec.rb b/spec/lib/encodings_spec.rb index 5853e33a0c9..be94d5a8e12 100644 --- a/spec/lib/encodings_spec.rb +++ b/spec/lib/encodings_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Encodings do +RSpec.describe Encodings do def to_utf8(filename) string = File.read("#{Rails.root}/spec/fixtures/encodings/#{filename}").chomp Encodings.to_utf8(string) diff --git a/spec/lib/enum_spec.rb b/spec/lib/enum_spec.rb index c99450daea4..99db4f17034 100644 --- a/spec/lib/enum_spec.rb +++ b/spec/lib/enum_spec.rb @@ -2,7 +2,7 @@ require 'email' -describe Enum do +RSpec.describe Enum do let(:array_enum) { Enum.new(:jake, :finn, :princess_bubblegum, :peppermint_butler) } let(:hash_enum) { Enum.new(jake: 1, finn: 2, princess_bubblegum: 3, peppermint_butler: 4) } diff --git a/spec/lib/excerpt_parser_spec.rb b/spec/lib/excerpt_parser_spec.rb index d1b032c7f55..5e4d57c2933 100644 --- a/spec/lib/excerpt_parser_spec.rb +++ b/spec/lib/excerpt_parser_spec.rb @@ -2,7 +2,7 @@ require "excerpt_parser" -describe ExcerptParser do +RSpec.describe ExcerptParser do it "handles nested
blocks" do html = <<~HTML.strip diff --git a/spec/lib/feed_element_installer_spec.rb b/spec/lib/feed_element_installer_spec.rb index 4ca30dbeb85..4e327d41d00 100644 --- a/spec/lib/feed_element_installer_spec.rb +++ b/spec/lib/feed_element_installer_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'feed_element_installer' -describe FeedElementInstaller do +RSpec.describe FeedElementInstaller do describe '#install_rss_element' do let(:raw_feed) { file_from_fixtures('feed.rss', 'feed').read } diff --git a/spec/lib/feed_item_accessor_spec.rb b/spec/lib/feed_item_accessor_spec.rb index 30293f0e83b..c86baacecc6 100644 --- a/spec/lib/feed_item_accessor_spec.rb +++ b/spec/lib/feed_item_accessor_spec.rb @@ -2,7 +2,7 @@ require 'rss' require 'feed_item_accessor' -describe FeedItemAccessor do +RSpec.describe FeedItemAccessor do context 'for ATOM feed' do let(:atom_feed) { RSS::Parser.parse(file_from_fixtures('feed.atom', 'feed'), false) } let(:atom_feed_item) { atom_feed.items.first } diff --git a/spec/lib/file_helper_spec.rb b/spec/lib/file_helper_spec.rb index 54c2233a3a8..e8bc0c3ef56 100644 --- a/spec/lib/file_helper_spec.rb +++ b/spec/lib/file_helper_spec.rb @@ -2,7 +2,7 @@ require 'file_helper' -describe FileHelper do +RSpec.describe FileHelper do let(:url) { "https://eviltrout.com/trout.png" } let(:png) { File.read("#{Rails.root}/spec/fixtures/images/cropped.png") } diff --git a/spec/lib/file_store/local_store_spec.rb b/spec/lib/file_store/local_store_spec.rb index 7a0fb175188..0ed98ef01e6 100644 --- a/spec/lib/file_store/local_store_spec.rb +++ b/spec/lib/file_store/local_store_spec.rb @@ -2,7 +2,7 @@ require 'file_store/local_store' -describe FileStore::LocalStore do +RSpec.describe FileStore::LocalStore do let(:store) { FileStore::LocalStore.new } diff --git a/spec/lib/file_store/s3_store_spec.rb b/spec/lib/file_store/s3_store_spec.rb index 346ad440006..bfebbe75316 100644 --- a/spec/lib/file_store/s3_store_spec.rb +++ b/spec/lib/file_store/s3_store_spec.rb @@ -3,7 +3,7 @@ require 'file_store/s3_store' require 'file_store/local_store' -describe FileStore::S3Store do +RSpec.describe FileStore::S3Store do let(:store) { FileStore::S3Store.new } let(:s3_helper) { store.s3_helper } let(:client) { Aws::S3::Client.new(stub_responses: true) } diff --git a/spec/lib/filter_best_posts_spec.rb b/spec/lib/filter_best_posts_spec.rb index a536b6cce0b..91aeddd55aa 100644 --- a/spec/lib/filter_best_posts_spec.rb +++ b/spec/lib/filter_best_posts_spec.rb @@ -3,7 +3,7 @@ require 'filter_best_posts' require 'topic_view' -describe FilterBestPosts do +RSpec.describe FilterBestPosts do fab!(:topic) { Fabricate(:topic) } fab!(:coding_horror) { Fabricate(:coding_horror) } diff --git a/spec/lib/final_destination_spec.rb b/spec/lib/final_destination_spec.rb index 1e44823709b..2782f7b894e 100644 --- a/spec/lib/final_destination_spec.rb +++ b/spec/lib/final_destination_spec.rb @@ -2,7 +2,7 @@ require 'final_destination' -describe FinalDestination do +RSpec.describe FinalDestination do let(:opts) do { diff --git a/spec/lib/freedom_patches/mail_disable_starttls_spec.rb b/spec/lib/freedom_patches/mail_disable_starttls_spec.rb index 454c0372556..86aa6b87bd8 100644 --- a/spec/lib/freedom_patches/mail_disable_starttls_spec.rb +++ b/spec/lib/freedom_patches/mail_disable_starttls_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe FreedomPatches::MailDisableStarttls do +RSpec.describe FreedomPatches::MailDisableStarttls do subject(:smtp_session) { smtp.build_smtp_session } let(:smtp) { Mail::SMTP.new(options) } @@ -9,7 +9,7 @@ describe FreedomPatches::MailDisableStarttls do let(:options) { {} } it "doesn't disable starttls" do - expect(smtp_session).to be_starttls + expect(smtp_session.starttls?).to eq(:auto) end end @@ -17,7 +17,7 @@ describe FreedomPatches::MailDisableStarttls do let(:options) { { enable_starttls_auto: false } } it "properly disables starttls" do - expect(smtp_session).not_to be_starttls + expect(smtp_session.starttls?).to eq(false) end end end diff --git a/spec/lib/freedom_patches/safe_buffer_spec.rb b/spec/lib/freedom_patches/safe_buffer_spec.rb index 0ddc769268b..6e6542889bd 100644 --- a/spec/lib/freedom_patches/safe_buffer_spec.rb +++ b/spec/lib/freedom_patches/safe_buffer_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe ActiveSupport::SafeBuffer do +RSpec.describe ActiveSupport::SafeBuffer do it "can cope with encoding weirdness" do buffer = ActiveSupport::SafeBuffer.new buffer << (+"\330").force_encoding("ASCII-8BIT") diff --git a/spec/lib/freedom_patches/schema_migration_details_spec.rb b/spec/lib/freedom_patches/schema_migration_details_spec.rb index 5812e865516..8a8317d7033 100644 --- a/spec/lib/freedom_patches/schema_migration_details_spec.rb +++ b/spec/lib/freedom_patches/schema_migration_details_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe FreedomPatches::SchemaMigrationDetails do +RSpec.describe FreedomPatches::SchemaMigrationDetails do # we usually don't really need this model so lets not clutter up with it class SchemaMigrationDetail < ActiveRecord::Base diff --git a/spec/lib/freedom_patches/seed_fu_spec.rb b/spec/lib/freedom_patches/seed_fu_spec.rb index 80fd3e79f60..12ba1dd745f 100644 --- a/spec/lib/freedom_patches/seed_fu_spec.rb +++ b/spec/lib/freedom_patches/seed_fu_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe "seed-fu patch" do +RSpec.describe "seed-fu patch" do it "does not modify a sequence on an existing table" do u = User.create!(username: "test1", email: "test1@example.com") uid1 = u.id diff --git a/spec/lib/freedom_patches/translate_accelerator_spec.rb b/spec/lib/freedom_patches/translate_accelerator_spec.rb index f6c67c7878f..4903b066af4 100644 --- a/spec/lib/freedom_patches/translate_accelerator_spec.rb +++ b/spec/lib/freedom_patches/translate_accelerator_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe "translate accelerator" do +RSpec.describe "translate accelerator" do before do @original_i18n_load_path = I18n.load_path.dup I18n.load_path += Dir["#{Rails.root}/spec/fixtures/i18n/translate_accelerator.*.yml"] diff --git a/spec/lib/gaps_spec.rb b/spec/lib/gaps_spec.rb index cf270d7f47d..9cd2cbfb7fe 100644 --- a/spec/lib/gaps_spec.rb +++ b/spec/lib/gaps_spec.rb @@ -2,7 +2,7 @@ require 'cache' -describe Gaps do +RSpec.describe Gaps do it 'returns no gaps for empty data' do expect(Gaps.new(nil, nil)).to be_blank diff --git a/spec/lib/global_path_spec.rb b/spec/lib/global_path_spec.rb index 9d3f24461ff..40c063817e7 100644 --- a/spec/lib/global_path_spec.rb +++ b/spec/lib/global_path_spec.rb @@ -6,7 +6,7 @@ class GlobalPathInstance extend GlobalPath end -describe GlobalPath do +RSpec.describe GlobalPath do context 'cdn_relative_path' do def cdn_relative_path(p) diff --git a/spec/lib/group_email_credentials_check_spec.rb b/spec/lib/group_email_credentials_check_spec.rb index 4952a94c1c4..074b5402850 100644 --- a/spec/lib/group_email_credentials_check_spec.rb +++ b/spec/lib/group_email_credentials_check_spec.rb @@ -3,7 +3,7 @@ require 'net/smtp' require 'net/imap' -describe GroupEmailCredentialsCheck do +RSpec.describe GroupEmailCredentialsCheck do fab!(:group1) { Fabricate(:group) } fab!(:group2) { Fabricate(:smtp_group) } fab!(:group3) { Fabricate(:imap_group) } diff --git a/spec/lib/guardian/topic_guardian_spec.rb b/spec/lib/guardian/topic_guardian_spec.rb index 538928ea464..24ef2e03322 100644 --- a/spec/lib/guardian/topic_guardian_spec.rb +++ b/spec/lib/guardian/topic_guardian_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe TopicGuardian do +RSpec.describe TopicGuardian do fab!(:admin) { Fabricate(:admin) } fab!(:tl3_user) { Fabricate(:leader) } fab!(:moderator) { Fabricate(:moderator) } diff --git a/spec/lib/guardian/user_guardian_spec.rb b/spec/lib/guardian/user_guardian_spec.rb index 70ef35f2891..9015e8d554a 100644 --- a/spec/lib/guardian/user_guardian_spec.rb +++ b/spec/lib/guardian/user_guardian_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe UserGuardian do +RSpec.describe UserGuardian do let :user do Fabricate(:user) diff --git a/spec/lib/guardian_spec.rb b/spec/lib/guardian_spec.rb index 2d0a3ef6274..833a19e80ca 100644 --- a/spec/lib/guardian_spec.rb +++ b/spec/lib/guardian_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Guardian do +RSpec.describe Guardian do fab!(:user) { Fabricate(:user) } fab!(:another_user) { Fabricate(:user) } diff --git a/spec/lib/has_errors_spec.rb b/spec/lib/has_errors_spec.rb index 1e0b63b813c..436039706cb 100644 --- a/spec/lib/has_errors_spec.rb +++ b/spec/lib/has_errors_spec.rb @@ -2,7 +2,7 @@ require 'has_errors' -describe HasErrors do +RSpec.describe HasErrors do class ErrorTestClass include HasErrors diff --git a/spec/lib/highlight_js/highlight_js_spec.rb b/spec/lib/highlight_js/highlight_js_spec.rb index 8c8da79a7f2..d3fd7058866 100644 --- a/spec/lib/highlight_js/highlight_js_spec.rb +++ b/spec/lib/highlight_js/highlight_js_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe HighlightJs do +RSpec.describe HighlightJs do it 'can list languages' do expect(HighlightJs.languages).to include('thrift') end diff --git a/spec/lib/hijack_spec.rb b/spec/lib/hijack_spec.rb index beb8b8622ab..c05985f1052 100644 --- a/spec/lib/hijack_spec.rb +++ b/spec/lib/hijack_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Hijack do +RSpec.describe Hijack do class Hijack::Tester < ApplicationController attr_reader :io diff --git a/spec/lib/html_prettify_spec.rb b/spec/lib/html_prettify_spec.rb index bea24b271b8..e9bd6c51380 100644 --- a/spec/lib/html_prettify_spec.rb +++ b/spec/lib/html_prettify_spec.rb @@ -2,7 +2,7 @@ require 'html_prettify' -describe HtmlPrettify do +RSpec.describe HtmlPrettify do def t(source, expected) expect(HtmlPrettify.render(source)).to eq(expected) diff --git a/spec/lib/html_to_markdown_spec.rb b/spec/lib/html_to_markdown_spec.rb index 23ac121c88c..06666880770 100644 --- a/spec/lib/html_to_markdown_spec.rb +++ b/spec/lib/html_to_markdown_spec.rb @@ -2,7 +2,7 @@ require 'html_to_markdown' -describe HtmlToMarkdown do +RSpec.describe HtmlToMarkdown do def html_to_markdown(html, opts = {}) HtmlToMarkdown.new(html, opts).to_markdown diff --git a/spec/lib/i18n/discourse_i18n_spec.rb b/spec/lib/i18n/discourse_i18n_spec.rb index 001c4aadb9e..3015edce55d 100644 --- a/spec/lib/i18n/discourse_i18n_spec.rb +++ b/spec/lib/i18n/discourse_i18n_spec.rb @@ -3,7 +3,7 @@ require 'i18n/backend/discourse_i18n' require 'translation_override' -describe I18n::Backend::DiscourseI18n do +RSpec.describe I18n::Backend::DiscourseI18n do let(:backend) { I18n::Backend::DiscourseI18n.new } diff --git a/spec/lib/i18n/fallback_locale_list_spec.rb b/spec/lib/i18n/fallback_locale_list_spec.rb index 4951d7761b7..900bf370252 100644 --- a/spec/lib/i18n/fallback_locale_list_spec.rb +++ b/spec/lib/i18n/fallback_locale_list_spec.rb @@ -2,7 +2,7 @@ require 'i18n/backend/fallback_locale_list' -describe I18n::Backend::FallbackLocaleList do +RSpec.describe I18n::Backend::FallbackLocaleList do let(:list) { I18n::Backend::FallbackLocaleList.new } it "works when default_locale is English" do diff --git a/spec/lib/image_sizer_spec.rb b/spec/lib/image_sizer_spec.rb index cd378a25318..483177d32f2 100644 --- a/spec/lib/image_sizer_spec.rb +++ b/spec/lib/image_sizer_spec.rb @@ -2,7 +2,7 @@ require 'image_sizer' -describe ImageSizer do +RSpec.describe ImageSizer do before do SiteSetting.max_image_width = 500 diff --git a/spec/lib/imap/sync_spec.rb b/spec/lib/imap/sync_spec.rb index d5ff2d02457..d7f66fd0522 100644 --- a/spec/lib/imap/sync_spec.rb +++ b/spec/lib/imap/sync_spec.rb @@ -2,7 +2,7 @@ require 'imap/sync' -describe Imap::Sync do +RSpec.describe Imap::Sync do before do SiteSetting.tagging_enabled = true diff --git a/spec/lib/import/normalize_spec.rb b/spec/lib/import/normalize_spec.rb index 724e7ae3177..77b483fa580 100644 --- a/spec/lib/import/normalize_spec.rb +++ b/spec/lib/import/normalize_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Import::Normalize do +RSpec.describe Import::Normalize do describe "#normalize_code_blocks" do it "normalizes 2 code blocks correctly" do markdown = < "http://test.com", diff --git a/spec/lib/migration/safe_migrate_spec.rb b/spec/lib/migration/safe_migrate_spec.rb index 5ab63616c5b..a0c8e736cda 100644 --- a/spec/lib/migration/safe_migrate_spec.rb +++ b/spec/lib/migration/safe_migrate_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Migration::SafeMigrate do +RSpec.describe Migration::SafeMigrate do before do Migration::SafeMigrate::SafeMigration.disable_safe! end diff --git a/spec/lib/migration/table_dropper_spec.rb b/spec/lib/migration/table_dropper_spec.rb index dc5397e141b..535e67388a0 100644 --- a/spec/lib/migration/table_dropper_spec.rb +++ b/spec/lib/migration/table_dropper_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Migration::TableDropper do +RSpec.describe Migration::TableDropper do def table_exists?(table_name) DB.exec(<<~SQL) > 0 diff --git a/spec/lib/mini_sql_multisite_connection_spec.rb b/spec/lib/mini_sql_multisite_connection_spec.rb index 6072593ded9..2a30ac161bd 100644 --- a/spec/lib/mini_sql_multisite_connection_spec.rb +++ b/spec/lib/mini_sql_multisite_connection_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe MiniSqlMultisiteConnection do +RSpec.describe MiniSqlMultisiteConnection do describe "after_commit" do it "works for 'fake' (joinable) transactions" do diff --git a/spec/lib/mobile_detection_spec.rb b/spec/lib/mobile_detection_spec.rb index e1b8ac2ce1e..5267383150d 100644 --- a/spec/lib/mobile_detection_spec.rb +++ b/spec/lib/mobile_detection_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe MobileDetection do +RSpec.describe MobileDetection do let :old_user_agents do (<<~STR).split("\n") Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; LG-L160L Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 diff --git a/spec/lib/new_post_manager_spec.rb b/spec/lib/new_post_manager_spec.rb index 1fd2785cce8..4241ab72b5f 100644 --- a/spec/lib/new_post_manager_spec.rb +++ b/spec/lib/new_post_manager_spec.rb @@ -2,7 +2,7 @@ require 'new_post_manager' -describe NewPostManager do +RSpec.describe NewPostManager do fab!(:user) { Fabricate(:user) } fab!(:topic) { Fabricate(:topic) } diff --git a/spec/lib/new_post_result_spec.rb b/spec/lib/new_post_result_spec.rb index ad1f94f918f..9e8b2335b5f 100644 --- a/spec/lib/new_post_result_spec.rb +++ b/spec/lib/new_post_result_spec.rb @@ -2,7 +2,7 @@ require 'new_post_result' -describe NewPostResult do +RSpec.describe NewPostResult do it "fails by default" do result = NewPostResult.new(:eviltrout) diff --git a/spec/lib/onebox/domain_checker_spec.rb b/spec/lib/onebox/domain_checker_spec.rb index aa4bd04338d..de3d71050a4 100644 --- a/spec/lib/onebox/domain_checker_spec.rb +++ b/spec/lib/onebox/domain_checker_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Onebox::DomainChecker do +RSpec.describe Onebox::DomainChecker do describe '.is_blocked?' do before do SiteSetting.blocked_onebox_domains = "api.cat.org|kitten.cloud" diff --git a/spec/lib/onebox/engine/allowlisted_generic_onebox_spec.rb b/spec/lib/onebox/engine/allowlisted_generic_onebox_spec.rb index e4dd0e905d1..23c17334913 100644 --- a/spec/lib/onebox/engine/allowlisted_generic_onebox_spec.rb +++ b/spec/lib/onebox/engine/allowlisted_generic_onebox_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Onebox::Engine::AllowlistedGenericOnebox do +RSpec.describe Onebox::Engine::AllowlistedGenericOnebox do describe ".===" do it "matches any domain" do expect(described_class === URI('http://foo.bar/resource')).to be(true) diff --git a/spec/lib/onebox/engine/amazon_onebox_spec.rb b/spec/lib/onebox/engine/amazon_onebox_spec.rb index a4a7800334e..f9be9bc6965 100644 --- a/spec/lib/onebox/engine/amazon_onebox_spec.rb +++ b/spec/lib/onebox/engine/amazon_onebox_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Onebox::Engine::AmazonOnebox do +RSpec.describe Onebox::Engine::AmazonOnebox do context "regular amazon page" do before do @link = "https://www.amazon.com/Knit-Noro-Accessories-Colorful-Little/dp/193609620X" diff --git a/spec/lib/onebox/engine/animated_image_onebox_spec.rb b/spec/lib/onebox/engine/animated_image_onebox_spec.rb index 49796b91fe4..049ce7e793f 100644 --- a/spec/lib/onebox/engine/animated_image_onebox_spec.rb +++ b/spec/lib/onebox/engine/animated_image_onebox_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Onebox::Engine::AnimatedImageOnebox do +RSpec.describe Onebox::Engine::AnimatedImageOnebox do let(:giphy) { "http://gph.is/15bRbWf" } let(:direct_gif) { "https://media4.giphy.com/media/Zatyu5LBO2zCyhiAAs/giphy.gif" } let(:tenor) { "https://tenor.com/bb3fQ.gif" } diff --git a/spec/lib/onebox/engine/audio_onebox_spec.rb b/spec/lib/onebox/engine/audio_onebox_spec.rb index a7054f908df..cf3a3a9257e 100644 --- a/spec/lib/onebox/engine/audio_onebox_spec.rb +++ b/spec/lib/onebox/engine/audio_onebox_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe Onebox::Engine::AudioOnebox do +RSpec.describe Onebox::Engine::AudioOnebox do it "supports ogg" do expect(Onebox.preview('http://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg').to_s).to match(/