Commit 2518aef0 authored by Walmyr Lima e Silva Filho's avatar Walmyr Lima e Silva Filho Committed by Dan Davison

Create assignee board list resource

And autoload it.
parent c26add1e
...@@ -193,6 +193,7 @@ module QA ...@@ -193,6 +193,7 @@ module QA
module Project module Project
autoload :BaseBoardList, 'qa/ee/resource/board/board_list/project/base_board_list' autoload :BaseBoardList, 'qa/ee/resource/board/board_list/project/base_board_list'
autoload :AssigneeBoardList, 'qa/ee/resource/board/board_list/project/assignee_board_list'
autoload :LabelBoardList, 'qa/ee/resource/board/board_list/project/label_board_list' autoload :LabelBoardList, 'qa/ee/resource/board/board_list/project/label_board_list'
autoload :MilestoneBoardList, 'qa/ee/resource/board/board_list/project/milestone_board_list' autoload :MilestoneBoardList, 'qa/ee/resource/board/board_list/project/milestone_board_list'
end end
......
# frozen_string_literal: true
module QA
module EE
module Resource
module Board
module BoardList
module Project
class AssigneeBoardList < BaseBoardList
attribute :assignee
def api_post_body
{
board_id: board.id,
assignee_id: assignee.id
}
end
end
end
end
end
end
end
end
...@@ -23,8 +23,7 @@ module QA ...@@ -23,8 +23,7 @@ module QA
issue.labels = [label] issue.labels = [label]
end end
label_board_list.project.visit! go_to_project_board(label_board_list.project)
Page::Project::Menu.perform(&:go_to_boards)
end end
it 'shows the just created board with a "Doing" (label) list, and an issue on it' do it 'shows the just created board with a "Doing" (label) list, and an issue on it' do
...@@ -48,8 +47,7 @@ module QA ...@@ -48,8 +47,7 @@ module QA
issue.milestone = milestone_board_list.project_milestone issue.milestone = milestone_board_list.project_milestone
end end
milestone_board_list.project.visit! go_to_project_board(milestone_board_list.project)
Page::Project::Menu.perform(&:go_to_boards)
end end
it 'shows the just created board with a "1.0" (milestone) list, and an issue on it' do it 'shows the just created board with a "1.0" (milestone) list, and an issue on it' do
...@@ -60,6 +58,46 @@ module QA ...@@ -60,6 +58,46 @@ module QA
end end
end end
end end
context 'Assignee issue board' do
before do
@user = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
project = Resource::Project.fabricate_via_api! do |resource|
resource.name = 'project-to-test-assignee-issue-board-list'
end
project.add_member(@user)
Resource::Issue.fabricate_via_api! do |issue|
issue.assignee_ids = [@user.id]
issue.project = project
issue.title = issue_title
end
@assignee_board_list = EE::Resource::Board::BoardList::Project::AssigneeBoardList.fabricate_via_api! do |board_list|
board_list.assignee = @user
board_list.project = project
end
go_to_project_board(project)
end
it 'shows the just created board with an assignee list, and an issue on it' do
EE::Page::Component::IssueBoard::Show.perform do |show|
expect(show.boards_dropdown).to have_content(@assignee_board_list.board.name)
expect(show.boards_list_header_with_index(1)).to have_content(@user.name)
expect(show.card_of_list_with_index(1)).to have_content(issue_title)
end
end
end
private
def go_to_project_board(project)
project.visit!
Page::Project::Menu.perform(&:go_to_boards)
end
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment