aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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