summaryrefslogtreecommitdiff
path: root/qa/qa/page/main/oauth.rb
blob: bc44d2743143af4cfe7ea55cf2a3c793eafecca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module QA
  module Page
    module Main
      class OAuth < Page::Base
        view 'app/views/doorkeeper/authorizations/new.html.haml' do
          element :authorization_button, 'submit_tag _("Authorize")' # rubocop:disable QA/ElementWithPattern
        end

        def needs_authorization?
          page.current_url.include?('/oauth')
        end

        def authorize!
          click_button 'Authorize'
        end
      end
    end
  end
end