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,9 +37,12 @@ module QA ...@@ -37,9 +37,12 @@ module QA
let(:issue) { create_issue_resource } let(:issue) { create_issue_resource }
let(:epic) { create_epic_resource(issue.project.group) } let(:epic) { create_epic_resource(issue.project.group) }
it 'adds/removes issue to/from epic' do context 'Visit epic first' do
before do
epic.visit! epic.visit!
end
it 'adds/removes issue to/from epic' do
EE::Page::Group::Epic::Show.perform do |show| EE::Page::Group::Epic::Show.perform do |show|
show.add_issue_to_epic(issue.web_url) show.add_issue_to_epic(issue.web_url)
...@@ -52,8 +55,6 @@ module QA ...@@ -52,8 +55,6 @@ module QA
end end
it 'comments on epic' do it 'comments on epic' do
epic.visit!
comment = 'My Epic Comment' comment = 'My Epic Comment'
EE::Page::Group::Epic::Show.perform do |show| EE::Page::Group::Epic::Show.perform do |show|
show.add_comment_to_epic(comment) show.add_comment_to_epic(comment)
...@@ -63,8 +64,6 @@ module QA ...@@ -63,8 +64,6 @@ module QA
end end
it 'closes and reopens an epic' do it 'closes and reopens an epic' do
epic.visit!
EE::Page::Group::Epic::Show.perform(&:close_reopen_epic) EE::Page::Group::Epic::Show.perform(&:close_reopen_epic)
expect(page).to have_content('Closed') expect(page).to have_content('Closed')
...@@ -73,6 +72,7 @@ module QA ...@@ -73,6 +72,7 @@ module QA
expect(page).to have_content('Open') expect(page).to have_content('Open')
end end
end
it 'adds/removes issue to/from epic using quick actions' do it 'adds/removes issue to/from epic using quick actions' do
issue.visit! issue.visit!
......
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