Skip to content

Commit

Permalink
Merge remote-tracking branch 'wilkie/bugfix/alps-missing-rels'
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed May 27, 2013
2 parents a04dd01 + 1e4cf45 commit 50b8d4f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/views/shared/sidebar/_profile.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
@#{current_user.username}
%ul.stats
%li.update-count
%a{ :href => "/users/#{current_user.username}" }
%a{ :href => "/users/#{current_user.username}", :rel => 'messages-me' }
.icon
%span.number= current_user.feed.updates.count
Updates
%li.following-count
%a{ :href => "/users/#{current_user.username}/following" }
%a{ :href => "/users/#{current_user.username}/following", :rel => 'users-friends' }
.icon
%span.number= current_user.following.length
Following
%li.follower-count.last
%a{ :href => "/users/#{current_user.username}/followers" }
%a{ :href => "/users/#{current_user.username}/followers", :rel => 'users-followers' }
.icon
%span.number= current_user.followers.length
Followers
6 changes: 3 additions & 3 deletions app/views/users/show.haml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@

%ul.stats
%li.update-count
%a{ :href => "#profile_updates" }
%a{ :href => "#profile_updates", :rel => 'messages-me' }
%span.icon
%span.number= @author.feed.updates.count
Updates
%li.following-count
%a{ :href => "/users/#{@author.username}/following" }
%a{ :href => "/users/#{@author.username}/following", :rel => 'users-friends' }
%span.icon
%span.number= @author.user.following.length
Following
%li.follower-count
%a{ :href => "/users/#{@author.username}/followers" }
%a{ :href => "/users/#{@author.username}/followers", :rel => 'users-followers'}
%span.icon
%span.number= @author.user.followers.length
Followers
Expand Down
29 changes: 29 additions & 0 deletions test/acceptance/alps/user_profile_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,34 @@
end
end

it "has the followers link in a rel=users-followers" do
visit "/users/#{@user.username}"
within "li.user" do
assert has_selector?(
:xpath,
"//a[contains(@rel, 'users-followers') and @href='/users/#{@user.username}/followers']"
)
end
end

it "has the following link in a rel=users-friends" do
visit "/users/#{@user.username}"
within "li.user" do
assert has_selector?(
:xpath,
"//a[contains(@rel, 'users-friends') and @href='/users/#{@user.username}/following']"
)
end
end

it "has the updates link in a rel=messages-me" do
visit "/users/#{@user.username}"
within "li.user" do
assert has_selector?(
:xpath,
"//a[contains(@rel, 'messages-me') and @href='#profile_updates']"
)
end
end
end

0 comments on commit 50b8d4f

Please sign in to comment.