You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduction
First off, head to the edit_people_skills_spec.rb file and scroll to the test 'can edit people-skills' which should be on line 27. Then see what the test does. If you take a look at the 'validate_people_skill method' which is located in the people_skills_helper you will find even more validate methods called. Take a look at the 'validate_interest' method. You will see that the current implementation of validating interests is by checking the color of the filled out stars. This functionality should be replaced by simply checking if the star has been checked.
How does it work
Well the validation simply checks if the star(s) have the color they should have when beeing filled out / checked. Yet there is one important detail that has been forgotten. The hover effect. The hover effect displays a whole new color. How is that a problem? Well when capybara clicks on the star, the hover effect simply does not go away and the test fails.
Why is this important?
As a quick fix there is a line in the code that simply hovers another element to fix all of this. find('#person_people_skills_attributes_0_certificate').hover
The reason why this is harder than it seems is because the 'interest' param, does not seem to be correct. You will need to take a good look at that as well because it's reversed for some reason. This spec should change because of these reasons:
The unnecessary line of code can be removed
The test would be more clean and readable
It's way shorter to just check if the star has been checked
ToDo
Re-write the test with to be_checked
Make sure all tests still pass
Review
Merge Ⓜ️Ⓜ️
The text was updated successfully, but these errors were encountered:
Introduction
First off, head to the
edit_people_skills_spec.rb
file and scroll to the test 'can edit people-skills' which should be on line 27. Then see what the test does. If you take a look at the 'validate_people_skill method' which is located in thepeople_skills_helper
you will find even more validate methods called. Take a look at the 'validate_interest' method. You will see that the current implementation of validating interests is by checking the color of the filled out stars. This functionality should be replaced by simply checking if the star has been checked.How does it work
Well the validation simply checks if the star(s) have the color they should have when beeing filled out / checked. Yet there is one important detail that has been forgotten. The hover effect. The hover effect displays a whole new color. How is that a problem? Well when capybara clicks on the star, the hover effect simply does not go away and the test fails.
Why is this important?
As a quick fix there is a line in the code that simply hovers another element to fix all of this.
find('#person_people_skills_attributes_0_certificate').hover
The reason why this is harder than it seems is because the 'interest' param, does not seem to be correct. You will need to take a good look at that as well because it's reversed for some reason. This spec should change because of these reasons:
ToDo
to be_checked
The text was updated successfully, but these errors were encountered: