From 9e21dbd0424af84ddaa70d526dd0ff14f6df6d4b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Aug 2023 15:12:29 +0000 Subject: [PATCH 1/3] Update rubocop-rspec requirement from ~> 2.22.0 to ~> 2.23.2 Updates the requirements on [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) to permit the latest version. - [Release notes](https://github.com/rubocop/rubocop-rspec/releases) - [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rspec/compare/v2.22.0...v2.23.2) --- updated-dependencies: - dependency-name: rubocop-rspec dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- publify_core.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publify_core.gemspec b/publify_core.gemspec index e0f10674..c9074d24 100644 --- a/publify_core.gemspec +++ b/publify_core.gemspec @@ -60,7 +60,7 @@ Gem::Specification.new do |s| s.add_development_dependency "rubocop-factory_bot", "~> 2.23.1" s.add_development_dependency "rubocop-performance", "~> 1.19.0" s.add_development_dependency "rubocop-rails", "~> 2.20.2" - s.add_development_dependency "rubocop-rspec", "~> 2.22.0" + s.add_development_dependency "rubocop-rspec", "~> 2.23.2" s.add_development_dependency "shoulda-matchers", "~> 5.3" s.add_development_dependency "simplecov", "~> 0.22.0" s.add_development_dependency "sqlite3", "~> 1.6" From 1bf784472d61ace4d569cca464910a7725b3849a Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sat, 26 Aug 2023 08:47:17 +0200 Subject: [PATCH 2/3] Autocorrect RSpec/Rails/NegationBeValid --- spec/models/note_spec.rb | 4 ++-- spec/models/page_spec.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index 6357af8f..d6aa8920 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -10,7 +10,7 @@ it { expect(build(:note)).to be_valid } it { expect(build(:note).redirect).to be_blank } it { expect(create(:note).redirect).not_to be_blank } - it { expect(build(:note, body: nil)).to be_invalid } + it { expect(build(:note, body: nil)).not_to be_valid } it "with a nil body, return default error message" do note = build(:note, body: nil) @@ -21,7 +21,7 @@ context "with an existing note" do let(:existing_note) { create(:note) } - it { expect(build(:note, guid: existing_note.guid)).to be_invalid } + it { expect(build(:note, guid: existing_note.guid)).not_to be_valid } end end diff --git a/spec/models/page_spec.rb b/spec/models/page_spec.rb index 1ac15f53..a654fae5 100644 --- a/spec/models/page_spec.rb +++ b/spec/models/page_spec.rb @@ -27,7 +27,7 @@ context "with an existing page name" do let!(:page) { create(:page, name: "page_one") } - it { expect(build(:page, name: page.name)).to be_invalid } + it { expect(build(:page, name: page.name)).not_to be_valid } end context "without name" do @@ -35,11 +35,11 @@ end context "without body" do - it { expect(build(:page, body: nil)).to be_invalid } + it { expect(build(:page, body: nil)).not_to be_valid } end context "without title" do - it { expect(build(:page, title: nil)).to be_invalid } + it { expect(build(:page, title: nil)).not_to be_valid } end end From 58ab8497c2f5dcc99ea8ed9ba5da3fb32cd0a20b Mon Sep 17 00:00:00 2001 From: Matijs van Zuijlen Date: Sat, 26 Aug 2023 08:48:31 +0200 Subject: [PATCH 3/3] Autocorrect RSpec/ReceiveMessages --- spec/models/comment_spec.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/models/comment_spec.rb b/spec/models/comment_spec.rb index 7aacb758..b950fbcb 100644 --- a/spec/models/comment_spec.rb +++ b/spec/models/comment_spec.rb @@ -152,8 +152,7 @@ def valid_comment(options = {}) describe "with feedback moderation enabled" do before do - allow(blog).to receive(:sp_global).and_return(false) - allow(blog).to receive(:default_moderate_comments).and_return(true) + allow(blog).to receive_messages(sp_global: false, default_moderate_comments: true) end it "marks comment as presumably spam" do