From e4ad70fd822e500fa02309e1eee982feb973cca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 12 Jun 2021 03:09:21 +0200 Subject: [PATCH] Revert "Adds .js-class for specs" The `js-` prefix (which I admit I'm not fond of) is usually used to indicate the class is used by JavaScript files, not for using it in test files. And in all the other similar tests, we're using the `in-favor` class instead of the `js-in-favor` class. This reverts commit 83fe74d53. --- app/views/budgets/investments/_votes.html.erb | 2 +- spec/system/management/budget_investments_spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/budgets/investments/_votes.html.erb b/app/views/budgets/investments/_votes.html.erb index e520ec3cc..c2924b990 100644 --- a/app/views/budgets/investments/_votes.html.erb +++ b/app/views/budgets/investments/_votes.html.erb @@ -8,7 +8,7 @@ <%= t("budgets.investments.investment.supports", count: investment.total_votes) %> -
+
<% if user_voted_for %>
<%= t("budgets.investments.investment.already_supported") %> diff --git a/spec/system/management/budget_investments_spec.rb b/spec/system/management/budget_investments_spec.rb index f9273a49c..82fb60c6f 100644 --- a/spec/system/management/budget_investments_spec.rb +++ b/spec/system/management/budget_investments_spec.rb @@ -277,7 +277,7 @@ describe "Budget Investments" do expect(page).to have_content(budget_investment.title) within("#budget-investments") do - find(".js-in-favor a").click + find("in-favor a").click expect(page).to have_content "1 support" expect(page).to have_content "You have already supported this investment project. Share it!" @@ -302,7 +302,7 @@ describe "Budget Investments" do expect(page).to have_css "h1", exact_text: budget_investment.title - find(".js-in-favor a").click + find(".in-favor a").click expect(page).to have_content "1 support" expect(page).to have_content "You have already supported this investment project. Share it!" @@ -325,7 +325,7 @@ describe "Budget Investments" do expect(page).to have_css "h1", exact_text: "Default heading investment" - accept_confirm { find(".js-in-favor a").click } + accept_confirm { find(".in-favor a").click } expect(page).to have_content "1 support" expect(page).to have_content "You have already supported this investment project. Share it!"