Load rake task under test for all its specs

If you ran only the second spec without the first, the rake file wasn't
loaded and the test failed.
This commit is contained in:
Maikel Linke
2020-09-17 15:53:27 +10:00
parent 6bf041aa74
commit 3f6288d5c7

View File

@@ -4,12 +4,14 @@ require 'spec_helper'
require 'rake'
describe 'users.rake' do
before(:all) do
Rake.application.rake_require 'tasks/users'
Rake::Task.define_task(:environment)
end
describe ':remove_enterprise_limit' do
context 'when the user exists' do
it 'sets the enterprise_limit to the maximum integer' do
Rake.application.rake_require 'tasks/users'
Rake::Task.define_task(:environment)
max_integer = 2_147_483_647
user = create(:user)