Unverified Commit ad596d8d authored by cmrd Senya's avatar cmrd Senya Committed by Steffen van Bergerem
Browse files

Fix tags URLs in hovercards

fixes #7074

closes #7075
parent e27af6ee
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@
* Closed accounts will no longer show up in the account search [#7042](https://github.com/diaspora/diaspora/pull/7042)
* Code blocks in conversations no longer overflow the content [#7055](https://github.com/diaspora/diaspora/pull/7055)
* More buttons in mobile streams are fixed [#7036](https://github.com/diaspora/diaspora/pull/7036)
* Fixed missing sidebar background in the contacts tab [#7064](https://github.com/diaspora/diaspora/pull/7064)
* Fix tags URLs in hovercards [#7075](https://github.com/diaspora/diaspora/pull/7075)

## Features
* Deleted comments will be removed when loading more comments [#7045](https://github.com/diaspora/diaspora/pull/7045)
+1 −1
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ app.views.Hovercard = app.views.Base.extend({
      // set hashtags
      this.hashtags.empty();
      this.hashtags.html($(_.map(person.profile.tags, function(tag) {
        return $("<a/>", {href: "/tags/" + tag.substring(1)}).text(tag)[0];
        return $("<a/>", {href: Routes.tag(tag)}).text("#" + tag)[0];
      })));
    }
  },
+10 −0
Original line number Diff line number Diff line
@@ -39,3 +39,13 @@ Feature: Hovercards
    Then I should see a hovercard
    When I deactivate the first hovercard
    Then I should not see a hovercard

  Scenario: Hovercards contain profile tags
    Given a user with email "bob@bob.bob" is tagged "#first #second"
    And I sign in as "alice@alice.alice"
    And I am on "bob@bob.bob"'s page
    Then I should see "public stuff" within ".stream_element"
    When I activate the first hovercard
    Then I should see a hovercard
    And I should see "#first" hashtag in the hovercard
    And I should see "#second" hashtag in the hovercard
+5 −0
Original line number Diff line number Diff line
@@ -6,6 +6,11 @@ Then(/^I should see a hovercard$/) do
  page.should have_css('#hovercard', visible: true)
end

Then(/^I should see "([^"]*)" hashtag in the hovercard$/) do |tag|
  element = find("#hovercard .hashtags a", text: tag)
  expect(element["href"]).to include("/tags/#{tag.slice(1, tag.length)}")
end

When(/^I deactivate the first hovercard$/) do
  page.execute_script("$('.hovercardable').first().trigger('mouseleave');")
end
+7 −0
Original line number Diff line number Diff line
@@ -100,6 +100,13 @@ Given /^there is a user "([^\"]*)" who's tagged "([^\"]*)"$/ do |full_name, tag|
  user.profile.save!
end

Given /^a user with email "([^\"]*)" is tagged "([^\"]*)"$/ do |email, tags|
  user = User.find_by_email(email)
  user.profile.tag_string = tags
  user.profile.build_tags
  user.profile.save!
end

Given /^many posts from alice for bob$/ do
  alice = FactoryGirl.create(:user_with_aspect, :username => 'alice', :email => 'alice@alice.alice', :password => 'password', :getting_started => false)
  bob = FactoryGirl.create(:user_with_aspect, :username => 'bob', :email => 'bob@bob.bob', :password => 'password', :getting_started => false)
Loading