uclibs / ucrate

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

Fix broken test in uc_shibboleth_spec.rb #1122

Closed Janell-Huyck closed 7 months ago

Janell-Huyck commented 8 months ago

The tests for whether or not there was a sign-up link for uc_shibboleth were not correct. The test that stated that the link should be present was actually checking (and passing) that it was absent because the url being checked did not include the locale.

Old code:

    it 'shows a signup link if signups are enabled' do
      AUTH_CONFIG['signups_enabled'] = true
      visit new_user_session_path
      expect(page).to_not have_link('Sign up', href: new_user_registration_path)
    end

That test is passing. It should be failing because the page SHOULD have the Sign up link that goes to the new_user_registration_path.

What the test was checking: there is or isn't a link that goes to /sign_up

What the test needed to be checking: there is or isn't a link that goes to/sign_up?locale=en