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 ...@@ -6,12 +6,11 @@ module QA
it 'user creates an event in the activity page upon Git push' do it 'user creates an event in the activity page upon Git push' do
Flow::Login.sign_in 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_name = 'README.md'
push.file_content = '# This is a test project' push.file_content = '# This is a test project'
push.commit_message = 'Add README.md' push.commit_message = 'Add README.md'
end end.project.visit!
project_push.project.visit!
Page::Project::Menu.perform(&:click_activity) Page::Project::Menu.perform(&:click_activity)
Page::Project::Activity.perform(&:click_push_events) Page::Project::Activity.perform(&:click_push_events)
......
...@@ -20,8 +20,7 @@ module QA ...@@ -20,8 +20,7 @@ module QA
before do before do
Flow::Login.sign_in Flow::Login.sign_in
group = Resource::Group.fabricate_via_api! Resource::Group.fabricate_via_api!.visit!
group.visit!
Page::Group::Menu.perform(&:click_group_insights_link) Page::Group::Menu.perform(&:click_group_insights_link)
end end
......
...@@ -81,8 +81,7 @@ module QA ...@@ -81,8 +81,7 @@ module QA
expect(templates.current_custom_project_template).to include @template_container_group_name expect(templates.current_custom_project_template).to include @template_container_group_name
end end
group = Resource::Group.fabricate_via_api! Resource::Group.fabricate_via_api!.visit!
group.visit!
Page::Group::Show.perform(&:go_to_new_project) 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