From 4e630f50cc127119cc087b07438588d44b16f8c6 Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 6 Oct 2019 18:05:13 -0500 Subject: [PATCH] post tooltips: add system tests. --- test/system/post_tooltip_test.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/system/post_tooltip_test.rb diff --git a/test/system/post_tooltip_test.rb b/test/system/post_tooltip_test.rb new file mode 100644 index 000000000..88095ed07 --- /dev/null +++ b/test/system/post_tooltip_test.rb @@ -0,0 +1,30 @@ +require "application_system_test_case" + +class PostTooltipTest < ApplicationSystemTestCase + context "Post tooltips" do + setup do + @post = create(:post, file_ext: "swf") + puts @post.preview_file_url + end + + context "on a post thumbnail" do + should "show the tooltip when hovering over the thumbnail" do + visit posts_path + + find(".post-preview img").hover + assert_selector ".post-tooltip" + end + end + + context "on a post #xxx link" do + should "show the tooltip when hovering over the link" do + user = create(:user, created_at: 1.month.ago) + comment = as(user) { create(:comment, post: @post, body: "post ##{@post.id}") } + + visit comment_path(comment) + find(".dtext-post-id-link").hover + assert_selector ".post-tooltip" + end + end + end +end