In Spec we were creating two topics: ```ruby fab!(:topic) { Fabricate(:topic, category: category) } fab!(:topic2) { Fabricate(:topic, category: category) } ``` Because we didn't set title explicitly it was using sequence from Fabricator ```ruby title { sequence(:title) { |i| "This is a test topic #{i}" } } ``` If you have two titles `This is a test topic 9` and `This is a test topic 10` Spec testing if topics are sorted will fail. Therefore, we should explicitly set topic title when creating test instances to avoid that randomness. |
||
---|---|---|
.. | ||
knowledge_explorer_controller_spec.rb |