Make the do_login_for method accessible to other shared specs

This commit is contained in:
taitus
2021-03-29 12:24:44 +02:00
parent 7a34a338f4
commit fa12528581
2 changed files with 10 additions and 6 deletions

View File

@@ -321,12 +321,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
end
def do_login_for(user)
if management
login_managed_user(user)
login_as_manager
else
login_as(user)
end
common_do_login_for(user, management: management)
end
def fill_in_proposal_form

View File

@@ -81,4 +81,13 @@ module Users
def expect_not_to_be_signed_in
expect(find(".top-bar-right")).not_to have_content "My account"
end
def common_do_login_for(user, management:)
if management
login_managed_user(user)
login_as_manager
else
login_as(user)
end
end
end