summaryrefslogtreecommitdiff
path: root/qa/qa/factory/repository/wiki_push.rb
blob: 25b6ffe8323154440993b73de7fb2469111bdb71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
module QA
  module Factory
    module Repository
      class WikiPush < Factory::Repository::Push
        attribute :wiki do
          Factory::Resource::Wiki.fabricate! 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'
          @branch_name = 'master'
          @new_branch = false
        end

        def repository_http_uri
          @repository_http_uri ||= begin
            wiki.visit!
            Page::Project::Wiki::Show.act do
              go_to_clone_repository
              choose_repository_clone_http
              repository_location.uri
            end
          end
        end
      end
    end
  end
end