2020-05-24 23:13:21 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Plan do
|
2020-05-24 23:13:21 +05:30
|
|
|
describe '#default?' do
|
|
|
|
subject { plan.default? }
|
|
|
|
|
|
|
|
Plan.default_plans.each do |plan|
|
|
|
|
context "when '#{plan}'" do
|
|
|
|
let(:plan) { build("#{plan}_plan".to_sym) }
|
|
|
|
|
|
|
|
it { is_expected.to be_truthy }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-07-28 23:09:34 +05:30
|
|
|
|
|
|
|
context 'when updating plan limits' do
|
|
|
|
let(:plan) { described_class.default }
|
|
|
|
|
|
|
|
it { expect(plan).to be_persisted }
|
|
|
|
|
|
|
|
it { expect(plan.actual_limits).not_to be_persisted }
|
|
|
|
|
|
|
|
it 'successfully updates the limits' do
|
|
|
|
expect(plan.actual_limits.update!(ci_instance_level_variables: 100)).to be_truthy
|
|
|
|
end
|
|
|
|
end
|
2020-05-24 23:13:21 +05:30
|
|
|
end
|