Merge pull request #5955 from cyrillefr/ReplaceLinkWithButtonInVariousComponentsPartI

Replace link with button in various components part i
This commit is contained in:
Sebastia
2025-07-09 15:26:38 +02:00
committed by GitHub
40 changed files with 212 additions and 180 deletions

View File

@@ -821,6 +821,16 @@ footer {
.auth-page { .auth-page {
.cancel-button {
cursor: pointer;
&:hover,
&:active,
&:focus {
text-decoration: underline;
}
}
.footer { .footer {
margin-top: 0; margin-top: 0;
} }
@@ -1144,6 +1154,10 @@ form {
line-height: rem-calc(120); line-height: rem-calc(120);
vertical-align: top; vertical-align: top;
} }
button {
@include link;
}
} }
} }
@@ -1190,9 +1204,17 @@ form {
@include breakpoint(medium) { @include breakpoint(medium) {
.mark-notification { .mark-notification {
@include anchor-color;
cursor: pointer;
position: absolute; position: absolute;
right: 12px; right: 12px;
top: 12px; top: 12px;
&:hover,
&:active,
&:focus {
@include anchor-color-hover;
}
} }
} }
@@ -1803,8 +1825,11 @@ table {
color: $delete; color: $delete;
} }
.dropdown-pane a { .dropdown-pane {
color: $text-medium; a,
button {
color: $text-medium;
}
} }
// 17. Activity // 17. Activity
@@ -2126,7 +2151,7 @@ table {
text-align: center; text-align: center;
} }
a { button {
font-weight: bold; font-weight: bold;
margin-right: $line-height; margin-right: $line-height;
text-decoration: none; text-decoration: none;
@@ -2144,6 +2169,14 @@ table {
&::before { &::before {
margin-right: $font-icon-margin; margin-right: $font-icon-margin;
} }
&:hover {
cursor: pointer;
}
}
form {
display: inline;
} }
} }

View File

@@ -32,8 +32,10 @@
width: auto; width: auto;
} }
a { a,
button {
color: inherit; color: inherit;
cursor: pointer;
line-height: inherit; line-height: inherit;
padding-left: 0; padding-left: 0;
@@ -41,6 +43,10 @@
font-size: $small-font-size; font-size: $small-font-size;
padding: rem-calc(8) rem-calc(16); padding: rem-calc(8) rem-calc(16);
} }
&:hover {
text-decoration: underline;
}
} }
.button { .button {

View File

@@ -8,10 +8,9 @@
<div class="oauth-logins small-12"> <div class="oauth-logins small-12">
<% oauth_logins.each do |login| %> <% oauth_logins.each do |login| %>
<div class="oauth-login"> <div class="oauth-login">
<%= link_to t("omniauth.#{login}.name"), send("user_#{login}_omniauth_authorize_path"), <%= button_to t("omniauth.#{login}.name"), send("user_#{login}_omniauth_authorize_path"),
title: t("omniauth.#{login}.#{action}"), title: t("omniauth.#{login}.#{action}"),
class: "button-#{login.to_s.delete_suffix("_oauth2")} button expanded", class: "button-#{login.to_s.delete_suffix("_oauth2")} button expanded" %>
method: :post %>
</div> </div>
<% end %> <% end %>
</div> </div>

View File

@@ -18,8 +18,8 @@
t("layouts.header.my_account_link") %> t("layouts.header.my_account_link") %>
</li> </li>
<li> <li>
<%= link_to t("devise_views.menu.login_items.logout"), <%= button_to t("devise_views.menu.login_items.logout"),
destroy_user_session_path, rel: "nofollow", method: :delete %> destroy_user_session_path, rel: "nofollow", method: :delete %>
</li> </li>
<% else %> <% else %>
<li> <li>

View File

@@ -7,9 +7,9 @@
edit_budget_investment_path(investment.budget, investment), edit_budget_investment_path(investment.budget, investment),
method: :get, class: "button hollow expanded" %> method: :get, class: "button hollow expanded" %>
<% else %> <% else %>
<%= link_to image_path(investment.image), <%= button_to image_path(investment.image),
method: :delete, method: :delete,
class: "button hollow alert expanded" do %> class: "button hollow alert expanded" do %>
<span class="icon-image"></span> <span class="icon-image"></span>
<%= t("images.remove_image") %> <%= t("images.remove_image") %>
<% end %> <% end %>

View File

@@ -5,8 +5,7 @@
class: "button expanded" %> class: "button expanded" %>
<% end %> <% end %>
<%= link_to t("dashboard.mailing.mailing_options.send", address: current_user.email), <%= button_to t("dashboard.mailing.mailing_options.send", address: current_user.email),
proposal_dashboard_mailing_index_path(proposal), proposal_dashboard_mailing_index_path(proposal),
method: :post, class: "button expanded" %>
class: "button expanded" %>
</div> </div>

View File

@@ -13,8 +13,9 @@
<% end %> <% end %>
<% if can?(:publish, proposal) %> <% if can?(:publish, proposal) %>
<%= link_to t("dashboard.index.publish"), <%= button_to t("dashboard.index.publish"),
publish_proposal_dashboard_path(proposal), publish_proposal_dashboard_path(proposal),
class: "button success", class: "button success",
method: :patch %> form_class: "button_to inline",
method: :patch %>
<% end %> <% end %>

View File

@@ -11,10 +11,4 @@
<%= link_to t("devise_views.shared.links.new_unlock"), new_unlock_path(resource_name) %><br> <%= link_to t("devise_views.shared.links.new_unlock"), new_unlock_path(resource_name) %><br>
<% end -%> <% end -%>
<%- if devise_mapping.omniauthable? && devise_mapping.name == "user" %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to t("devise_views.shared.links.signin_with_provider", provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider), method: :post %><br>
<% end -%>
<% end -%>
</div> </div>

View File

@@ -1,19 +1,19 @@
<div class="js-follow"> <div class="js-follow">
<span class="followable-content"> <span class="followable-content">
<% if follow.followable.followed_by?(current_user) %> <% if follow.followable.followed_by?(current_user) %>
<%= link_to t("shared.following"), <%= button_to t("shared.following"),
follow_path(follow), follow_path(follow),
method: :delete, remote: true, method: :delete, remote: true,
title: unfollow_text(follow.followable), title: unfollow_text(follow.followable),
class: "button expanded" %> class: "button expanded" %>
<% else %> <% else %>
<%= link_to follow_text(follow.followable), <%= button_to follow_text(follow.followable),
follows_path(followable_id: follow.followable.id, follows_path(followable_id: follow.followable.id,
followable_type: follow.followable.class.name), followable_type: follow.followable.class.name),
method: :post, remote: true, remote: true,
title: follow_text(follow.followable), title: follow_text(follow.followable),
class: "button hollow expanded" %> class: "button hollow expanded" %>
<% end %> <% end %>
</span> </span>
</div> </div>

View File

@@ -1,9 +1,9 @@
<% if managed_user.document_number.present? %> <% if managed_user.document_number.present? %>
<section class="account-info"> <section class="account-info">
<%= link_to(t("management.account_info.change_user"), <%= button_to(t("management.account_info.change_user"),
logout_management_users_path, logout_management_users_path,
method: :delete, method: :delete,
class: "float-right btchange-user button hollow") %> class: "float-right btchange-user button hollow") %>
<% if managed_user.level_two_or_three_verified? %> <% if managed_user.level_two_or_three_verified? %>
<p> <p>

View File

@@ -15,16 +15,16 @@
<% end %> <% end %>
<% if notification.unread? %> <% if notification.unread? %>
<%= link_to t("notifications.notification.mark_as_read"), <%= button_to t("notifications.notification.mark_as_read"),
mark_as_read_notification_path(notification), mark_as_read_notification_path(notification),
method: :put, method: :put,
remote: true, remote: true,
class: "mark-notification small" %> class: "mark-notification small" %>
<% else %> <% else %>
<%= link_to t("notifications.notification.mark_as_unread"), <%= button_to t("notifications.notification.mark_as_unread"),
mark_as_unread_notification_path(notification), mark_as_unread_notification_path(notification),
method: :put, method: :put,
remote: true, remote: true,
class: "mark-notification small" %> class: "mark-notification small" %>
<% end %> <% end %>
</li> </li>

View File

@@ -5,10 +5,10 @@
<%= t("notifications.index.title") %> <%= t("notifications.index.title") %>
</h1> </h1>
<%= link_to t("notifications.index.mark_all_as_read"), <%= button_to t("notifications.index.mark_all_as_read"),
mark_all_as_read_notifications_path, mark_all_as_read_notifications_path,
method: :put, method: :put,
class: "button hollow float-right-medium" %> class: "button hollow float-right-medium" %>
<ul class="menu simple clear"> <ul class="menu simple clear">
<li class="is-active"> <li class="is-active">

View File

@@ -13,9 +13,9 @@
<% end %> <% end %>
<% if can?(:publish, @proposal) %> <% if can?(:publish, @proposal) %>
<%= link_to t("proposals.created.publish"), <%= button_to t("proposals.created.publish"),
publish_proposal_path(@proposal), publish_proposal_path(@proposal),
method: :patch, class: "button" %> method: :patch, class: "button", form_class: "inline" %>
<% end %> <% end %>
</div> </div>
</div> </div>

View File

@@ -1,15 +1,15 @@
<small><%= t("related_content.is_related") %></small> <small><%= t("related_content.is_related") %></small>
<span class="relate-content-score"> <div class="relate-content-score">
<%= link_to t("related_content.score_positive"), <%= button_to t("related_content.score_positive"),
score_positive_related_content_path(related), score_positive_related_content_path(related),
method: :put, method: :put,
remote: true, remote: true,
class: "score-positive" %> class: "score-positive" %>
<%= link_to t("related_content.score_negative"), <%= button_to t("related_content.score_negative"),
score_negative_related_content_path(related), score_negative_related_content_path(related),
method: :put, method: :put,
remote: true, remote: true,
class: "score-negative" %> class: "score-negative" %>
</span> </div>

View File

@@ -8,7 +8,8 @@
<span class="icon-flag flag-disable"></span> <span class="icon-flag flag-disable"></span>
</button> </button>
<span class="dropdown-pane" id="flag-drop-<%= dom_id(flaggable) %>" data-dropdown data-auto-focus="true"> <span class="dropdown-pane" id="flag-drop-<%= dom_id(flaggable) %>" data-dropdown data-auto-focus="true">
<%= link_to t("shared.flag"), polymorphic_path(flaggable, action: :flag), method: :put, remote: true %> <%= button_to t("shared.flag"), polymorphic_path(flaggable, action: :flag),
method: :put, remote: true %>
</span> </span>
<% end %> <% end %>
@@ -21,7 +22,8 @@
<span class="icon-flag flag-active"></span> <span class="icon-flag flag-active"></span>
</button> </button>
<span class="dropdown-pane" id="unflag-drop-<%= dom_id(flaggable) %>" data-dropdown data-auto-focus="true"> <span class="dropdown-pane" id="unflag-drop-<%= dom_id(flaggable) %>" data-dropdown data-auto-focus="true">
<%= link_to t("shared.unflag"), polymorphic_path(flaggable, action: :unflag), method: :put, remote: true %> <%= button_to t("shared.unflag"), polymorphic_path(flaggable, action: :unflag),
method: :put, remote: true %>
</span> </span>
<% end %> <% end %>
</span> </span>

View File

@@ -32,10 +32,10 @@
edit_community_topic_path(@community.id, @topic), edit_community_topic_path(@community.id, @topic),
class: "button hollow expanded" %> class: "button hollow expanded" %>
<%= link_to t("community.show.topic.destroy"), <%= button_to t("community.show.topic.destroy"),
community_topic_path(@community.id, @topic), community_topic_path(@community.id, @topic),
method: :delete, method: :delete,
class: "button hollow expanded alert" %> class: "button hollow expanded alert" %>
</aside> </aside>
<% end %> <% end %>
</div> </div>

View File

@@ -20,7 +20,7 @@
<% end %> <% end %>
<%= f.submit t("devise_views.users.registrations.new.submit"), class: "button expanded" %> <%= f.submit t("devise_views.users.registrations.new.submit"), class: "button expanded" %>
<div class="text-center">
<%= link_to t("devise_views.users.registrations.new.cancel"), destroy_user_session_path, class: "delete", method: :delete %>
</div>
<% end %> <% end %>
<div class="text-center">
<%= button_to t("devise_views.users.registrations.new.cancel"), destroy_user_session_path, class: "delete cancel-button", method: :delete %>
</div>

View File

@@ -42,7 +42,7 @@
<%= t("verification.letter.new.office") %> <%= t("verification.letter.new.office") %>
</li> </li>
<li> <li>
<%= link_to t("verification.letter.new.send_letter"), letter_path, method: :post %> <%= button_to t("verification.letter.new.send_letter"), letter_path %>
</li> </li>
</ul> </ul>
</div> </div>

View File

@@ -69,7 +69,6 @@ en:
new_confirmation: Haven't received instructions to activate your account? new_confirmation: Haven't received instructions to activate your account?
new_password: Forgotten your password? new_password: Forgotten your password?
new_unlock: Haven't received unlocking instructions? new_unlock: Haven't received unlocking instructions?
signin_with_provider: Sign in with %{provider}
signup: Don't have an account? %{signup_link} signup: Don't have an account? %{signup_link}
signup_link: Sign up signup_link: Sign up
unlocks: unlocks:

View File

@@ -69,7 +69,6 @@ es:
new_confirmation: '¿No has recibido instrucciones para confirmar tu cuenta?' new_confirmation: '¿No has recibido instrucciones para confirmar tu cuenta?'
new_password: '¿Olvidaste tu contraseña?' new_password: '¿Olvidaste tu contraseña?'
new_unlock: '¿No has recibido instrucciones para desbloquear?' new_unlock: '¿No has recibido instrucciones para desbloquear?'
signin_with_provider: Entrar con %{provider}
signup: '¿No tienes una cuenta? %{signup_link}' signup: '¿No tienes una cuenta? %{signup_link}'
signup_link: Regístrate signup_link: Regístrate
unlocks: unlocks:

View File

@@ -22,8 +22,8 @@ describe Devise::OmniauthFormComponent do
render_inline component render_inline component
expect(page).to have_link "Twitter" expect(page).to have_button "Twitter"
expect(page).to have_link count: 1 expect(page).to have_button count: 1
end end
it "renders the facebook link when the feature is enabled" do it "renders the facebook link when the feature is enabled" do
@@ -31,8 +31,8 @@ describe Devise::OmniauthFormComponent do
render_inline component render_inline component
expect(page).to have_link "Facebook" expect(page).to have_button "Facebook"
expect(page).to have_link count: 1 expect(page).to have_button count: 1
end end
it "renders the google link when the feature is enabled" do it "renders the google link when the feature is enabled" do
@@ -40,8 +40,8 @@ describe Devise::OmniauthFormComponent do
render_inline component render_inline component
expect(page).to have_link "Google" expect(page).to have_button "Google"
expect(page).to have_link count: 1 expect(page).to have_button count: 1
end end
it "renders the wordpress link when the feature is enabled" do it "renders the wordpress link when the feature is enabled" do
@@ -49,8 +49,8 @@ describe Devise::OmniauthFormComponent do
render_inline component render_inline component
expect(page).to have_link "Wordpress" expect(page).to have_button "Wordpress"
expect(page).to have_link count: 1 expect(page).to have_button count: 1
end end
end end
end end

View File

@@ -18,7 +18,7 @@ describe Layout::AdminHeaderComponent do
expect(page).to have_link "You don't have new notifications" expect(page).to have_link "You don't have new notifications"
expect(page).to have_link "My content" expect(page).to have_link "My content"
expect(page).to have_link "My account" expect(page).to have_link "My account"
expect(page).to have_link "Sign out" expect(page).to have_button "Sign out"
expect(page).to have_css "[data-toggle]" expect(page).to have_css "[data-toggle]"
end end

View File

@@ -27,18 +27,18 @@ shared_examples "flaggable" do |factory_name, admin: false|
within "##{dom_id(flaggable)} .flag-content" do within "##{dom_id(flaggable)} .flag-content" do
click_button "Flag as inappropriate" click_button "Flag as inappropriate"
click_link "Flag as inappropriate" within("form") { click_button "Flag as inappropriate" }
expect(page).to have_button "Unflag" expect(page).to have_button "Unflag"
expect(page).to have_link "Unflag", visible: :hidden expect(page).to have_button "Unflag", visible: :hidden
expect(page).not_to have_link "Flag as inappropriate", visible: :all expect(page).not_to have_button "Flag as inappropriate", visible: :all
end end
refresh refresh
within "##{dom_id(flaggable)} .flag-content" do within "##{dom_id(flaggable)} .flag-content" do
expect(page).to have_link "Unflag", visible: :hidden expect(page).to have_button "Unflag", visible: :hidden
expect(page).not_to have_link "Flag as inappropriate", visible: :all expect(page).not_to have_button "Flag as inappropriate", visible: :all
end end
end end
@@ -52,18 +52,18 @@ shared_examples "flaggable" do |factory_name, admin: false|
expect(page).to have_button "Unflag" expect(page).to have_button "Unflag"
click_button "Unflag" click_button "Unflag"
click_link "Unflag" within("form") { click_button "Unflag" }
expect(page).not_to have_button "Unflag" expect(page).not_to have_button "Unflag"
expect(page).to have_link "Flag as inappropriate", visible: :hidden expect(page).to have_button "Flag as inappropriate", visible: :hidden
expect(page).not_to have_link "Unflag", visible: :all expect(page).not_to have_button "Unflag", visible: :all
end end
visit path visit path
within "##{dom_id(flaggable)} .flag-content" do within "##{dom_id(flaggable)} .flag-content" do
expect(page).to have_link "Flag as inappropriate", visible: :hidden expect(page).to have_button "Flag as inappropriate", visible: :hidden
expect(page).not_to have_link "Unflag", visible: :all expect(page).not_to have_button "Unflag", visible: :all
end end
end end
@@ -73,12 +73,12 @@ shared_examples "flaggable" do |factory_name, admin: false|
within "##{dom_id(flaggable)} .flag-content" do within "##{dom_id(flaggable)} .flag-content" do
click_button "Flag as inappropriate" click_button "Flag as inappropriate"
click_link "Flag as inappropriate" within("form") { click_button "Flag as inappropriate" }
expect(page).to have_button "Unflag" expect(page).to have_button "Unflag"
click_button "Unflag" click_button "Unflag"
click_link "Unflag" within("form") { click_button "Unflag" }
expect(page).not_to have_button "Unflag" expect(page).not_to have_button "Unflag"
end end
@@ -86,8 +86,8 @@ shared_examples "flaggable" do |factory_name, admin: false|
visit path visit path
within "##{dom_id(flaggable)} .flag-content" do within "##{dom_id(flaggable)} .flag-content" do
expect(page).to have_link "Flag as inappropriate", visible: :hidden expect(page).to have_button "Flag as inappropriate", visible: :hidden
expect(page).not_to have_link "Unflag", visible: :all expect(page).not_to have_button "Unflag", visible: :all
end end
end end
@@ -99,7 +99,7 @@ shared_examples "flaggable" do |factory_name, admin: false|
within "##{dom_id(flaggable)} > .comment-body .flag-content" do within "##{dom_id(flaggable)} > .comment-body .flag-content" do
click_button "Flag as inappropriate" click_button "Flag as inappropriate"
click_link "Flag as inappropriate" within("form") { click_button "Flag as inappropriate" }
expect(page).to have_button "Unflag" expect(page).to have_button "Unflag"
end end

View File

@@ -17,7 +17,7 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
visit send(followable_path, arguments) visit send(followable_path, arguments)
within "##{dom_id(followable)}" do within "##{dom_id(followable)}" do
expect(page).not_to have_link("Follow") expect(page).not_to have_button("Follow")
end end
end end
@@ -28,7 +28,7 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
visit send(followable_path, arguments) visit send(followable_path, arguments)
within "##{dom_id(followable)}" do within "##{dom_id(followable)}" do
expect(page).to have_link("Follow #{followable.model_name.human.downcase}") expect(page).to have_button("Follow #{followable.model_name.human.downcase}")
end end
end end
@@ -37,7 +37,7 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
login_as(user) login_as(user)
visit send(followable_path, arguments) visit send(followable_path, arguments)
expect(page).to have_link("Follow #{followable.model_name.human.downcase}") expect(page).to have_button("Follow #{followable.model_name.human.downcase}")
end end
scenario "Should display unfollow after user clicks on follow button" do scenario "Should display unfollow after user clicks on follow button" do
@@ -46,10 +46,10 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
visit send(followable_path, arguments) visit send(followable_path, arguments)
within "##{dom_id(followable)}" do within "##{dom_id(followable)}" do
click_link("Follow #{followable.model_name.human.downcase}") click_button("Follow #{followable.model_name.human.downcase}")
expect(page).not_to have_link("Follow") expect(page).not_to have_button("Follow")
expect(page).to have_link("Following") expect(page).to have_button("Following")
end end
end end
@@ -59,7 +59,7 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
visit send(followable_path, arguments) visit send(followable_path, arguments)
within "##{dom_id(followable)}" do within "##{dom_id(followable)}" do
click_link("Follow #{followable.model_name.human.downcase}") click_button("Follow #{followable.model_name.human.downcase}")
end end
expect(page).to have_content "We will notify you of changes as they occur" expect(page).to have_content "We will notify you of changes as they occur"
@@ -71,7 +71,7 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
visit send(followable_path, arguments) visit send(followable_path, arguments)
expect(page).to have_link("Following") expect(page).to have_button("Following")
end end
scenario "Updates follow button & show destroy notice after unfollow button is clicked" do scenario "Updates follow button & show destroy notice after unfollow button is clicked" do
@@ -80,10 +80,10 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
visit send(followable_path, arguments) visit send(followable_path, arguments)
within "##{dom_id(followable)}" do within "##{dom_id(followable)}" do
click_link("Unfollow #{followable.model_name.human.downcase}") click_button("Unfollow #{followable.model_name.human.downcase}")
expect(page).not_to have_link("Unfollow") expect(page).not_to have_button("Unfollow")
expect(page).to have_link("Follow #{followable.model_name.human.downcase}") expect(page).to have_button("Follow #{followable.model_name.human.downcase}")
end end
end end
@@ -93,7 +93,7 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
visit send(followable_path, arguments) visit send(followable_path, arguments)
within "##{dom_id(followable)}" do within "##{dom_id(followable)}" do
click_link("Unfollow #{followable.model_name.human.downcase}") click_button("Unfollow #{followable.model_name.human.downcase}")
end end
expect(page).to have_content "You will no longer receive notifications" expect(page).to have_content "You will no longer receive notifications"

View File

@@ -146,10 +146,10 @@ shared_examples "relationable" do |relationable_model_name|
visit polymorphic_path(relationable) visit polymorphic_path(relationable)
within("#related-content-list") do within("#related-content-list") do
click_link "Yes" click_button "Yes"
expect(page).not_to have_link "Yes" expect(page).not_to have_button "Yes"
expect(page).not_to have_link "No" expect(page).not_to have_button "No"
end end
end end
@@ -163,10 +163,10 @@ shared_examples "relationable" do |relationable_model_name|
visit polymorphic_path(relationable) visit polymorphic_path(relationable)
within("#related-content-list") do within("#related-content-list") do
click_link "No" click_button "No"
expect(page).not_to have_link "Yes" expect(page).not_to have_button "Yes"
expect(page).not_to have_link "No" expect(page).not_to have_button "No"
end end
end end

View File

@@ -1696,7 +1696,7 @@ describe "Budget Investments" do
within("aside") do within("aside") do
expect(page).not_to have_content "Author" expect(page).not_to have_content "Author"
expect(page).not_to have_link "Edit" expect(page).not_to have_link "Edit"
expect(page).not_to have_link "Remove image" expect(page).not_to have_button "Remove image"
end end
end end
@@ -1709,7 +1709,7 @@ describe "Budget Investments" do
within("aside") do within("aside") do
expect(page).to have_content "AUTHOR" expect(page).to have_content "AUTHOR"
expect(page).to have_link "Edit" expect(page).to have_link "Edit"
expect(page).not_to have_link "Remove image" expect(page).not_to have_button "Remove image"
end end
end end
@@ -1723,7 +1723,7 @@ describe "Budget Investments" do
within("aside") do within("aside") do
expect(page).to have_content "AUTHOR" expect(page).to have_content "AUTHOR"
expect(page).not_to have_link "Edit" expect(page).not_to have_link "Edit"
expect(page).to have_link "Remove image" expect(page).to have_button "Remove image"
end end
end end
end end

View File

@@ -10,17 +10,17 @@ describe "Proposal's dashboard" do
expect(page).to have_link("Edit my proposal") expect(page).to have_link("Edit my proposal")
expect(page).to have_link("Edit proposal") expect(page).to have_link("Edit proposal")
expect(page).to have_link("Withdraw proposal") expect(page).to have_link("Withdraw proposal")
expect(page).to have_link("Publish proposal") expect(page).to have_button("Publish proposal")
expect(page).to have_link("Polls") expect(page).to have_link("Polls")
expect(page).to have_link("E-mail") expect(page).to have_link("E-mail")
expect(page).to have_link("Poster") expect(page).to have_link("Poster")
end end
scenario "Publish link dissapears after proposal's publication" do scenario "Publish button dissapears after proposal's publication" do
visit proposal_dashboard_path(proposal) visit proposal_dashboard_path(proposal)
click_link "Publish proposal" click_button "Publish proposal"
expect(page).not_to have_link("Publish proposal") expect(page).not_to have_button("Publish proposal")
end end
scenario "Dashboard progress shows current goal" do scenario "Dashboard progress shows current goal" do

View File

@@ -13,11 +13,11 @@ describe "Mailing" do
end end
scenario "Has a link to send the mail" do scenario "Has a link to send the mail" do
expect(page).to have_link("Send to #{proposal.author.email}") expect(page).to have_button("Send to #{proposal.author.email}")
end end
scenario "User receives feedback after the email is sent" do scenario "User receives feedback after the email is sent" do
click_link "Send to #{proposal.author.email}" click_button "Send to #{proposal.author.email}"
expect(page).to have_content("The email has been sent") expect(page).to have_content("The email has been sent")
end end
@@ -31,6 +31,6 @@ describe "Mailing" do
click_link "Preview" click_link "Preview"
expect(page).not_to have_link("Preview") expect(page).not_to have_link("Preview")
expect(page).to have_link("Send to #{proposal.author.email}") expect(page).to have_button("Send to #{proposal.author.email}")
end end
end end

View File

@@ -149,7 +149,7 @@ describe "Managed User" do
expect(page).to have_content "Identified as" expect(page).to have_content "Identified as"
expect(page).to have_content user.username.to_s expect(page).to have_content user.username.to_s
click_link "Change user" click_button "Change user"
end end
expect(page).to have_content "User session signed out successfully." expect(page).to have_content "User session signed out successfully."

View File

@@ -39,7 +39,7 @@ describe "Moderate users" do
expect(page).to have_css "h1", exact_text: debate3.title expect(page).to have_css "h1", exact_text: debate3.title
expect(page).not_to have_content(comment3.body) expect(page).not_to have_content(comment3.body)
click_link "Sign out" click_button "Sign out"
expect(page).to have_content "You have been signed out successfully" expect(page).to have_content "You have been signed out successfully"

View File

@@ -55,7 +55,7 @@ describe "Multitenancy", :seed_tenants do
expect(page).to have_content "Proposal created successfully." expect(page).to have_content "Proposal created successfully."
click_link "No, I want to publish the proposal" click_button "No, I want to publish the proposal"
expect(page).to have_content "You've created a proposal!" expect(page).to have_content "You've created a proposal!"

View File

@@ -59,7 +59,7 @@ describe "Notifications" do
click_notifications_icon click_notifications_icon
within("#notification_#{notification1.id}") do within("#notification_#{notification1.id}") do
click_link "Mark as read" click_button "Mark as read"
end end
expect(page).to have_css(".notification", count: 1) expect(page).to have_css(".notification", count: 1)
@@ -74,7 +74,7 @@ describe "Notifications" do
click_notifications_icon click_notifications_icon
expect(page).to have_css(".notification", count: 2) expect(page).to have_css(".notification", count: 2)
click_link "Mark all as read" click_button "Mark all as read"
expect(page).to have_css(".notification", count: 0) expect(page).to have_css(".notification", count: 0)
end end
@@ -89,7 +89,7 @@ describe "Notifications" do
expect(page).to have_css(".notification", count: 1) expect(page).to have_css(".notification", count: 1)
within("#notification_#{notification1.id}") do within("#notification_#{notification1.id}") do
click_link "Mark as unread" click_button "Mark as unread"
end end
expect(page).to have_css(".notification", count: 0) expect(page).to have_css(".notification", count: 0)

View File

@@ -294,7 +294,7 @@ describe "Polls" do
expect(page).to have_content "Vote introduced!" expect(page).to have_content "Vote introduced!"
within("#notice") { click_button "Close" } within("#notice") { click_button "Close" }
click_link "Sign out" click_button "Sign out"
expect(page).to have_content "You must sign in or register to continue." expect(page).to have_content "You must sign in or register to continue."

View File

@@ -356,7 +356,7 @@ describe "Proposals" do
expect(page).to have_content "Help refugees" expect(page).to have_content "Help refugees"
expect(page).not_to have_content "You can also see more information about improving your campaign" expect(page).not_to have_content "You can also see more information about improving your campaign"
click_link "No, I want to publish the proposal" click_button "No, I want to publish the proposal"
expect(page).to have_content "Improve your campaign and get more support" expect(page).to have_content "Improve your campaign and get more support"
click_link "Not now, go to my proposal" click_link "Not now, go to my proposal"
@@ -424,7 +424,7 @@ describe "Proposals" do
click_button "Create proposal" click_button "Create proposal"
expect(page).to have_content "Proposal created successfully." expect(page).to have_content "Proposal created successfully."
click_link "No, I want to publish the proposal" click_button "No, I want to publish the proposal"
click_link "Not now, go to my proposal" click_link "Not now, go to my proposal"
click_link "Dashboard" click_link "Dashboard"
@@ -450,7 +450,7 @@ describe "Proposals" do
click_button "Create proposal" click_button "Create proposal"
expect(page).to have_content "Proposal created successfully." expect(page).to have_content "Proposal created successfully."
click_link "No, I want to publish the proposal" click_button "No, I want to publish the proposal"
click_link "Not now, go to my proposal" click_link "Not now, go to my proposal"
expect(page).to have_css "h1", exact_text: "Help refugees" expect(page).to have_css "h1", exact_text: "Help refugees"
@@ -481,7 +481,7 @@ describe "Proposals" do
click_button "Create proposal" click_button "Create proposal"
expect(page).to have_content "Proposal created successfully." expect(page).to have_content "Proposal created successfully."
click_link "No, I want to publish the proposal" click_button "No, I want to publish the proposal"
click_link "Not now, go to my proposal" click_link "Not now, go to my proposal"
expect(page).to have_content "Testing an attack" expect(page).to have_content "Testing an attack"
@@ -504,7 +504,7 @@ describe "Proposals" do
click_button "Create proposal" click_button "Create proposal"
expect(page).to have_content "Proposal created successfully." expect(page).to have_content "Proposal created successfully."
click_link "No, I want to publish the proposal" click_button "No, I want to publish the proposal"
click_link "Not now, go to my proposal" click_link "Not now, go to my proposal"
expect(page).to have_content "Testing auto link" expect(page).to have_content "Testing auto link"
@@ -528,7 +528,7 @@ describe "Proposals" do
click_button "Create proposal" click_button "Create proposal"
expect(page).to have_content "Proposal created successfully." expect(page).to have_content "Proposal created successfully."
click_link "No, I want to publish the proposal" click_button "No, I want to publish the proposal"
click_link "Not now, go to my proposal" click_link "Not now, go to my proposal"
expect(page).to have_content "Testing auto link" expect(page).to have_content "Testing auto link"
@@ -568,7 +568,7 @@ describe "Proposals" do
click_button "Create proposal" click_button "Create proposal"
expect(page).to have_content "Proposal created successfully." expect(page).to have_content "Proposal created successfully."
click_link "No, I want to publish the proposal" click_button "No, I want to publish the proposal"
click_link "Not now, go to my proposal" click_link "Not now, go to my proposal"
within "#geozone" do within "#geozone" do
@@ -613,7 +613,7 @@ describe "Proposals" do
click_button "Create proposal" click_button "Create proposal"
expect(page).to have_content "Proposal created successfully." expect(page).to have_content "Proposal created successfully."
click_link "No, I want to publish the proposal" click_button "No, I want to publish the proposal"
click_link "Not now, go to my proposal" click_link "Not now, go to my proposal"
within "#geozone" do within "#geozone" do

View File

@@ -16,7 +16,7 @@ describe "Sessions" do
within("#notice") { click_button "Close" } within("#notice") { click_button "Close" }
click_link "Sign out" click_button "Sign out"
expect(page).to have_content("You have been signed out successfully") expect(page).to have_content("You have been signed out successfully")
expect(page).to have_current_path(debate_path(debate)) expect(page).to have_current_path(debate_path(debate))
@@ -63,7 +63,7 @@ describe "Sessions" do
expect(page).to have_content(/errors prevented the verification of your residence/) expect(page).to have_content(/errors prevented the verification of your residence/)
click_link "Sign out" click_button "Sign out"
expect(page).to have_content "You must sign in or register to continue." expect(page).to have_content "You must sign in or register to continue."
expect(page).to have_current_path new_user_session_path expect(page).to have_current_path new_user_session_path

View File

@@ -74,7 +74,7 @@ describe "Tags" do
click_button "Create proposal" click_button "Create proposal"
expect(page).to have_content "Proposal created successfully." expect(page).to have_content "Proposal created successfully."
click_link "No, I want to publish the proposal" click_button "No, I want to publish the proposal"
click_link "Not now, go to my proposal" click_link "Not now, go to my proposal"
expect(page).to have_content "Economía" expect(page).to have_content "Economía"
@@ -99,7 +99,7 @@ describe "Tags" do
click_button "Create proposal" click_button "Create proposal"
expect(page).to have_content "Proposal created successfully." expect(page).to have_content "Proposal created successfully."
click_link "No, I want to publish the proposal" click_button "No, I want to publish the proposal"
click_link "Not now, go to my proposal" click_link "Not now, go to my proposal"
expect(page).to have_css "h1", exact_text: "Help refugees" expect(page).to have_css "h1", exact_text: "Help refugees"
@@ -144,7 +144,7 @@ describe "Tags" do
click_button "Create proposal" click_button "Create proposal"
expect(page).to have_content "Proposal created successfully." expect(page).to have_content "Proposal created successfully."
click_link "No, I want to publish the proposal" click_button "No, I want to publish the proposal"
click_link "Not now, go to my proposal" click_link "Not now, go to my proposal"
expect(page).to have_content "user_id1" expect(page).to have_content "user_id1"

View File

@@ -131,7 +131,7 @@ describe "Topics" do
login_as(user) login_as(user)
visit community_topic_path(topic.community, topic) visit community_topic_path(topic.community, topic)
click_link "Delete topic" click_button "Delete topic"
expect(page).to have_content "Topic deleted successfully." expect(page).to have_content "Topic deleted successfully."
expect(page).not_to have_content topic.title expect(page).not_to have_content topic.title

View File

@@ -85,7 +85,7 @@ describe "Users" do
expect(page).to have_link "My content", href: user_path(u1) expect(page).to have_link "My content", href: user_path(u1)
within("#notice") { click_button "Close" } within("#notice") { click_button "Close" }
click_link "Sign out" click_button "Sign out"
expect(page).to have_content "You have been signed out successfully." expect(page).to have_content "You have been signed out successfully."
@@ -130,7 +130,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Register" click_link "Register"
click_link "Sign up with Twitter" click_button "Sign up with Twitter"
expect_to_be_signed_in expect_to_be_signed_in
@@ -149,7 +149,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Register" click_link "Register"
click_link "Sign up with Twitter" click_button "Sign up with Twitter"
expect(page).to have_current_path(new_user_session_path) expect(page).to have_current_path(new_user_session_path)
expect(page).to have_content "To continue, please click on the confirmation " \ expect(page).to have_content "To continue, please click on the confirmation " \
@@ -160,7 +160,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Sign in" click_link "Sign in"
click_link "Sign in with Twitter" click_button "Sign in with Twitter"
expect_to_be_signed_in expect_to_be_signed_in
within("#notice") { click_button "Close" } within("#notice") { click_button "Close" }
@@ -177,7 +177,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Register" click_link "Register"
click_link "Sign up with Twitter" click_button "Sign up with Twitter"
expect(page).to have_current_path(finish_signup_path) expect(page).to have_current_path(finish_signup_path)
fill_in "Email", with: "manueladelascarmenas@example.com" fill_in "Email", with: "manueladelascarmenas@example.com"
@@ -191,7 +191,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Sign in" click_link "Sign in"
click_link "Sign in with Twitter" click_button "Sign in with Twitter"
expect_to_be_signed_in expect_to_be_signed_in
within("#notice") { click_button "Close" } within("#notice") { click_button "Close" }
@@ -208,10 +208,10 @@ describe "Users" do
visit "/" visit "/"
click_link "Register" click_link "Register"
click_link "Sign up with Twitter" click_button "Sign up with Twitter"
expect(page).to have_current_path(finish_signup_path) expect(page).to have_current_path(finish_signup_path)
click_link "Cancel login" click_button "Cancel login"
expect(page).to have_content "You have been signed out successfully" expect(page).to have_content "You have been signed out successfully"
@@ -228,7 +228,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Sign in" click_link "Sign in"
click_link "Sign in with Twitter" click_button "Sign in with Twitter"
expect_to_be_signed_in expect_to_be_signed_in
@@ -247,7 +247,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Register" click_link "Register"
click_link "Sign up with Twitter" click_button "Sign up with Twitter"
expect(page).to have_current_path(finish_signup_path) expect(page).to have_current_path(finish_signup_path)
@@ -275,7 +275,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Register" click_link "Register"
click_link "Sign up with Twitter" click_button "Sign up with Twitter"
expect(page).to have_current_path(finish_signup_path) expect(page).to have_current_path(finish_signup_path)
expect(page).to have_field "Username", with: "manuela" expect(page).to have_field "Username", with: "manuela"
@@ -296,7 +296,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Sign in" click_link "Sign in"
click_link "Sign in with Twitter" click_button "Sign in with Twitter"
within("#notice") { click_button "Close" } within("#notice") { click_button "Close" }
click_link "My account" click_link "My account"
@@ -312,7 +312,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Register" click_link "Register"
click_link "Sign up with Twitter" click_button "Sign up with Twitter"
expect(page).to have_current_path(finish_signup_path) expect(page).to have_current_path(finish_signup_path)
@@ -332,7 +332,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Sign in" click_link "Sign in"
click_link "Sign in with Twitter" click_button "Sign in with Twitter"
expect_to_be_signed_in expect_to_be_signed_in
within("#notice") { click_button "Close" } within("#notice") { click_button "Close" }
@@ -350,7 +350,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Register" click_link "Register"
click_link "Sign up with Twitter" click_button "Sign up with Twitter"
expect(page).to have_current_path(finish_signup_path) expect(page).to have_current_path(finish_signup_path)
@@ -366,7 +366,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Sign in" click_link "Sign in"
click_link "Sign in with Twitter" click_button "Sign in with Twitter"
expect_to_be_signed_in expect_to_be_signed_in
within("#notice") { click_button "Close" } within("#notice") { click_button "Close" }
@@ -398,7 +398,7 @@ describe "Users" do
create(:user, username: "manuela", email: "manuelacarmena@example.com") create(:user, username: "manuela", email: "manuelacarmena@example.com")
visit new_user_session_path visit new_user_session_path
click_link "Sign in with Google" click_button "Sign in with Google"
expect_to_be_signed_in expect_to_be_signed_in
end end
@@ -423,7 +423,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Register" click_link "Register"
click_link "Sign up with Wordpress" click_button "Sign up with Wordpress"
expect(page).to have_current_path(new_user_session_path) expect(page).to have_current_path(new_user_session_path)
expect(page).to have_content "To continue, please click on the confirmation " \ expect(page).to have_content "To continue, please click on the confirmation " \
@@ -434,7 +434,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Sign in" click_link "Sign in"
click_link "Sign in with Wordpress" click_button "Sign in with Wordpress"
expect_to_be_signed_in expect_to_be_signed_in
within("#notice") { click_button "Close" } within("#notice") { click_button "Close" }
@@ -452,7 +452,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Register" click_link "Register"
click_link "Sign up with Wordpress" click_button "Sign up with Wordpress"
expect(page).to have_current_path(finish_signup_path) expect(page).to have_current_path(finish_signup_path)
@@ -475,7 +475,7 @@ describe "Users" do
visit "/" visit "/"
click_link "Sign in" click_link "Sign in"
click_link "Sign in with Wordpress" click_button "Sign in with Wordpress"
expect_to_be_signed_in expect_to_be_signed_in
@@ -495,7 +495,7 @@ describe "Users" do
login_as(user) login_as(user)
visit "/" visit "/"
click_link "Sign out" click_button "Sign out"
expect(page).to have_content "You have been signed out successfully." expect(page).to have_content "You have been signed out successfully."
end end

View File

@@ -8,7 +8,7 @@ describe "Verify Letter" do
login_as(user) login_as(user)
visit new_letter_path visit new_letter_path
click_link "Send me a letter with the code" click_button "Send me a letter with the code"
expect(page).to have_content "Thank you for requesting your maximum security code " \ expect(page).to have_content "Thank you for requesting your maximum security code " \
"(only required for the final votes). In a few days " \ "(only required for the final votes). In a few days " \

View File

@@ -76,7 +76,7 @@ describe "Level three verification" do
verify_residence verify_residence
confirm_phone(code: "1234") confirm_phone(code: "1234")
click_link "Send me a letter with the code" click_button "Send me a letter with the code"
expect(page).to have_content "Thank you for requesting your maximum security code " \ expect(page).to have_content "Thank you for requesting your maximum security code " \
"(only required for the final votes). In a few days " \ "(only required for the final votes). In a few days " \