Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fragile tests (should use 'has_css' matcher instead of 'include') #158

Open
denny opened this issue Jan 16, 2020 · 2 comments
Open

Fix fragile tests (should use 'has_css' matcher instead of 'include') #158

denny opened this issue Jan 16, 2020 · 2 comments
Labels
bug About something that is broken good first issue This issue should be suitable for less experienced developers help offered I would be very happy to help less experienced developers tackle this issue (advice/pairing/etc) tests Tests and test infrastructure (CI, etc)

Comments

@denny
Copy link
Owner

denny commented Jan 16, 2020

There are still several fragile tests that do something like expect( response.body ).not_to include a_test_string - this breaks occasionally when the test string is something that crops up in words used elsewhere in the page (e.g. 'tin' when using Faker::Science.elements). These tests should be made more specific using has_css to target the correct HTML element (and then hopefully I can remove the 'string_string'' kludge that's currently in a bunch of the factories).

@denny denny self-assigned this Jan 16, 2020
@denny denny added bug About something that is broken good first issue This issue should be suitable for less experienced developers labels Mar 12, 2020
@denny
Copy link
Owner Author

denny commented Apr 23, 2020

If you are a less experienced developer who is looking at this issue and thinking you'd like to try to take it on but you're not entirely confident, I would be happy to help you - whether that's help getting set up, more explanation of what needs doing, pairing on the code task itself, or anything else I can do to help.

In my day job I'm a lead developer who often mentors less experienced developers, and I'd love to use some of that experience to help people take their first steps into contributing to open source projects.

@denny denny removed their assignment Apr 23, 2020
@denny denny changed the title Fragile tests (needz moar has_css) Fix fragile tests (should use 'has_css' matcher instead of 'includes') May 9, 2020
@denny denny changed the title Fix fragile tests (should use 'has_css' matcher instead of 'includes') Fix fragile tests (should use 'has_css' matcher instead of 'include') May 9, 2020
@denny denny added the help wanted Can you help with this? label Oct 6, 2020
@denny
Copy link
Owner Author

denny commented Oct 8, 2020

Updated list of spec files that probably contain this issue:

denny@rocinante:~/ShinyCMS$ egrep -rc 'to +include' spec/requests plugins/*/spec/requests | grep -v 0 | sort
plugins/ShinyNewsletters/spec/requests/admin/editions_spec.rb:2
plugins/ShinyPages/spec/requests/admin/pages_spec.rb:3
plugins/ShinyPages/spec/requests/pages_spec.rb:4
plugins/ShinyProfiles/spec/requests/profiles_spec.rb:2
spec/requests/admin/site_settings_spec.rb:2
spec/requests/admin_spec.rb:2
spec/requests/admin/users_spec.rb:2
spec/requests/discussions_spec.rb:3
spec/requests/feature_flags_spec.rb:2
spec/requests/user_spec.rb:4

@denny denny added help offered I would be very happy to help less experienced developers tackle this issue (advice/pairing/etc) tests Tests and test infrastructure (CI, etc) labels Oct 10, 2020
@denny denny removed the help wanted Can you help with this? label Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug About something that is broken good first issue This issue should be suitable for less experienced developers help offered I would be very happy to help less experienced developers tackle this issue (advice/pairing/etc) tests Tests and test infrastructure (CI, etc)
Projects
None yet
Development

No branches or pull requests

1 participant