2019-03-30 03:23:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-24 04:08:32 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Ci::TriggerRequest do
|
|
|
|
describe 'validation' do
|
|
|
|
it 'be invalid if saving a variable' do
|
|
|
|
trigger = build(:ci_trigger_request, variables: { TRIGGER_KEY_1: 'TRIGGER_VALUE_1' } )
|
|
|
|
|
2017-08-31 11:17:56 -04:00
|
|
|
expect(trigger).not_to be_valid
|
2017-08-24 04:08:32 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'be valid if not saving a variable' do
|
|
|
|
trigger = build(:ci_trigger_request)
|
|
|
|
|
2017-08-31 11:17:56 -04:00
|
|
|
expect(trigger).to be_valid
|
2017-08-24 04:08:32 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|