debian-mirror-gitlab/spec/models/concerns/ci/has_deployment_name_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
749 B
Ruby
Raw Normal View History

2022-05-07 20:08:51 +05:30
# 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