diff --git a/features/desktop/hovercards.feature b/features/desktop/hovercards.feature index 54a63b4ab..c692d21e9 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 + When I am on "bob@bob.bob"'s page + Then I should see "alice public stuff" within ".reshare" + When I activate hovercard for "Alice" within ".reshare" + Then I should not see a hovercard + When I am on "alice@alice.alice"'s page + Then I should see "public stuff" within ".reshare" + When I activate hovercard for "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..64d7a0fcd 100644 --- a/features/step_definitions/hovercard_steps.rb +++ b/features/step_definitions/hovercard_steps.rb @@ -13,3 +13,9 @@ end Then(/^I should not see a hovercard$/) do page.should_not have_css '#hovercard' end + +When (/^I activate hovercard for "([^"]*)" within "([^"]*)"$/) do |name, selector| + with_scope(selector) do + page.execute_script("$('.author').filter(function(index){return $(this).text() === \"#{name}\";}).trigger('mouseenter');") + end +end