Patch #15420

Don't create duplicate wikis in tests

Added by George Gensure over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Code cleanup/refactoring
Target version:2.5.0

Description

test/fixtures/wikis.yml includes the unnecessary wiki wikis_002. test/unit/wiki_test.rb's test_create attempts to create an identical wiki, likely being the cause of this entry's inclusion. Its invalidity is that it creates a second wiki entry for project id 2, a violation of the has_one relationship between them. This was noticed with the addition of significant UNIQUE indices across a PostgreSQL instance of redmine and unit tests, where the mentioned test fails with the fixture in place.

Recommended patch is attached.

wikis.patch Magnifier (322 Bytes) George Gensure, 2013-11-20 23:03

wikis.patch Magnifier (1.07 KB) George Gensure, 2013-11-21 17:33

Associated revisions

Revision 12317
Added by Jean-Philippe Lang over 4 years ago

Don't create duplicate wikis in test (#15420).

Patch by George Gensure.

History

#1 Updated by George Gensure over 4 years ago

Looking at this again, it seems that it would be better served to simply change the project in the wiki create test (as well as a user_test.rb test) to use an unwiki'd project. Attaching modified patch.

#2 Updated by Jean-Philippe Lang over 4 years ago

  • Subject changed from wikis.yml includes extraneous (and incorrect) wiki entry to Don't create duplicate wikis in tests
  • Category changed from Wiki to Code cleanup/refactoring
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.5.0

Patch committed in r12317, thanks for poiting this out.

Also available in: Atom PDF