Make following tab tests easier to understand
The `click_link` part did nothing other than scrolling to the element, since in these cases we've got a same-page link and the element it links to is already on the page. Programmers reading the test would expect the link to load the page or change to a different tab and would think the element it links to wasn't there before clicking the link (at least I did).
This commit is contained in:
@@ -438,8 +438,8 @@ describe "Users" do
|
|||||||
login_as user
|
login_as user
|
||||||
|
|
||||||
visit user_path(user, filter: "follows")
|
visit user_path(user, filter: "follows")
|
||||||
click_link "Citizen proposals"
|
|
||||||
|
|
||||||
|
expect(page).to have_link "Citizen proposals", href: "#citizen_proposals"
|
||||||
expect(page).to have_content proposal.title
|
expect(page).to have_content proposal.title
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -493,8 +493,8 @@ describe "Users" do
|
|||||||
budget_investment = create(:budget_investment, author: user, followers: [user])
|
budget_investment = create(:budget_investment, author: user, followers: [user])
|
||||||
|
|
||||||
visit user_path(user, filter: "follows")
|
visit user_path(user, filter: "follows")
|
||||||
click_link "Investments"
|
|
||||||
|
|
||||||
|
expect(page).to have_link "Investments", href: "#investments"
|
||||||
expect(page).to have_link budget_investment.title
|
expect(page).to have_link budget_investment.title
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user