travis-api/spec_core/model/annotation_spec.rb
2016-06-19 14:35:54 +02:00

18 lines
498 B
Ruby

describe Annotation do
let(:annotation) { Factory.build(:annotation) }
describe 'validations' do
it 'only allows http or https URLs' do
annotation.url = 'ftp://travis-ci.org'
annotation.save.should be false
annotation.errors[:url].first.should match(/scheme/)
end
it 'only allows valid URLs' do
annotation.url = 'http://travis-ci.org:80b/'
annotation.save.should be false
annotation.errors[:url].first.should match(/invalid/)
end
end
end