Move edition tests to model where they belong
What does this MR do?
Moves edition tests to license model where they now belong.
Reduces db activity by using build
instead of create
Factory Doctor output
16:04 $ FDOC=1 be rspec ee/spec/lib/gitlab/usage_data_spec.rb
[TEST PROF INFO] FactoryDoctor enabled (event: "sql.active_record", threshold: 0.01)
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
==> Setting up Gitaly...
Checking gitaly-ruby Gemfile...
Checking gitaly-ruby bundle...
The Gemfile's dependencies are satisfied
Trying to connect to gitaly: ....... OK
Gitaly set up in 1.158653 seconds...
==> Setting up GitLab Workhorse...
GitLab Workhorse set up in 0.000922 seconds...
==> Setting up GitLab Elasticsearch Indexer...
GitLab Elasticsearch Indexer set up in 0.000508 seconds...
................[TEST PROF INFO] FactoryDoctor report
Total (potentially) bad examples: 1
Total wasted time: 00:00.017
Gitlab::UsageData (./ee/spec/lib/gitlab/usage_data_spec.rb:5) (4 records created, 00:00.017)
have expected values (./ee/spec/lib/gitlab/usage_data_spec.rb:154) – 4 records created, 00:00.017
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team