Commit 6c8893cb authored by Walmyr Lima's avatar Walmyr Lima

Simplify a bunch of tests

In places where we are not using the issue title, let's use the
default one.

Also, let's visit the issue right after its fabrication in a shorter
way to reduce the code size.
parent d83fd708
...@@ -28,7 +28,6 @@ module QA ...@@ -28,7 +28,6 @@ module QA
Flow::Project.add_member(project: project, username: user.username) Flow::Project.add_member(project: project, username: user.username)
Resource::Issue.fabricate_via_api! do |issue| Resource::Issue.fabricate_via_api! do |issue|
issue.title = 'issue title'
issue.project = project issue.project = project
end.visit! end.visit!
......
...@@ -8,9 +8,7 @@ module QA ...@@ -8,9 +8,7 @@ module QA
before do before do
Flow::Login.sign_in Flow::Login.sign_in
Resource::Issue.fabricate_via_api! do |issue| Resource::Issue.fabricate_via_api!.visit!
issue.title = 'issue title'
end.visit!
Page::Project::Issue::Show.perform do |show| Page::Project::Issue::Show.perform do |show|
show.select_all_activities_filter show.select_all_activities_filter
......
...@@ -6,9 +6,7 @@ module QA ...@@ -6,9 +6,7 @@ module QA
before do before do
Flow::Login.sign_in Flow::Login.sign_in
Resource::Issue.fabricate_via_api! do |issue| Resource::Issue.fabricate_via_api!.visit!
issue.title = 'issue title'
end.visit!
end end
it 'user comments on an issue and edits the comment' do it 'user comments on an issue and edits the comment' do
......
...@@ -3,16 +3,12 @@ ...@@ -3,16 +3,12 @@
module QA module QA
context 'Plan', :smoke do context 'Plan', :smoke do
describe 'Issue creation' do describe 'Issue creation' do
let(:issue_title) { 'issue title' }
before do before do
Flow::Login.sign_in Flow::Login.sign_in
end end
it 'user creates an issue' do it 'user creates an issue' do
issue = Resource::Issue.fabricate_via_browser_ui! do |issue| issue = Resource::Issue.fabricate_via_browser_ui!
issue.title = issue_title
end
Page::Project::Menu.perform(&:click_issues) Page::Project::Menu.perform(&:click_issues)
...@@ -28,9 +24,7 @@ module QA ...@@ -28,9 +24,7 @@ module QA
end end
before do before do
Resource::Issue.fabricate_via_api! do |issue| Resource::Issue.fabricate_via_api!.visit!
issue.title = issue_title
end.visit!
end end
it 'user comments on an issue with an attachment' do it 'user comments on an issue with an attachment' do
......
...@@ -3,14 +3,10 @@ ...@@ -3,14 +3,10 @@
module QA module QA
context 'Plan' do context 'Plan' do
describe 'filter issue comments activities' do describe 'filter issue comments activities' do
let(:issue_title) { 'issue title' }
before do before do
Flow::Login.sign_in Flow::Login.sign_in
Resource::Issue.fabricate_via_api! do |issue| Resource::Issue.fabricate_via_api!.visit!
issue.title = issue_title
end.visit!
end end
it 'user filters comments and activities in an issue' do it 'user filters comments and activities in an issue' do
......
...@@ -16,7 +16,6 @@ module QA ...@@ -16,7 +16,6 @@ module QA
project.add_member(@user) project.add_member(@user)
Resource::Issue.fabricate_via_api! do |issue| Resource::Issue.fabricate_via_api! do |issue|
issue.title = 'issue to test mention'
issue.project = project issue.project = project
end.visit! end.visit!
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