From a7ddf67656a5bf946cf1dc75989d39f571603422 Mon Sep 17 00:00:00 2001 From: Oluwatoyosi Oyegoke <34948675+Tooyosi@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:45:50 +0100 Subject: [PATCH] Rails 5 fix user conversation and blocked user tests (#327) * use appropriate validation message depending on rails version * use appropriate validation message depending on rails version * remove validation text * Update spec_helper.rb Remove extra space --- spec/models/blocked_user_spec.rb | 4 ++-- spec/models/user_conversation_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/models/blocked_user_spec.rb b/spec/models/blocked_user_spec.rb index 1ff2d2da..479f7200 100644 --- a/spec/models/blocked_user_spec.rb +++ b/spec/models/blocked_user_spec.rb @@ -9,12 +9,12 @@ context 'validating' do it 'should require a user' do without_user = build :blocked_user, user: nil - expect(without_user).to fail_validation user: "can't be blank" + expect(without_user).to fail_validation end it 'should require a blocked_user' do without_blocked_user = build :blocked_user, blocked_user: nil - expect(without_blocked_user).to fail_validation blocked_user: "can't be blank" + expect(without_blocked_user).to fail_validation end end diff --git a/spec/models/user_conversation_spec.rb b/spec/models/user_conversation_spec.rb index 1e33bc9a..ba62869b 100644 --- a/spec/models/user_conversation_spec.rb +++ b/spec/models/user_conversation_spec.rb @@ -6,7 +6,7 @@ context 'validating' do it 'should require a user' do without_user = build :user_conversation, user_id: nil - expect(without_user).to fail_validation user: "can't be blank" + expect(without_user).to fail_validation end end