travis-api/spec/core/model/annotation_spec.rb
2016-06-14 15:10:40 +02:00

22 lines
559 B
Ruby

require 'spec_helper_core'
describe Annotation do
include Support::ActiveRecord
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