Add RSpec 4 compatibility (#17652)

* Remove outdated option

04078317ba

* Use the non-globally exposed RSpec syntax

https://github.com/rspec/rspec-core/pull/2803

* Use the non-globally exposed RSpec syntax, cont

https://github.com/rspec/rspec-core/pull/2803

* Comply to strict predicate matchers

See:
 - https://github.com/rspec/rspec-expectations/pull/1195
 - https://github.com/rspec/rspec-expectations/pull/1196
 - https://github.com/rspec/rspec-expectations/pull/1277
This commit is contained in:
Phil Pirozhkov
2022-07-28 05:27:38 +03:00
committed by GitHub
parent 72b24f3fb9
commit 493d437e79
736 changed files with 781 additions and 782 deletions

View File

@ -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 }

View File

@ -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'

View File

@ -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 }

View File

@ -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,

View File

@ -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) {

View File

@ -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

View File

@ -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}" }