Add 'tag deleted successfully' flash message

This commit is contained in:
Anton Khorev 2024-11-09 13:37:39 +03:00
parent 071563add0
commit 8294fd46f0
3 changed files with 4 additions and 0 deletions

View file

@ -34,6 +34,7 @@ class ChangesetTagsController < ApplicationController
end
@changeset_tag.delete
flash[:notice] = t ".success", :k => @changeset_tag.k, :v => @changeset_tag.v
redirect_to changeset_tags_path(@changeset)
end
end

View file

@ -489,6 +489,8 @@ en:
tag_not_found:
heading: Changeset tag does not exist
body: "Sorry, tag %{k} could not be found in changeset #%{id}."
destroy:
success: Tag %{k}=%{v} deleted successfully.
changesets:
changeset:
no_edits: "(no edits)"

View file

@ -124,6 +124,7 @@ class ChangesetTagsControllerTest < ActionDispatch::IntegrationTest
assert_redirected_to changeset_tags_path(changeset)
end
assert_equal({ "tested-2nd-tag-key" => "tested-2nd-tag-value" }, changeset.tags)
assert_match(/tested-1st-tag-key=tested-1st-tag-value deleted successfully/, flash[:notice])
end
def test_destroy_success_empty_tag