A platform for community discussion. Free, open, simple.
DEV: Remove extraneous spec code (#29386)
Jarek Radosz587264f9d2bd
diff --git a/plugins/automation/spec/system/admin_plugins_list_spec.rb b/plugins/automation/spec/system/admin_plugins_list_spec.rbindex b84397e965f..9dc0e1beee6 100644--- a/plugins/automation/spec/system/admin_plugins_list_spec.rb+++ b/plugins/automation/spec/system/admin_plugins_list_spec.rb@@ -2,7 +2,7 @@# NOTE: This spec covers core functionality, but it is much easier# to test plugin related things inside an actual plugin.-describe "Admin Plugins List", type: :system, js: true do+describe "Admin Plugins List", type: :system dofab!(:current_user) { Fabricate(:admin) }let(:admin_plugins_list_page) { PageObjects::Pages::AdminPluginsList.new }diff --git a/plugins/automation/spec/system/error_spec.rb b/plugins/automation/spec/system/error_spec.rbindex 515be7339eb..8b4532b919c 100644--- a/plugins/automation/spec/system/error_spec.rb+++ b/plugins/automation/spec/system/error_spec.rb@@ -1,6 +1,6 @@# frozen_string_literal: true-describe "DiscourseAutomation | error", type: :system, js: true do+describe "DiscourseAutomation | error", type: :system dofab!(:admin)before dodiff --git a/plugins/automation/spec/system/new_automation_spec.rb b/plugins/automation/spec/system/new_automation_spec.rbindex a4602aa2659..4139524d29f 100644--- a/plugins/automation/spec/system/new_automation_spec.rb+++ b/plugins/automation/spec/system/new_automation_spec.rb@@ -1,6 +1,6 @@# frozen_string_literal: true-describe "DiscourseAutomation | New automation", type: :system, js: true do+describe "DiscourseAutomation | New automation", type: :system dofab!(:admin)before dodiff --git a/plugins/automation/spec/system/smoke_test_spec.rb b/plugins/automation/spec/system/smoke_test_spec.rbindex 4847510d66a..b47a2b23b25 100644--- a/plugins/automation/spec/system/smoke_test_spec.rb+++ b/plugins/automation/spec/system/smoke_test_spec.rb@@ -1,6 +1,6 @@# frozen_string_literal: true-describe "DiscourseAutomation | smoke test", type: :system, js: true do+describe "DiscourseAutomation | smoke test", type: :system dofab!(:admin)fab!(:group) { Fabricate(:group, name: "test") }fab!(:badge) { Fabricate(:badge, name: "badge") }diff --git a/spec/lib/backup_restore/shared_examples_for_backup_store.rb b/spec/lib/backup_restore/shared_examples_for_backup_store.rbindex f9338d9e340..3c43e8e8c1f 100644--- a/spec/lib/backup_restore/shared_examples_for_backup_store.rb+++ b/spec/lib/backup_restore/shared_examples_for_backup_store.rb@@ -287,7 +287,7 @@ RSpec.shared_examples "remote backup store" dodef upload_file# time has fidelity issues freeze a time that is not going to be prone# to that- freeze_time(Time.now.to_s)+ freeze_time(Time.now.round)backup = BackupFile.new(filename: "foo.tar.gz", size: 33, last_modified: Time.zone.now)diff --git a/spec/models/post_action_spec.rb b/spec/models/post_action_spec.rbindex 5fe17cf5310..bd554e4e942 100644--- a/spec/models/post_action_spec.rb+++ b/spec/models/post_action_spec.rb@@ -432,7 +432,7 @@ RSpec.describe PostAction doendit "shouldn't change given_likes unless likes are given or removed" do- freeze_time(Time.zone.now)+ freeze_timePostActionCreator.like(codinghorror, post)expect(value_for(codinghorror.id, Date.today)).to eq(1)diff --git a/spec/models/topic_user_spec.rb b/spec/models/topic_user_spec.rbindex 640ef48d52f..93ba9870862 100644--- a/spec/models/topic_user_spec.rb+++ b/spec/models/topic_user_spec.rb@@ -236,7 +236,7 @@ RSpec.describe TopicUser doit "should update the record for repeat visit" dotoday = Time.zone.now- freeze_time Time.zone.now+ freeze_time today# ensure data model is correct for the test# logging an update to a row that does not existdiff --git a/spec/models/user_avatar_spec.rb b/spec/models/user_avatar_spec.rbindex 564009c8f93..56d4e7ae287 100644--- a/spec/models/user_avatar_spec.rb+++ b/spec/models/user_avatar_spec.rb@@ -24,7 +24,7 @@ RSpec.describe UserAvatar doafter { temp.unlink }it "can update gravatars" do- freeze_time Time.now+ freeze_timeexpect { avatar.update_gravatar! }.to change { Upload.count }.by(1)expect(avatar.gravatar_upload).to eq(Upload.last)@@ -76,7 +76,7 @@ RSpec.describe UserAvatar dodescribe "when failing" doit "always update 'last_gravatar_download_attempt'" do- freeze_time Time.now+ freeze_timeFileHelper.expects(:download).raises(SocketError)@@ -91,7 +91,7 @@ RSpec.describe UserAvatar dodescribe "404 should be silent, nothing to do really" doit "does nothing when avatar is 404" doSecureRandom.stubs(:urlsafe_base64).returns("5555")- freeze_time Time.now+ freeze_timestub_request(:get,diff --git a/spec/requests/users_controller_spec.rb b/spec/requests/users_controller_spec.rbindex cb0a20ea72c..d1153df207f 100644--- a/spec/requests/users_controller_spec.rb+++ b/spec/requests/users_controller_spec.rb@@ -3904,7 +3904,7 @@ RSpec.describe UsersController docontext "when expiring_at param is set" doit "changes notification level to ignore" do- freeze_time(Time.now) do+ freeze_time doexpiring_at = 3.days.from_nowput "/u/#{another_user.username}/notification_level.json",params: {diff --git a/spec/services/user/silence_spec.rb b/spec/services/user/silence_spec.rbindex 10047ba9fba..102255650d0 100644--- a/spec/services/user/silence_spec.rb+++ b/spec/services/user/silence_spec.rb@@ -1,7 +1,5 @@# frozen_string_literal: true-require "rails_helper"-RSpec.describe User::Silence dodescribe described_class::Contract, type: :model doit { is_expected.to validate_presence_of(:user_id) }diff --git a/spec/services/user/suspend_spec.rb b/spec/services/user/suspend_spec.rbindex aacd924c4e2..8b823f7bf41 100644--- a/spec/services/user/suspend_spec.rb+++ b/spec/services/user/suspend_spec.rb@@ -1,7 +1,5 @@# frozen_string_literal: true-require "rails_helper"-RSpec.describe User::Suspend dodescribe described_class::Contract, type: :model doit { is_expected.to validate_presence_of(:user_id) }diff --git a/spec/system/admin_user_fields_spec.rb b/spec/system/admin_user_fields_spec.rbindex b8b14fb869c..ad0a423caf4 100644--- a/spec/system/admin_user_fields_spec.rb+++ b/spec/system/admin_user_fields_spec.rb@@ -1,6 +1,6 @@# frozen_string_literal: true-describe "Admin User Fields", type: :system, js: true do+describe "Admin User Fields", type: :system dofab!(:current_user) { Fabricate(:admin) }before { sign_in(current_user) }diff --git a/spec/system/admin_watched_words_spec.rb b/spec/system/admin_watched_words_spec.rbindex 1eb14e1f04c..ab330677b98 100644--- a/spec/system/admin_watched_words_spec.rb+++ b/spec/system/admin_watched_words_spec.rb@@ -1,6 +1,6 @@# frozen_string_literal: true-describe "Admin Watched Words", type: :system, js: true do+describe "Admin Watched Words", type: :system dofab!(:current_user) { Fabricate(:admin) }before { sign_in(current_user) }diff --git a/spec/system/navigation_menu_state_integration_spec.rb b/spec/system/navigation_menu_state_integration_spec.rbindex 63c741d7233..47aa3a175dc 100644--- a/spec/system/navigation_menu_state_integration_spec.rb+++ b/spec/system/navigation_menu_state_integration_spec.rb@@ -1,6 +1,6 @@# frozen_string_literal: true-describe "Navigation menu states", type: :system, js: true do+describe "Navigation menu states", type: :system dofab!(:current_user) { Fabricate(:user) }let!(:sidebar_navigation) { PageObjects::Components::NavigationMenu::Sidebar.new }let!(:header_dropdown) { PageObjects::Components::NavigationMenu::HeaderDropdown.new }diff --git a/spec/system/post_menu_spec.rb b/spec/system/post_menu_spec.rbindex 490b489082d..b6ac1a15ced 100644--- a/spec/system/post_menu_spec.rb+++ b/spec/system/post_menu_spec.rb@@ -1,6 +1,6 @@# frozen_string_literal: true-describe "Post menu", type: :system, js: true do+describe "Post menu", type: :system dofab!(:current_user) { Fabricate(:user) }fab!(:topic)fab!(:post) { Fabricate(:post, topic: topic) }