Fixes #12099 - Template locked? relying on rake makes tests fail
app/models/template.rb has a method locked? that relies on !Foreman.in_rake? to bypass the locked validation when running some operations through Rake such as migrations or cloning templates. On Rails 4 rake test is also interpreted as being 'in rake' and tests fail when running them through rake test but not when running template tests individually.
Related issues
Refactor #12099: Template locked? relying on rake makes tests fail
Fixes #12099 - Template locked? relying on rake makes tests fail
app/models/template.rb has a method locked? that relies on
!Foreman.in_rake? to bypass the locked validation when running some
operations through Rake such as migrations or cloning templates. On
Rails 4 rake test is also interpreted as being 'in rake' and tests fail
when running them through rake test but not when running template tests
individually.