Test relationship use cases using both user objects and screen names as params

This commit is contained in:
Karina Kwiatek 2022-01-23 12:28:54 +01:00 committed by Karina Kwiatek
parent b74c64c664
commit 1e5957bfe9
2 changed files with 18 additions and 4 deletions

View File

@ -46,8 +46,8 @@ describe UseCase::Relationship::Create do
} }
end end
let(:params) { base_params } let(:params) { base_params }
let(:source_user) { user1.screen_name } let(:source_user) { user1 }
let(:target_user) { user2.screen_name } let(:target_user) { user2 }
let(:type) { nil } let(:type) { nil }
# test data: # test data:
@ -60,6 +60,13 @@ describe UseCase::Relationship::Create do
let(:type) { "follow" } let(:type) { "follow" }
include_examples "valid relationship type" include_examples "valid relationship type"
context "using screen names" do
let(:source_user) { user1.screen_name }
let(:target_user) { user2.screen_name }
include_examples "valid relationship type"
end
end end
context "type = 'dick'" do context "type = 'dick'" do

View File

@ -49,8 +49,8 @@ describe UseCase::Relationship::Destroy do
} }
end end
let(:params) { base_params } let(:params) { base_params }
let(:source_user) { user1.screen_name } let(:source_user) { user1 }
let(:target_user) { user2.screen_name } let(:target_user) { user2 }
let(:type) { nil } let(:type) { nil }
# test data: # test data:
@ -63,6 +63,13 @@ describe UseCase::Relationship::Destroy do
let(:type) { "follow" } let(:type) { "follow" }
include_examples "valid relationship type" include_examples "valid relationship type"
context "using screen names" do
let(:source_user) { user1.screen_name }
let(:target_user) { user2.screen_name }
include_examples "valid relationship type"
end
end end
context "type = 'dick'" do context "type = 'dick'" do