ShinyCMS-ruby icon indicating copy to clipboard operation
ShinyCMS-ruby copied to clipboard

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

Open denny opened this issue 5 years ago • 2 comments

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 avatar Jan 16 '20 21:01 denny

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 avatar Apr 23 '20 19:04 denny

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 avatar Oct 08 '20 19:10 denny