Shorten some end-to-end tests

When we are fabricating a resource that is returnedi, and the only
thing we want to do with such a resource is visiting it after its
fabrication, we can call the visit! method directly after its fa-
brication without the need for a variable definition.
parent 69991f26
......@@ -6,12 +6,11 @@ module QA
it 'user creates an event in the activity page upon Git push' do
Flow::Login.sign_in
project_push = Resource::Repository::ProjectPush.fabricate! do |push|
Resource::Repository::ProjectPush.fabricate! do |push|
push.file_name = 'README.md'
push.file_content = '# This is a test project'
push.commit_message = 'Add README.md'
end
project_push.project.visit!
end.project.visit!
Page::Project::Menu.perform(&:click_activity)
Page::Project::Activity.perform(&:click_push_events)
......
......@@ -20,8 +20,7 @@ module QA
before do
Flow::Login.sign_in
group = Resource::Group.fabricate_via_api!
group.visit!
Resource::Group.fabricate_via_api!.visit!
Page::Group::Menu.perform(&:click_group_insights_link)
end
......
......@@ -81,8 +81,7 @@ module QA
expect(templates.current_custom_project_template).to include @template_container_group_name
end
group = Resource::Group.fabricate_via_api!
group.visit!
Resource::Group.fabricate_via_api!.visit!
Page::Group::Show.perform(&:go_to_new_project)
......
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