aboutsummaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2024-03-20 13:59:15 +0100
committerMiquel Sabaté Solà <msabate@suse.com>2024-03-20 13:59:15 +0100
commitccf588845a6e595d1c9b2726a05eddd34bc92488 (patch)
tree80ff56c17f5723ae8fff4f164bd0466df42ca348 /test/system
parent37d4967780f5b3dd06bb05337149811d7d7f8788 (diff)
downloadoperum-ccf588845a6e595d1c9b2726a05eddd34bc92488.tar.gz
operum-ccf588845a6e595d1c9b2726a05eddd34bc92488.zip
tags: added a way to update tags
It's useful to just rename tags which have quite some references that you don't want to nuke. Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'test/system')
-rw-r--r--test/system/tags_test.rb29
1 files changed, 28 insertions, 1 deletions
diff --git a/test/system/tags_test.rb b/test/system/tags_test.rb
index 8789087..7e2100f 100644
--- a/test/system/tags_test.rb
+++ b/test/system/tags_test.rb
@@ -22,7 +22,7 @@ class SharedSearchesTest < ApplicationSystemTestCase
end
end
- test 'gives feedback on errors' do
+ test 'gives feedback on create errors' do
visit new_tag_url
fill_in I18n.t('activerecord.attributes.tag.name'), with: tags(:tag1).name
@@ -31,6 +31,33 @@ class SharedSearchesTest < ApplicationSystemTestCase
assert_text "#{I18n.t('activerecord.attributes.tag.name')} #{I18n.t('errors.messages.taken')}"
end
+ test 'can visit the edit_tag path from #index' do
+ visit tags_url
+
+ click_link(I18n.t('general.edit'), match: :first)
+
+ assert_text I18n.t('tags.update')
+ end
+
+ test 'can update a tag' do
+ visit edit_tag_url(tags(:tag1))
+
+ fill_in I18n.t('activerecord.attributes.tag.name'), with: "#{tags(:tag1).name}-updated"
+ click_on I18n.t('helpers.submit.update')
+
+ assert_text I18n.t('tags.update-success')
+ assert_text "#{tags(:tag1).name}-updated"
+ end
+
+ test 'gives feedback on update errors' do
+ visit edit_tag_url(tags(:tag1))
+
+ fill_in I18n.t('activerecord.attributes.tag.name'), with: tags(:tag2).name
+ click_on I18n.t('helpers.submit.update')
+
+ assert_text "#{I18n.t('activerecord.attributes.tag.name')} #{I18n.t('errors.messages.taken')}"
+ end
+
test 'can delete an existing tag' do
visit tags_url