Skip to content

Fix more specs with new nav

What does this MR do and why?

Fix issuable shared samples to work with new nav

This fixes the issuabled shared example to and related specs to work with the new nav.

Rewrite Project and Personal Snippet show specs

The Personal and Project snippet specs were not of high quality. It was hard to understand what's going on and the specs around: does not show New Snippet button started failing suddenly.

The reason for the failure was that the snippet tries to render too much files (it copies the normal test repo?) and the script times out. Interestingly the other instance of that shared example didn't fail. The reason being that the assertion checks the absence of a link, but the page rendered was actually our 404 page.

So let's extend the test coverage and rewrite the specs completely. For both specs we now test four scenarios:

  • Logged in as the snippet author
  • Logged in as an external user
  • Logged in as a normal user
  • The anonymous user

We also port a allow_any_instance_of mock for snippet[:blobs] which reduces the files served to one and therefore leading to a quicker rendering of the pages.

The specs also have been executed quite a lot and are very likely order independent.

Screenshots or screen recordings

No visible changes

How to set up and validate locally

bin/rspec spec/features/projects/snippets/show_spec.rb \
  spec/features/snippets/show_spec.rb \
  spec/features/groups/issues_spec.rb \
  spec/features/groups/merge_requests_spec.rb

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Lukas 'ai-pi' Eipert

Merge request reports