travis-api/spec/lib/model/annotation_spec.rb
Aakriti Gupta 65f1a29d86 Move travis-core files from /vendor to /lib.
- Re-factor
- Remove code for notifications
- Remove addons
- Remove travis-core gem.
- Ignore logs directory only
- Move core tests to spec/lib
2016-07-20 11:22:25 +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