From 9b5fefc66141a0433822474f9c4c08e33aa0866c Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sun, 12 Jun 2022 13:16:27 +0200 Subject: [PATCH] Update relationship controller tests for blocking-related actions --- config/locales/errors.en.yml | 1 + .../controllers/ajax/relationship_controller_spec.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/config/locales/errors.en.yml b/config/locales/errors.en.yml index c5e2dfb3..7f9aed2f 100644 --- a/config/locales/errors.en.yml +++ b/config/locales/errors.en.yml @@ -17,6 +17,7 @@ en: answering_other_blocked_self: "You cannot answer this question as you have been blocked its author" self_action: "You cannot do this to yourself" following_self: "You cannot follow yourself" + blocking_self: "You cannot block yourself" not_found: "That does not exist" user_not_found: "User not found" diff --git a/spec/controllers/ajax/relationship_controller_spec.rb b/spec/controllers/ajax/relationship_controller_spec.rb index 40a3c9d9..40be8626 100644 --- a/spec/controllers/ajax/relationship_controller_spec.rb +++ b/spec/controllers/ajax/relationship_controller_spec.rb @@ -56,6 +56,12 @@ describe Ajax::RelationshipController, type: :controller do include_examples "valid relationship type" end + context "type = 'block'" do + let(:type) { "block" } + + include_examples "valid relationship type" + end + context "type = 'dick'" do let(:type) { "dick" } @@ -109,6 +115,12 @@ describe Ajax::RelationshipController, type: :controller do include_examples "valid relationship type" end + context "type = 'block'" do + let(:type) { "block" } + + include_examples "valid relationship type" + end + context "type = 'dick'" do let(:type) { "dick" }