Truncate descriptions on the profile page

This commit is contained in:
R. Tyler Croy 2011-11-06 13:40:19 -08:00
parent 8af4606cdf
commit 0d050776a0
4 changed files with 13 additions and 5 deletions

View File

@ -1,4 +1,8 @@
Feature: Generate a user's profile
@views
Feature: Build a user profile
In order to find RCS repos to clone
As a user
I want to see a listing of a github user's events and projects
Scenario: Viewing a profile
Given a user named "mike"
@ -24,3 +28,5 @@ Feature: Generate a user's profile
Given a user with 1 timeline events
When I visit the user's profile
Then I should see 1 timeline events
# vim: ft=cucumber sw=2 ts=2 et

View File

@ -12,7 +12,7 @@ end
Given /^a user with (\d+) repositories$/ do |count|
repos = []
count.to_i.times do |i|
repo = {"name" => "repo_#{i}"}
repo = {"name" => "repo_#{i}", "description" => "Simple Repo #{i}"}
repos << repo
end
RCSHub::API::GitHub.any_instance.expects(:repos_for_user).

View File

@ -52,11 +52,11 @@ module RCSHub
private
def fetch_repos_for(username)
return self.class.get("#{BASE_URL}/users/#{username}/repos")
return self.class.get("#{BASE_URL}/users/#{username}/repos?per_page=100")
end
def fetch_tree_for(username, repo)
return self.class.get("#{BASE_URL}/repos/#{username}/#{repo}/git/trees/HEAD")
return self.class.get("#{BASE_URL}/repos/#{username}/#{repo}/git/trees/HEAD?per_page=100")
end
end

View File

@ -45,4 +45,6 @@
%td{:align => "right"}
\-
%td
&nbsp;#{r["description"]}
&nbsp;#{r["description"][0 .. 80]}
- if r["description"].length > 80
\...