Commit bf977fa5 authored by Walmyr Lima's avatar Walmyr Lima

Remove duplication from test

This is being done by:
- Creating a new context for tests that have the same pre-condition
- Creating a before block for the pre-condition so it doesn't need
to be duplicated in all the three affected tests.
parent 4e8a7892
......@@ -37,41 +37,41 @@ module QA
let(:issue) { create_issue_resource }
let(:epic) { create_epic_resource(issue.project.group) }
it 'adds/removes issue to/from epic' do
epic.visit!
context 'Visit epic first' do
before do
epic.visit!
end
EE::Page::Group::Epic::Show.perform do |show|
show.add_issue_to_epic(issue.web_url)
it 'adds/removes issue to/from epic' do
EE::Page::Group::Epic::Show.perform do |show|
show.add_issue_to_epic(issue.web_url)
expect(show).to have_related_issue_item
expect(show).to have_related_issue_item
show.remove_issue_from_epic
show.remove_issue_from_epic
expect(show).to have_no_related_issue_item
expect(show).to have_no_related_issue_item
end
end
end
it 'comments on epic' do
epic.visit!
it 'comments on epic' do
comment = 'My Epic Comment'
EE::Page::Group::Epic::Show.perform do |show|
show.add_comment_to_epic(comment)
end
comment = 'My Epic Comment'
EE::Page::Group::Epic::Show.perform do |show|
show.add_comment_to_epic(comment)
expect(page).to have_content(comment)
end
expect(page).to have_content(comment)
end
it 'closes and reopens an epic' do
EE::Page::Group::Epic::Show.perform(&:close_reopen_epic)
it 'closes and reopens an epic' do
epic.visit!
EE::Page::Group::Epic::Show.perform(&:close_reopen_epic)
expect(page).to have_content('Closed')
expect(page).to have_content('Closed')
EE::Page::Group::Epic::Show.perform(&:close_reopen_epic)
EE::Page::Group::Epic::Show.perform(&:close_reopen_epic)
expect(page).to have_content('Open')
expect(page).to have_content('Open')
end
end
it 'adds/removes issue to/from epic using quick actions' do
......
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