mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 11:44:49 +08:00
DEV: Remove extraneous spec code (#29386)
namely `js: true`, requiring `rails_helper`, and default `freeze_time` args
This commit is contained in:
parent
f84f7436c5
commit
587264f9d2
|
@ -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 do
|
||||
fab!(:current_user) { Fabricate(:admin) }
|
||||
let(:admin_plugins_list_page) { PageObjects::Pages::AdminPluginsList.new }
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
describe "DiscourseAutomation | error", type: :system, js: true do
|
||||
describe "DiscourseAutomation | error", type: :system do
|
||||
fab!(:admin)
|
||||
|
||||
before do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
describe "DiscourseAutomation | New automation", type: :system, js: true do
|
||||
describe "DiscourseAutomation | New automation", type: :system do
|
||||
fab!(:admin)
|
||||
|
||||
before do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
describe "DiscourseAutomation | smoke test", type: :system, js: true do
|
||||
describe "DiscourseAutomation | smoke test", type: :system do
|
||||
fab!(:admin)
|
||||
fab!(:group) { Fabricate(:group, name: "test") }
|
||||
fab!(:badge) { Fabricate(:badge, name: "badge") }
|
||||
|
|
|
@ -287,7 +287,7 @@ RSpec.shared_examples "remote backup store" do
|
|||
def 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)
|
||||
|
||||
|
|
|
@ -432,7 +432,7 @@ RSpec.describe PostAction do
|
|||
end
|
||||
|
||||
it "shouldn't change given_likes unless likes are given or removed" do
|
||||
freeze_time(Time.zone.now)
|
||||
freeze_time
|
||||
|
||||
PostActionCreator.like(codinghorror, post)
|
||||
expect(value_for(codinghorror.id, Date.today)).to eq(1)
|
||||
|
|
|
@ -236,7 +236,7 @@ RSpec.describe TopicUser do
|
|||
|
||||
it "should update the record for repeat visit" do
|
||||
today = 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 exist
|
||||
|
|
|
@ -24,7 +24,7 @@ RSpec.describe UserAvatar do
|
|||
after { temp.unlink }
|
||||
|
||||
it "can update gravatars" do
|
||||
freeze_time Time.now
|
||||
freeze_time
|
||||
|
||||
expect { avatar.update_gravatar! }.to change { Upload.count }.by(1)
|
||||
expect(avatar.gravatar_upload).to eq(Upload.last)
|
||||
|
@ -76,7 +76,7 @@ RSpec.describe UserAvatar do
|
|||
|
||||
describe "when failing" do
|
||||
it "always update 'last_gravatar_download_attempt'" do
|
||||
freeze_time Time.now
|
||||
freeze_time
|
||||
|
||||
FileHelper.expects(:download).raises(SocketError)
|
||||
|
||||
|
@ -91,7 +91,7 @@ RSpec.describe UserAvatar do
|
|||
describe "404 should be silent, nothing to do really" do
|
||||
it "does nothing when avatar is 404" do
|
||||
SecureRandom.stubs(:urlsafe_base64).returns("5555")
|
||||
freeze_time Time.now
|
||||
freeze_time
|
||||
|
||||
stub_request(
|
||||
:get,
|
||||
|
|
|
@ -3904,7 +3904,7 @@ RSpec.describe UsersController do
|
|||
|
||||
context "when expiring_at param is set" do
|
||||
it "changes notification level to ignore" do
|
||||
freeze_time(Time.now) do
|
||||
freeze_time do
|
||||
expiring_at = 3.days.from_now
|
||||
put "/u/#{another_user.username}/notification_level.json",
|
||||
params: {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe User::Silence do
|
||||
describe described_class::Contract, type: :model do
|
||||
it { is_expected.to validate_presence_of(:user_id) }
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe User::Suspend do
|
||||
describe described_class::Contract, type: :model do
|
||||
it { is_expected.to validate_presence_of(:user_id) }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
describe "Admin User Fields", type: :system, js: true do
|
||||
describe "Admin User Fields", type: :system do
|
||||
fab!(:current_user) { Fabricate(:admin) }
|
||||
|
||||
before { sign_in(current_user) }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
describe "Admin Watched Words", type: :system, js: true do
|
||||
describe "Admin Watched Words", type: :system do
|
||||
fab!(:current_user) { Fabricate(:admin) }
|
||||
|
||||
before { sign_in(current_user) }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
describe "Navigation menu states", type: :system, js: true do
|
||||
describe "Navigation menu states", type: :system do
|
||||
fab!(:current_user) { Fabricate(:user) }
|
||||
let!(:sidebar_navigation) { PageObjects::Components::NavigationMenu::Sidebar.new }
|
||||
let!(:header_dropdown) { PageObjects::Components::NavigationMenu::HeaderDropdown.new }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
describe "Post menu", type: :system, js: true do
|
||||
describe "Post menu", type: :system do
|
||||
fab!(:current_user) { Fabricate(:user) }
|
||||
fab!(:topic)
|
||||
fab!(:post) { Fabricate(:post, topic: topic) }
|
||||
|
|
Loading…
Reference in New Issue
Block a user