2019-07-07 11:18:12 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Ci::TriggerRequest do
|
2018-03-17 18:26:18 +05:30
|
|
|
describe 'validation' do
|
|
|
|
it 'be invalid if saving a variable' do
|
2023-01-13 00:05:48 +05:30
|
|
|
trigger = build(:ci_trigger_request, variables: { TRIGGER_KEY_1: 'TRIGGER_VALUE_1' })
|
2018-03-17 18:26:18 +05:30
|
|
|
|
|
|
|
expect(trigger).not_to be_valid
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'be valid if not saving a variable' do
|
|
|
|
trigger = build(:ci_trigger_request)
|
|
|
|
|
|
|
|
expect(trigger).to be_valid
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|