uclibs / ucrate

Scholar@UC: University of Cincinnati's self-submission institutional repository
https://scholar.uc.edu
Other
5 stars 3 forks source link

1075 - Fix unused parameters passed to Capybara warning #1108

Closed Janell-Huyck closed 8 months ago

Janell-Huyck commented 8 months ago

Fixes #1075

Fix warning message for "Unused parameters passed to Capybara."

Capybara tests can have things like .have_link("some text", {optional parameters}). The optional parameters need to be one of the following: :count, :minimum, :maximum, :between, :text, :id, :class, :visible, :exact, :exact_text, :match, :wait, :filter_set, :href, :title, :alt

We had tests that were looking like this: expect(page).to have_link('use the contact page', contact_path), where we were not specifying what that second parameter was. Not specifying meant that the second parameter wasn't being tested, and was raising that warning message "unused parameters passed to Capybara."

This PR is to fix that warning message by clarifying what the second parameter passed in several tests is supposed to be.

We have to pass in the locale as "en" because the actual url for the above example was not /contact but rather /contact?locale=en. This PR factored out the locale into a let :variable at the start of the spec/features/uc_shibboleth_spec.rb file because it was needed in multiple locations in the tests.

Janell-Huyck commented 8 months ago

Develop Branch:

Coverage report generated for RSpec to /Users/huyckjl/Codebases/ucrate/coverage. 3200 / 3372 LOC (94.9%) covered. Lcov style coverage report generated for RSpec to /Users/huyckjl/Codebases/ucrate/coverage/lcov/ucrate.lcov [Coveralls] Outside the CI environment, not sending data. [Coveralls] Some handy coverage stats:

Janell-Huyck commented 8 months ago

Branch coveralls report: Randomized with seed 31385

Coverage report generated for RSpec to /Users/huyckjl/Codebases/ucrate/coverage. 3199 / 3372 LOC (94.87%) covered. Lcov style coverage report generated for RSpec to /Users/huyckjl/Codebases/ucrate/coverage/lcov/ucrate.lcov [Coveralls] Outside the CI environment, not sending data. [Coveralls] Some handy coverage stats:

Janell-Huyck commented 8 months ago

Differences in code coverage relate only to whether or not tests passed. The changes made were exclusively to tests, and are not decreasing any test coverage.

scherztc commented 8 months ago

It looks like there is one more left :

Unused parameters passed to Capybara::Queries::SelectorQuery : ["Files"]

Janell-Huyck commented 8 months ago

Duplicated accidentally in PR#1117, PR#1119. Opening new PR to fix the "files" deprecation message - found the test in another file.