2018-05-07 16:47:29 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2014-08-05 18:23:42 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
|
|
describe Commercial do
|
|
|
|
|
|
2015-04-22 21:30:32 +02:00
|
|
|
it { should validate_presence_of(:url) }
|
2014-08-05 18:23:42 +02:00
|
|
|
|
2022-02-23 17:52:16 +01:00
|
|
|
it 'validates url format' do
|
|
|
|
|
commercial = build(:conference_commercial, url: 'ftp://example.com')
|
2022-03-30 12:39:01 +02:00
|
|
|
expect(commercial.valid?).to be false
|
2022-02-23 17:52:16 +01:00
|
|
|
expect(commercial.errors['url']).to eq ['is invalid']
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it 'validates url rendering' do
|
|
|
|
|
commercial = build(:conference_commercial)
|
2022-03-30 12:39:01 +02:00
|
|
|
expect(commercial.valid?).to be true
|
2022-02-23 17:52:16 +01:00
|
|
|
end
|
2014-08-05 18:23:42 +02:00
|
|
|
end
|