aboutsummaryrefslogtreecommitdiff
path: root/test/system
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-11 22:45:05 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-11 22:51:23 +0100
commitc0befbd02559591b0c2871ea9cef1e4d913b9ef6 (patch)
tree60c6a6fbc2f7145499ee9cbe0ab3ad6f7cf73b64 /test/system
parent2a4fedb96791cd80bd6092a0b508f265e4d35348 (diff)
downloadoperum-c0befbd02559591b0c2871ea9cef1e4d913b9ef6.tar.gz
operum-c0befbd02559591b0c2871ea9cef1e4d913b9ef6.zip
Allow searching from a given tag
This feature is useful if you want to have a quick search on how many resources apply for a single tag. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'test/system')
-rw-r--r--test/system/tags_test.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/system/tags_test.rb b/test/system/tags_test.rb
index a690007..cf19e4f 100644
--- a/test/system/tags_test.rb
+++ b/test/system/tags_test.rb
@@ -2,7 +2,7 @@
require 'application_system_test_case'
-class SharedSearchesTest < ApplicationSystemTestCase
+class TagsTest < ApplicationSystemTestCase
setup { sign_in! }
test 'lists all the tags' do
@@ -34,7 +34,7 @@ class SharedSearchesTest < ApplicationSystemTestCase
test 'can visit the edit_tag path from #index' do
visit tags_url
- click_link(I18n.t('general.edit'), match: :first)
+ click_link(Tag.first.name, match: :first)
assert_text I18n.t('tags.update')
end
@@ -73,11 +73,18 @@ class SharedSearchesTest < ApplicationSystemTestCase
test 'can delete an existing tag' do
visit tags_url
- # TODO: flaky
assert_difference 'Tag.count', -1 do
click_link(I18n.t('general.delete'), match: :first)
assert_text I18n.t('tags.title')
end
end
+
+ test 'can search on a given tag' do
+ visit tags_url
+
+ click_link(I18n.t('searches.object'), match: :first)
+
+ assert_text Thing.find_by(target: 'target1').title
+ end
end