Merge pull request #5896 from consuldemocracy/link_names
Add missing text to links with no text
This commit is contained in:
@@ -39,14 +39,13 @@
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
$("#user_password").val(App.Managers.generatePassword());
|
$("#user_password").val(App.Managers.generatePassword());
|
||||||
});
|
});
|
||||||
$(".show-password").on("click", function(e) {
|
$(".show-password").on("click", function() {
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
if ($("#user_password").is("input[type='password']")) {
|
if ($("#user_password").is("input[type='password']")) {
|
||||||
App.Managers.togglePassword("text");
|
App.Managers.togglePassword("text");
|
||||||
} else {
|
} else {
|
||||||
App.Managers.togglePassword("password");
|
App.Managers.togglePassword("password");
|
||||||
}
|
}
|
||||||
|
$(this).attr("aria-pressed", !JSON.parse($(this).attr("aria-pressed")));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -139,24 +139,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-check {
|
form {
|
||||||
display: inline-block;
|
display: inline;
|
||||||
font-size: rem-calc(24);
|
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
|
|
||||||
|
button {
|
||||||
|
font-size: 1.5em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.checked-link {
|
||||||
|
@include has-fa-icon(check, solid);
|
||||||
|
color: $color-success;
|
||||||
}
|
}
|
||||||
|
|
||||||
.unchecked-link {
|
.unchecked-link {
|
||||||
display: inline-block;
|
@include has-fa-icon(square, regular);
|
||||||
vertical-align: top;
|
color: $dark-gray;
|
||||||
}
|
|
||||||
|
|
||||||
.unchecked {
|
|
||||||
border: 1px solid $border;
|
|
||||||
border-radius: rem-calc(4);
|
|
||||||
display: inline-block;
|
|
||||||
height: rem-calc(20);
|
|
||||||
margin-top: calc($line-height / 6);
|
|
||||||
width: rem-calc(20);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -596,12 +596,6 @@
|
|||||||
border-bottom: 1px solid $border;
|
border-bottom: 1px solid $border;
|
||||||
margin-bottom: rem-calc(16);
|
margin-bottom: rem-calc(16);
|
||||||
padding-bottom: rem-calc(8);
|
padding-bottom: rem-calc(8);
|
||||||
|
|
||||||
a .icon-expand {
|
|
||||||
color: #838383;
|
|
||||||
float: right;
|
|
||||||
font-size: $small-font-size;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.comments-wrapper {
|
.comments-wrapper {
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
.management-account-edit-password-manually {
|
.management-account-edit-password-manually {
|
||||||
[type=password] {
|
[type=password],
|
||||||
|
[type=text] {
|
||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.show-password {
|
||||||
|
@include has-fa-icon(eye, regular);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,9 @@
|
|||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<%= f.password_field :password, class: "input-group-field", label: false, value: nil %>
|
<%= f.password_field :password, class: "input-group-field", label: false, value: nil %>
|
||||||
<span class="input-group-label">
|
<span class="input-group-label">
|
||||||
<a href="#" class="show-password"><span class="icon-eye"></span></a>
|
<button type="button" class="show-password" aria-pressed="false">
|
||||||
|
<span class="show-for-sr"><%= t("management.account.edit.password.show") %></span>
|
||||||
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
<% if banner %>
|
<div class="banner" style="background-color:<%= banner.background_color %>;">
|
||||||
<div class="banner" style="background-color:<%= banner.background_color %>;">
|
<%= sanitize link, attributes: %w[href style] %>
|
||||||
<%= sanitize link, attributes: %w[href style] %>
|
</div>
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ class Shared::BannerComponent < ApplicationComponent
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def render?
|
||||||
|
banner && (banner.title.present? || banner.description.present?)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def link
|
def link
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ class Legislation::Process < ApplicationRecord
|
|||||||
validates_translation :title, presence: true
|
validates_translation :title, presence: true
|
||||||
validates :start_date, presence: true
|
validates :start_date, presence: true
|
||||||
validates :end_date, presence: true
|
validates :end_date, presence: true
|
||||||
|
validates :result_publication_date, presence: true, if: :result_publication_enabled?
|
||||||
|
|
||||||
%i[draft debate proposals_phase allegations].each do |phase_name|
|
%i[draft debate proposals_phase allegations].each do |phase_name|
|
||||||
enabled_attribute = :"#{phase_name.to_s.gsub("_phase", "")}_phase_enabled?"
|
enabled_attribute = :"#{phase_name.to_s.gsub("_phase", "")}_phase_enabled?"
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
<div id="<%= dom_id(proposed_action) %>">
|
<div id="<%= dom_id(proposed_action) %>">
|
||||||
<div class="action">
|
<div class="action">
|
||||||
<% if proposed_action.proposals.where(id: proposal.id).any? %>
|
<% if proposed_action.proposals.where(id: proposal.id).any? %>
|
||||||
<%= link_to unexecute_proposal_dashboard_action_path(proposal, proposed_action),
|
<%= button_to unexecute_proposal_dashboard_action_path(proposal, proposed_action),
|
||||||
id: "#{dom_id(proposed_action)}_unexecute",
|
class: "checked-link" do %>
|
||||||
method: :post,
|
<span class="show-for-sr">
|
||||||
class: "checked-link" do %>
|
<%= t("dashboard.recommended_actions.unexecute", name: proposed_action.title) %>
|
||||||
<span class="icon-check"></span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to execute_proposal_dashboard_action_path(proposal, proposed_action),
|
<%= button_to execute_proposal_dashboard_action_path(proposal, proposed_action),
|
||||||
id: "#{dom_id(proposed_action)}_execute",
|
class: "unchecked-link" do %>
|
||||||
method: :post,
|
<span class="show-for-sr">
|
||||||
class: "unchecked-link" do %>
|
<%= t("dashboard.recommended_actions.execute", name: proposed_action.title) %>
|
||||||
<span class="unchecked"></span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="action-content">
|
<div class="action-content">
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
<%= link_to legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation, sub_annotation_ids: "") do %>
|
|
||||||
<span class="icon-expand" aria-hidden="true"></span>
|
|
||||||
<% end %>
|
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
<%= render Shared::CommentsCountComponent.new(annotation.comments.roots.count) %>
|
|
||||||
|
|
||||||
<span id="annotation-link" data-sub-annotation-ids="8">
|
<span id="annotation-link" data-sub-annotation-ids="8">
|
||||||
<%= render "annotation_link", annotation: annotation %>
|
<%= render Shared::CommentsCountComponent.new(
|
||||||
|
annotation.comments.roots.count,
|
||||||
|
url: legislation_process_draft_version_annotation_path(
|
||||||
|
annotation.draft_version.process, annotation.draft_version, annotation, sub_annotation_ids: ""
|
||||||
|
)
|
||||||
|
) %>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ if ($(".comment").length == 0) {
|
|||||||
|
|
||||||
$("#annotation-link a").attr("href", new_annotation_link)
|
$("#annotation-link a").attr("href", new_annotation_link)
|
||||||
|
|
||||||
var current_comment_text = $(".comments-count").text()
|
var current_comment_text = $("#annotation-link a").text()
|
||||||
var current_comment_count = current_comment_text.match(/\d+/)[0]
|
var current_comment_count = current_comment_text.match(/\d+/)[0]
|
||||||
var new_comment_count = parseInt(current_comment_count) + parseInt(<%= @annotation.comments.roots.count %>)
|
var new_comment_count = parseInt(current_comment_count) + parseInt(<%= @annotation.comments.roots.count %>)
|
||||||
var new_comment_count_text = current_comment_text.replace(/(\d+)/, new_comment_count);
|
var new_comment_count_text = current_comment_text.replace(/(\d+)/, new_comment_count);
|
||||||
$(".comments-count").text(new_comment_count_text)
|
$("#annotation-link a").text(new_comment_count_text)
|
||||||
}
|
}
|
||||||
|
|
||||||
<%= render "comments_box_form", comment: @comment, annotation: @annotation %>
|
<%= render "comments_box_form", comment: @comment, annotation: @annotation %>
|
||||||
|
|||||||
@@ -475,6 +475,8 @@ en:
|
|||||||
see_proposed_actions: Check out recommended actions
|
see_proposed_actions: Check out recommended actions
|
||||||
hide_proposed_actions: Hide recommended actions
|
hide_proposed_actions: Hide recommended actions
|
||||||
pending_title: Pending
|
pending_title: Pending
|
||||||
|
execute: "Mark %{name} as done"
|
||||||
|
unexecute: "Unmark %{name} as done"
|
||||||
show_description: Show description
|
show_description: Show description
|
||||||
without_pending_actions: No recommended actions pending
|
without_pending_actions: No recommended actions pending
|
||||||
done_title: Done
|
done_title: Done
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ en:
|
|||||||
reseted: Password reseted successfully
|
reseted: Password reseted successfully
|
||||||
random: Generate random password
|
random: Generate random password
|
||||||
save: Save password
|
save: Save password
|
||||||
|
show: Show password
|
||||||
print: Print password
|
print: Print password
|
||||||
print_help: You will be able to print the password when it is saved.
|
print_help: You will be able to print the password when it is saved.
|
||||||
account_info:
|
account_info:
|
||||||
|
|||||||
@@ -475,6 +475,8 @@ es:
|
|||||||
see_proposed_actions: Ver todas las acciones recomendadas
|
see_proposed_actions: Ver todas las acciones recomendadas
|
||||||
hide_proposed_actions: Ocultar acciones recomendadas
|
hide_proposed_actions: Ocultar acciones recomendadas
|
||||||
pending_title: Pendientes
|
pending_title: Pendientes
|
||||||
|
execute: "Marcar la acción %{name} como realizada"
|
||||||
|
unexecute: "Desmarcar la acción %{name} como realizada"
|
||||||
show_description: Mostrar descripción
|
show_description: Mostrar descripción
|
||||||
without_pending_actions: No hay acciones recomendadas pendientes
|
without_pending_actions: No hay acciones recomendadas pendientes
|
||||||
done_title: Realizadas
|
done_title: Realizadas
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ es:
|
|||||||
reseted: Contraseña restablecida correctamente
|
reseted: Contraseña restablecida correctamente
|
||||||
random: Generar contraseña aleatoria
|
random: Generar contraseña aleatoria
|
||||||
save: Guardar contraseña
|
save: Guardar contraseña
|
||||||
|
show: Mostrar contraseña
|
||||||
print: Imprimir contraseña
|
print: Imprimir contraseña
|
||||||
print_help: Podrás imprimir la contraseña cuando se haya guardado.
|
print_help: Podrás imprimir la contraseña cuando se haya guardado.
|
||||||
account_info:
|
account_info:
|
||||||
|
|||||||
@@ -31,6 +31,14 @@ describe Shared::BannerComponent do
|
|||||||
expect(page).not_to have_content "Proposal banner"
|
expect(page).not_to have_content "Proposal banner"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "does not render an empty banner" do
|
||||||
|
banner = build(:banner, title: "", description: "")
|
||||||
|
|
||||||
|
render_inline Shared::BannerComponent.new(banner)
|
||||||
|
|
||||||
|
expect(page).not_to be_rendered
|
||||||
|
end
|
||||||
|
|
||||||
context "several banners available in the same section" do
|
context "several banners available in the same section" do
|
||||||
before do
|
before do
|
||||||
create(:banner,
|
create(:banner,
|
||||||
|
|||||||
@@ -154,6 +154,21 @@ describe Legislation::Process do
|
|||||||
expect(proposals_disabled).to be_valid
|
expect(proposals_disabled).to be_valid
|
||||||
expect(allegations_disabled).to be_valid
|
expect(allegations_disabled).to be_valid
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "is invalid if result publication is enabled but result_publication_date is not present" do
|
||||||
|
process = build(:legislation_process, result_publication_enabled: true, result_publication_date: "")
|
||||||
|
|
||||||
|
expect(process).not_to be_valid
|
||||||
|
expect(process.errors.messages[:result_publication_date]).to include("can't be blank")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "is valid if result publication is enabled and result_publication_date is present" do
|
||||||
|
process = build(:legislation_process,
|
||||||
|
result_publication_enabled: true,
|
||||||
|
result_publication_date: Date.tomorrow)
|
||||||
|
|
||||||
|
expect(process).to be_valid
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "date ranges validations" do
|
describe "date ranges validations" do
|
||||||
|
|||||||
@@ -35,13 +35,12 @@ describe "Commenting legislation annotations" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "View comments of annotations in an included range" do
|
scenario "View comments of annotations in an included range" do
|
||||||
within("#annotation-link") do
|
click_link "2 comment"
|
||||||
find(".icon-expand").click
|
|
||||||
end
|
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 2)
|
expect(page).to have_content "Comments about"
|
||||||
expect(page).to have_content("my annotation")
|
expect(page).to have_css ".comment", count: 2
|
||||||
expect(page).to have_content("my other annotation")
|
expect(page).to have_content "my annotation"
|
||||||
|
expect(page).to have_content "my other annotation"
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Reply on a single annotation thread and display it in the merged annotation thread" do
|
scenario "Reply on a single annotation thread and display it in the merged annotation thread" do
|
||||||
@@ -70,20 +69,16 @@ describe "Commenting legislation annotations" do
|
|||||||
expect(page).to have_content "my other annotation"
|
expect(page).to have_content "my other annotation"
|
||||||
end
|
end
|
||||||
|
|
||||||
within("#annotation-link") do
|
click_link "2 comment"
|
||||||
find(".icon-expand").click
|
|
||||||
end
|
|
||||||
|
|
||||||
expect(page).to have_css(".comment", count: 3)
|
expect(page).to have_css ".comment", count: 3
|
||||||
expect(page).to have_content("my annotation")
|
expect(page).to have_content "my annotation"
|
||||||
expect(page).to have_content("my other annotation")
|
expect(page).to have_content "my other annotation"
|
||||||
expect(page).to have_content("replying in single annotation thread")
|
expect(page).to have_content "replying in single annotation thread"
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Reply on a multiple annotation thread and display it in the single annotation thread" do
|
scenario "Reply on a multiple annotation thread and display it in the single annotation thread" do
|
||||||
within("#annotation-link") do
|
click_link "2 comment"
|
||||||
find(".icon-expand").click
|
|
||||||
end
|
|
||||||
|
|
||||||
within("#comment_#{comment2.id}") do
|
within("#comment_#{comment2.id}") do
|
||||||
click_link "Reply"
|
click_link "Reply"
|
||||||
|
|||||||
@@ -47,14 +47,6 @@ describe "Proposal's dashboard" do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Dashboard progress show proposed actions" do
|
|
||||||
action = create(:dashboard_action, :proposed_action, :active)
|
|
||||||
|
|
||||||
visit progress_proposal_dashboard_path(proposal)
|
|
||||||
|
|
||||||
expect(page).to have_content(action.title)
|
|
||||||
end
|
|
||||||
|
|
||||||
scenario "Dashboard progress show proposed actions truncated description" do
|
scenario "Dashboard progress show proposed actions truncated description" do
|
||||||
action = create(:dashboard_action, :proposed_action, :active, description: "One short action")
|
action = create(:dashboard_action, :proposed_action, :active, description: "One short action")
|
||||||
action_long = create(:dashboard_action, :proposed_action, :active,
|
action_long = create(:dashboard_action, :proposed_action, :active,
|
||||||
@@ -100,45 +92,42 @@ describe "Proposal's dashboard" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "Dashboard progress display proposed_action pending on his section" do
|
scenario "Dashboard progress display proposed_action pending on his section" do
|
||||||
action = create(:dashboard_action, :proposed_action, :active)
|
create(:dashboard_action, :proposed_action, :active, title: "Expand!")
|
||||||
|
|
||||||
visit progress_proposal_dashboard_path(proposal)
|
visit progress_proposal_dashboard_path(proposal)
|
||||||
|
|
||||||
within "#proposed_actions_pending" do
|
within "#proposed_actions_pending" do
|
||||||
expect(page).to have_content(action.title)
|
expect(page).to have_content "Expand!"
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
scenario "Dashboard progress display proposed_action done on his section" do
|
click_button "Mark Expand! as done"
|
||||||
action = create(:dashboard_action, :proposed_action, :active)
|
|
||||||
|
|
||||||
visit progress_proposal_dashboard_path(proposal)
|
|
||||||
find(:css, "#dashboard_action_#{action.id}_execute").click
|
|
||||||
|
|
||||||
within "#proposed_actions_done" do
|
within "#proposed_actions_done" do
|
||||||
expect(page).to have_content(action.title)
|
expect(page).to have_content "Expand!"
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
scenario "Dashboard progress can execute proposed action" do
|
expect(page).not_to have_button "Mark Expand! as done"
|
||||||
action = create(:dashboard_action, :proposed_action, :active)
|
expect(page).to have_button "Unmark Expand! as done"
|
||||||
|
|
||||||
visit progress_proposal_dashboard_path(proposal)
|
|
||||||
expect(page).to have_content(action.title)
|
|
||||||
|
|
||||||
find(:css, "#dashboard_action_#{action.id}_execute").click
|
|
||||||
expect(page).not_to have_css "#dashboard_action_#{action.id}_execute"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Dashboard progress can unexecute proposed action" do
|
scenario "Dashboard progress can unexecute proposed action" do
|
||||||
action = create(:dashboard_action, :proposed_action, :active)
|
action = create(:dashboard_action, :proposed_action, :active, title: "Reinforce!")
|
||||||
create(:dashboard_executed_action, proposal: proposal, action: action)
|
create(:dashboard_executed_action, proposal: proposal, action: action)
|
||||||
|
|
||||||
visit progress_proposal_dashboard_path(proposal)
|
visit progress_proposal_dashboard_path(proposal)
|
||||||
expect(page).to have_content(action.title)
|
|
||||||
|
|
||||||
find(:css, "#dashboard_action_#{action.id}_unexecute").click
|
within "#proposed_actions_done" do
|
||||||
expect(page).to have_css "#dashboard_action_#{action.id}_execute"
|
expect(page).to have_content "Reinforce!"
|
||||||
|
end
|
||||||
|
|
||||||
|
click_button "Unmark Reinforce! as done"
|
||||||
|
|
||||||
|
within "#proposed_actions_pending" do
|
||||||
|
expect(page).to have_content "Reinforce!"
|
||||||
|
end
|
||||||
|
|
||||||
|
expect(page).not_to have_button "Unmark Reinforce! as done"
|
||||||
|
expect(page).to have_button "Mark Reinforce! as done"
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Dashboard progress dont show proposed actions with published_proposal: true" do
|
scenario "Dashboard progress dont show proposed actions with published_proposal: true" do
|
||||||
@@ -472,10 +461,10 @@ describe "Proposal's dashboard" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "On recommended actions section display proposed_action done on his section" do
|
scenario "On recommended actions section display proposed_action done on his section" do
|
||||||
action = create(:dashboard_action, :proposed_action, :active)
|
action = create(:dashboard_action, :proposed_action, :active, title: "Make progress")
|
||||||
|
|
||||||
visit recommended_actions_proposal_dashboard_path(proposal.to_param)
|
visit recommended_actions_proposal_dashboard_path(proposal.to_param)
|
||||||
find(:css, "#dashboard_action_#{action.id}_execute").click
|
click_button "Mark Make progress as done"
|
||||||
|
|
||||||
within "#proposed_actions_done" do
|
within "#proposed_actions_done" do
|
||||||
expect(page).to have_content(action.title)
|
expect(page).to have_content(action.title)
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ describe "Legislation" do
|
|||||||
scenario "empty process" do
|
scenario "empty process" do
|
||||||
process = create(:legislation_process, :empty,
|
process = create(:legislation_process, :empty,
|
||||||
result_publication_enabled: true,
|
result_publication_enabled: true,
|
||||||
|
result_publication_date: 1.day.ago,
|
||||||
end_date: Date.current - 1.day)
|
end_date: Date.current - 1.day)
|
||||||
|
|
||||||
visit summary_legislation_process_path(process)
|
visit summary_legislation_process_path(process)
|
||||||
|
|||||||
@@ -27,18 +27,20 @@ describe "Account" do
|
|||||||
expect(email).to have_text "Change your password"
|
expect(email).to have_text "Change your password"
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Manager changes the password by hand (writen by them)" do
|
scenario "Manager manually writes the new password" do
|
||||||
user = create(:user, :level_three)
|
user = create(:user, :level_three)
|
||||||
login_managed_user(user)
|
login_managed_user(user)
|
||||||
|
|
||||||
login_as_manager
|
login_as_manager
|
||||||
click_link "Reset password manually"
|
click_link "Reset password manually"
|
||||||
|
|
||||||
find(:css, "input[id$='user_password']").set("new_password")
|
fill_in "Password", with: "new_password"
|
||||||
|
|
||||||
click_button "Save password"
|
click_button "Save password"
|
||||||
|
|
||||||
expect(page).to have_content "Password reseted successfully"
|
expect(page).to have_content "Password reseted successfully"
|
||||||
|
expect(page).to have_link "Print password", href: "javascript:window.print();"
|
||||||
|
expect(page).to have_css "div.for-print-only", text: "new_password", visible: :hidden
|
||||||
|
|
||||||
logout
|
logout
|
||||||
|
|
||||||
@@ -57,6 +59,19 @@ describe "Account" do
|
|||||||
|
|
||||||
new_password = find_field("user_password").value
|
new_password = find_field("user_password").value
|
||||||
|
|
||||||
|
expect(page).to have_field "Password", type: :password
|
||||||
|
expect(page).to have_css "button[aria-pressed=false]", exact_text: "Show password"
|
||||||
|
|
||||||
|
click_button "Show password"
|
||||||
|
|
||||||
|
expect(page).to have_field "Password", type: :text
|
||||||
|
expect(page).to have_css "button[aria-pressed=true]", exact_text: "Show password"
|
||||||
|
|
||||||
|
click_button "Show password"
|
||||||
|
|
||||||
|
expect(page).to have_field "Password", type: :password
|
||||||
|
expect(page).to have_css "button[aria-pressed=false]", exact_text: "Show password"
|
||||||
|
|
||||||
click_button "Save password"
|
click_button "Save password"
|
||||||
|
|
||||||
expect(page).to have_content "Password reseted successfully"
|
expect(page).to have_content "Password reseted successfully"
|
||||||
@@ -68,22 +83,6 @@ describe "Account" do
|
|||||||
expect(page).to have_content "You have been signed in successfully."
|
expect(page).to have_content "You have been signed in successfully."
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "The password is printed" do
|
|
||||||
user = create(:user, :level_three)
|
|
||||||
login_managed_user(user)
|
|
||||||
|
|
||||||
login_as_manager
|
|
||||||
click_link "Reset password manually"
|
|
||||||
|
|
||||||
find(:css, "input[id$='user_password']").set("another_new_password")
|
|
||||||
|
|
||||||
click_button "Save password"
|
|
||||||
|
|
||||||
expect(page).to have_content "Password reseted successfully"
|
|
||||||
expect(page).to have_link "Print password", href: "javascript:window.print();"
|
|
||||||
expect(page).to have_css("div.for-print-only", text: "another_new_password", visible: :hidden)
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "When a user has not been selected" do
|
describe "When a user has not been selected" do
|
||||||
before do
|
before do
|
||||||
Setting["feature.user.skip_verification"] = "true"
|
Setting["feature.user.skip_verification"] = "true"
|
||||||
|
|||||||
Reference in New Issue
Block a user