Commit bca528a57c9276c0cd815d67fed4a72c514d53a2
1 parent
03472b4f
Exists in
spb-stable
and in
3 other branches
Better title format for wiki page
The title format for wiki page may be unintelligible. For example 'GitLab' is converted to 'Git Lab', 'MySQL' is converted to 'My Sql', etc.
Showing
7 changed files
with
26 additions
and
6 deletions
Show diff stats
app/models/wiki_page.rb
app/views/projects/wikis/edit.html.haml
app/views/projects/wikis/history.html.haml
app/views/projects/wikis/pages.html.haml
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | - @wiki_pages.each do |wiki_page| |
6 | 6 | %li |
7 | 7 | %h4 |
8 | - = link_to wiki_page.title.titleize, project_wiki_path(@project, wiki_page) | |
8 | + = link_to wiki_page.title, project_wiki_path(@project, wiki_page) | |
9 | 9 | %small (#{wiki_page.format}) |
10 | 10 | .pull-right |
11 | 11 | %small Last edited #{time_ago_with_tooltip(wiki_page.commit.created_at)} | ... | ... |
app/views/projects/wikis/show.html.haml
features/steps/project/wiki.rb
... | ... | @@ -83,7 +83,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps |
83 | 83 | |
84 | 84 | Then 'I should see the existing page in the pages list' do |
85 | 85 | page.should have_content current_user.name |
86 | - page.should have_content @page.title.titleize | |
86 | + page.should have_content @page.title | |
87 | 87 | end |
88 | 88 | |
89 | 89 | def wiki | ... | ... |
spec/models/wiki_page_spec.rb
... | ... | @@ -155,4 +155,20 @@ describe WikiPage do |
155 | 155 | end |
156 | 156 | end |
157 | 157 | |
158 | + describe "#title" do | |
159 | + before do | |
160 | + create_page("Title", "content") | |
161 | + @page = wiki.find_page("Title") | |
162 | + end | |
163 | + | |
164 | + after do | |
165 | + destroy_page("Title") | |
166 | + end | |
167 | + | |
168 | + it "should be replace a hyphen to a space" do | |
169 | + @page.title = "Import-existing-repositories-into-GitLab" | |
170 | + @page.title.should == "Import existing repositories into GitLab" | |
171 | + end | |
172 | + end | |
173 | + | |
158 | 174 | end | ... | ... |