diff --git a/app/assets/templates/reshare_tpl.jst.hbs b/app/assets/templates/reshare_tpl.jst.hbs index b528bfc55..ef7b821f2 100644 --- a/app/assets/templates/reshare_tpl.jst.hbs +++ b/app/assets/templates/reshare_tpl.jst.hbs @@ -13,7 +13,7 @@ {{#with root}}
- {{author.name}} + {{author.name}} - diff --git a/features/desktop/hovercards.feature b/features/desktop/hovercards.feature index 54a63b4ab..7b5885829 100644 --- a/features/desktop/hovercards.feature +++ b/features/desktop/hovercards.feature @@ -8,9 +8,11 @@ Feature: Hovercards Given a user named "Bob Jones" with email "bob@bob.bob" And "bob@bob.bob" has a public post with text "public stuff" And a user named "Alice" with email "alice@alice.alice" + And "alice@alice.alice" has a public post with text "alice public stuff" + And the post with text "public stuff" is reshared by "alice@alice.alice" + And the post with text "alice public stuff" is reshared by "bob@bob.bob" And I sign in as "alice@alice.alice" - Scenario: Hovercards on the main stream Given I am on "bob@bob.bob"'s page Then I should see "public stuff" within ".stream_element" @@ -18,3 +20,13 @@ Feature: Hovercards Then I should see a hovercard When I deactivate the first hovercard Then I should not see a hovercard + + Scenario: Hovercards on the main stream in reshares + Given I am on "bob@bob.bob"'s page + Then I should see "Alice" within ".stream_element" + When I hover "Alice" within ".reshare" + Then I should not see a hovercard + When I am on "alice@alice.alice"'s page + Then I should see "Bob Jones" within ".stream_element" + When I hover "Bob Jones" within ".reshare" + Then I should see a hovercard diff --git a/features/step_definitions/hovercard_steps.rb b/features/step_definitions/hovercard_steps.rb index 949f41722..28ee6cb22 100644 --- a/features/step_definitions/hovercard_steps.rb +++ b/features/step_definitions/hovercard_steps.rb @@ -1,9 +1,9 @@ When(/^I activate the first hovercard$/) do - page.execute_script("$('.hovercardable').first().trigger('mouseenter');") + first('.hovercardable').hover end Then(/^I should see a hovercard$/) do - page.should have_css '#hovercard' + page.should have_css('#hovercard') end When(/^I deactivate the first hovercard$/) do @@ -11,5 +11,11 @@ When(/^I deactivate the first hovercard$/) do end Then(/^I should not see a hovercard$/) do - page.should_not have_css '#hovercard' + page.should_not have_css('#hovercard') +end + +When (/^I hover "([^"]*)" within "([^"]*)"$/) do |name, selector| + with_scope(selector) do + find(".author", text: name).hover + end end