Remove method duplications as only the latest method loaded is used

The `management` variable gets its value from the caller context.
This commit is contained in:
Senén Rodero Rodríguez
2022-04-06 11:33:24 +02:00
parent b24e49a6c8
commit 7b1897b7a7
4 changed files with 4 additions and 12 deletions

View File

@@ -1,8 +1,4 @@
module Documents
def do_login_for(user)
common_do_login_for(user, management: management)
end
def documentable_redirected_to_resource_show_or_navigate_to
find("a", text: "Not now, go to my proposal")
click_on "Not now, go to my proposal"

View File

@@ -1,8 +1,4 @@
module Images
def do_login_for(user)
common_do_login_for(user, management: management)
end
def imageable_redirected_to_resource_show_or_navigate_to
case imageable.class.to_s
when "Budget"

View File

@@ -1,8 +1,4 @@
module Maps
def do_login_for(user)
common_do_login_for(user, management: management)
end
def fill_in_proposal_form
fill_in_new_proposal_title with: "Help refugees"
fill_in "Proposal summary", with: "In summary, what we want is..."

View File

@@ -82,6 +82,10 @@ module Users
expect(find(".top-bar-right")).not_to have_content "My account"
end
def do_login_for(user)
common_do_login_for(user, management: management)
end
def common_do_login_for(user, management:)
if management
login_managed_user(user)