blob: 8c7338638b13b37231fcc996eaa79df48f0070c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Ci::HasDeploymentName do
describe 'deployment_name?' do
let(:build) { create(:ci_build) }
subject { build.branch? }
it 'does detect deployment names' do
build.name = 'deployment'
expect(build.deployment_name?).to be_truthy
end
it 'does detect partial deployment names' do
build.name = 'do a really cool deploy'
expect(build.deployment_name?).to be_truthy
end
it 'does not detect non-deployment names' do
build.name = 'testing'
expect(build.deployment_name?).to be_falsy
end
it 'is case insensitive' do
build.name = 'DEPLOY'
expect(build.deployment_name?).to be_truthy
end
end
end
|