summaryrefslogtreecommitdiff
path: root/qa/qa/factory/settings/hashed_storage.rb
blob: c69ebed3c6b1cb1c9534dc6381d3bf0fb97c25fb (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
module QA
  module Factory
    module Settings
      class HashedStorage < Factory::Base
        def fabricate!(*traits)
          raise ArgumentError unless traits.include?(:enabled)

          Page::Main::Login.act { sign_in_using_credentials }
          Page::Menu::Main.act { go_to_admin_area }
          Page::Menu::Admin.act { go_to_settings }

          Page::Admin::Settings::Main.perform do |setting|
            setting.expand_repository_storage do |page|
              page.enable_hashed_storage
              page.save_settings
            end
          end

          QA::Page::Menu::Main.act { sign_out }
        end
      end
    end
  end
end