BigW Consortium Gitlab

trigger_spec.rb 513 Bytes
Newer Older
1 2
require 'spec_helper'

Douwe Maan committed
3
describe Ci::Trigger, models: true do
4
  let(:project) { FactoryGirl.create :empty_project }
5 6

  describe 'before_validation' do
7
    it 'sets an random token if none provided' do
8
      trigger = FactoryGirl.create :ci_trigger_without_token, project: project
Dmitriy Zaporozhets committed
9
      expect(trigger.token).not_to be_nil
10 11
    end

12
    it 'does not set an random token if one provided' do
13
      trigger = FactoryGirl.create :ci_trigger, project: project
Dmitriy Zaporozhets committed
14
      expect(trigger.token).to eq('token')
15 16 17
    end
  end
end