summaryrefslogtreecommitdiff
path: root/qa/qa/resource/issue.rb
blob: 2c2f27fe231c115823301497c06bcc225fe2c341 (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
# frozen_string_literal: true

module QA
  module Resource
    class Issue < Base
      attr_writer :description

      attribute :project do
        Project.fabricate! do |resource|
          resource.name = 'project-for-issues'
          resource.description = 'project for adding issues'
        end
      end

      attribute :title

      def fabricate!
        project.visit!

        Page::Project::Show.perform(&:go_to_new_issue)

        Page::Project::Issue::New.perform do |page|
          page.add_title(@title)
          page.add_description(@description)
          page.create_new_issue
        end
      end
    end
  end
end