Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/integrations/campfire_spec.rb')
-rw-r--r--spec/models/integrations/campfire_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/integrations/campfire_spec.rb b/spec/models/integrations/campfire_spec.rb
index 405a9ff4b3f..48e24299bbd 100644
--- a/spec/models/integrations/campfire_spec.rb
+++ b/spec/models/integrations/campfire_spec.rb
@@ -5,7 +5,17 @@ require 'spec_helper'
RSpec.describe Integrations::Campfire do
include StubRequests
+ it_behaves_like Integrations::ResetSecretFields do
+ let(:integration) { described_class.new }
+ end
+
describe 'Validations' do
+ it { is_expected.to validate_numericality_of(:room).is_greater_than(0).only_integer }
+ it { is_expected.to validate_length_of(:subdomain).is_at_most(63) }
+ it { is_expected.to allow_value("foo").for(:subdomain) }
+ it { is_expected.not_to allow_value("foo.bar").for(:subdomain) }
+ it { is_expected.not_to allow_value("foo.bar/#").for(:subdomain) }
+
context 'when integration is active' do
before do
subject.active = true