Rewrite spec/features/projects/wiki/user_creates_wiki_page_spec.rb

Summary

Feature tests are to be avoided (they are very slow, very fragile, and [explicitly discouraged[(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/testing_guide/testing_levels.md)). However, a lot of functionality in the wikis component is tested in end-to-end feature tests (e.g. [[spec/features/projects/wiki/user_creates_wiki_page_spec.rb]]).

Improvements

Most of the things these tests exist to check could be run in lower levels of testing, at the unit-testing level.

We can expect massive speed-ups from this, on the order of several minutes per test-run, saving enormous amounts of compute time over the lifetime of the application. It will also make future development much quicker, since test runs are faster with better feedback.

Risks

We could get the refactoring wrong and introduce bad tests. This is true for all code.

Involved components

Wikis primarily suffer from this, but surely this could be applied more broadly.

Optional: Intended side effects

Faster development, better more comprehensive test-suites.

Optional: Missing test coverage

Because these test suites are so slow, and require such round-about assertions (inferring application state from the page state), there is a strong incentive to avoid writing tests, and I would anticipate code-coverage going up if we reduced the reliance on e2e feature tests.

Assignee Loading
Time tracking Loading