From c0befbd02559591b0c2871ea9cef1e4d913b9ef6 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 11 Nov 2024 22:45:05 +0100 Subject: Allow searching from a given tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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à --- test/system/tags_test.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'test/system') 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 -- cgit v1.2.3