diff --git a/spec/lib/freedom_patches/mail_disable_starttls_spec.rb b/spec/lib/freedom_patches/mail_disable_starttls_spec.rb index 0a12538160bcd..86aa6b87bd83d 100644 --- a/spec/lib/freedom_patches/mail_disable_starttls_spec.rb +++ b/spec/lib/freedom_patches/mail_disable_starttls_spec.rb @@ -9,7 +9,7 @@ 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 @@ 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/quote_comparer_spec.rb b/spec/lib/quote_comparer_spec.rb index ef0aa6977a3c3..240a90e5a77ea 100644 --- a/spec/lib/quote_comparer_spec.rb +++ b/spec/lib/quote_comparer_spec.rb @@ -19,12 +19,12 @@ expect(QuoteComparer.new(post.topic_id, nil, "test")).to be_missing end - it "returns false for only missing text" do - expect(QuoteComparer.new(post.topic_id, post.post_number, nil)).to_not be_missing + it "returns a falsey value for only missing text" do + expect(QuoteComparer.new(post.topic_id, post.post_number, nil).missing?).to be(nil) end - it "returns false for no missing topic and post" do - expect(QuoteComparer.new(post.topic_id, post.post_number, "test")).to_not be_missing + it "returns a falsey value for no missing topic and post" do + expect(QuoteComparer.new(post.topic_id, post.post_number, "test").missing?).to be(nil) end end diff --git a/spec/lib/svg_sprite/svg_sprite_spec.rb b/spec/lib/svg_sprite/svg_sprite_spec.rb index 468ac35a86ec7..cdaac927fbb60 100644 --- a/spec/lib/svg_sprite/svg_sprite_spec.rb +++ b/spec/lib/svg_sprite/svg_sprite_spec.rb @@ -254,7 +254,7 @@ theme.set_field(target: :common, name: SvgSprite.theme_sprite_variable_name, upload_id: upload.id, type: :theme_upload_var) theme.save! - expect(Upload.where(id: upload.id)).to be_exist + expect(Upload.exists?(id: upload.id)).to eq(true) expect(SvgSprite.bundle(theme.id)).to match(/my-custom-theme-icon/) end @@ -266,7 +266,7 @@ theme.set_field(target: :common, name: SvgSprite.theme_sprite_variable_name, upload_id: upload.id, type: :theme_upload_var) theme.save! - expect(Upload.where(id: upload.id)).to be_exist + expect(Upload.exists?(id: upload.id)).to eq(true) expect(SvgSprite.bundle(theme.id)).to match(/arrow-down/) end @@ -280,7 +280,7 @@ child_theme.set_field(target: :common, name: SvgSprite.theme_sprite_variable_name, upload_id: upload.id, type: :theme_upload_var) child_theme.save! - expect(Upload.where(id: upload.id)).to be_exist + expect(Upload.exists?(id: upload.id)).to eq(true) expect(SvgSprite.bundle(theme.id)).to match(/my-custom-theme-icon/) end diff --git a/spec/lib/topic_view_spec.rb b/spec/lib/topic_view_spec.rb index 2df1513391655..c6558406fe399 100644 --- a/spec/lib/topic_view_spec.rb +++ b/spec/lib/topic_view_spec.rb @@ -1012,7 +1012,7 @@ def topic_view_for_post(post_number) context "when queue is enabled globally" do let(:queue_enabled) { true } - it { is_expected.to be_queued_posts_enabled } + it { expect(topic_view.queued_posts_enabled?).to be(true) } end context "when queue is not enabled globally" do @@ -1023,11 +1023,11 @@ def topic_view_for_post(post_number) category.custom_fields[Category::REQUIRE_REPLY_APPROVAL] = true end - it { is_expected.to be_queued_posts_enabled } + it { expect(topic_view.queued_posts_enabled?).to be(true) } end context "when category is not moderated" do - it { is_expected.not_to be_queued_posts_enabled } + it { expect(topic_view.queued_posts_enabled?).to be(nil) } end end end diff --git a/spec/models/theme_spec.rb b/spec/models/theme_spec.rb index 691d8a5860327..51711214153b0 100644 --- a/spec/models/theme_spec.rb +++ b/spec/models/theme_spec.rb @@ -282,7 +282,7 @@ def transpile(html) freeze_time (SiteSetting.clean_orphan_uploads_grace_period_hours + 1).hours.from_now Jobs::CleanUpUploads.new.execute(nil) - expect(Upload.where(id: upload.id)).to be_exist + expect(Upload.where(id: upload.id)).to be_exists # no error for theme field theme.reload diff --git a/spec/models/topic_spec.rb b/spec/models/topic_spec.rb index 7d8dc6d075c99..3671a78aad204 100644 --- a/spec/models/topic_spec.rb +++ b/spec/models/topic_spec.rb @@ -2353,16 +2353,16 @@ def set_state!(group, user, state) it "is true if the category is secure" do category.stubs(:read_restricted).returns(true) - expect(Topic.new(category: category)).to be_read_restricted_category + expect(Topic.new(category: category).read_restricted_category?).to eq(true) end it "is false if the category is not secure" do category.stubs(:read_restricted).returns(false) - expect(Topic.new(category: category)).not_to be_read_restricted_category + expect(Topic.new(category: category).read_restricted_category?).to eq(false) end - it "is false if there is no category" do - expect(Topic.new(category: nil)).not_to be_read_restricted_category + it "is falsey if there is no category" do + expect(Topic.new(category: nil).read_restricted_category?).to eq(nil) end end