diff options
Diffstat (limited to 'qa/qa/resource/repository/wiki_push.rb')
-rw-r--r-- | qa/qa/resource/repository/wiki_push.rb | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/qa/qa/resource/repository/wiki_push.rb b/qa/qa/resource/repository/wiki_push.rb index e926c00d380..edf76c7cd78 100644 --- a/qa/qa/resource/repository/wiki_push.rb +++ b/qa/qa/resource/repository/wiki_push.rb @@ -5,17 +5,17 @@ module QA module Repository class WikiPush < Repository::Push attribute :wiki do - Wiki.fabricate! do |resource| + # We are using the project based wiki as a standard. + Wiki::ProjectPage.fabricate_via_api! do |resource| resource.title = 'Home' resource.content = '# My First Wiki Content' - resource.message = 'Update home' end end def initialize @file_name = 'Home.md' - @file_content = '# Welcome to My Wiki' - @commit_message = 'Updating Home Page' + @file_content = 'This line was created using git push' + @commit_message = 'Updating using git push' @branch_name = 'master' @new_branch = false end @@ -28,9 +28,12 @@ module QA @repository_ssh_uri ||= wiki.repository_ssh_location.uri end - def fabricate! - super - wiki.visit! + def web_url + # TODO + # workaround + # i.e. This replaces the last occurence of the string (case sensitive) + # and attaches everything before to the new substring + repository_http_uri.to_s.gsub(/(.*)\b\.wiki\.git\b/i, "\\1/-/wikis/#{@file_name.gsub('.md', '')}") end end end |