Commit ed910316 authored by Rafael Reggiani Manzo's avatar Rafael Reggiani Manzo

Merge branch 'fix_acceptance_test_that_breaks_randomly' into 'master'

Drop first element of occupation list on acceptance tests

The profile creation feature was randomly breaking because the
occupation field sometimes was not filled.

That happened because of the way we selected an option of the occupation
list: we fetched all the options, and chose one randomly. The problem
was that the list of fetched options came with the placeholder that has
nil value. Therefore, sometimes we chose the nil value and used it to
submit the form. For we have a presence validation for the occupation
attribute, the test failed.

Now, we remove the first option of the fetched list before choosing an
occupation. Because the fetched options come on the same order defined
on the dropdown, the first option is always the one with the nil value.
Therefore, we won't submit the form without the occupation attribute set
correctly.

This closes #5Signed-off-by: marcheing's avatarHeitor Reis <marcheing@gmail.com>

See merge request !12
parents dbf8818b d7714ff6
Pipeline #3620613 passed with stage
in 9 minutes and 51 seconds
......@@ -47,7 +47,8 @@ Given(/^I select the state "(.*?)"$/) do |state|
end
Given(/^I select any occupation$/) do
option = all('#profile_occupation option').sample.text
# We have to drop the first element because it is the placeholder element of the dropdown
option = all('#profile_occupation option').drop(1).sample.text
step "I select \"#{option}\" from \"profile_occupation\""
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