Skip to content

Commit 85d63d0

Browse files
committed
タグショートカットのシステムテストを追加
1 parent eb195f1 commit 85d63d0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/system/article/tags_test.rb

+16
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,20 @@ class Article::TagsTest < ApplicationSystemTestCase
2020
created_article = Article.find_by(title: 'タグ追加のテスト記事')
2121
assert_equal tags, created_article.tag_list.sort
2222
end
23+
24+
test 'can add tag using shortcut buttons' do
25+
visit_with_auth new_article_url, 'komagata'
26+
fill_in 'タイトル', with: 'ショートカットボタンからのタグ追加テスト'
27+
fill_in '本文', with: 'タグショートカットボタンのテストです'
28+
find('button.tag-item', text: '注目の記事').click
29+
find('.tagify__input')
30+
assert_text '注目の記事'
31+
page.accept_confirm do
32+
click_on '公開する'
33+
end
34+
assert_text '記事を作成しました'
35+
36+
created_article = Article.find_by(title: 'ショートカットボタンからのタグ追加テスト')
37+
assert_includes created_article.tag_list, '注目の記事'
38+
end
2339
end

0 commit comments

Comments
 (0)