osem-fcy/spec/models/commercial_spec.rb
Henne Vogelsang 81853d1ef9
Retire semantic_form_for
Also a buttload of form cleanups...
2022-02-24 15:52:34 +01:00

19 lines
465 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe Commercial do
it { should validate_presence_of(:url) }
it 'validates url format' do
commercial = build(:conference_commercial, url: 'ftp://example.com')
expect(commercial.valid?).to eq false
expect(commercial.errors['url']).to eq ['is invalid']
end
it 'validates url rendering' do
commercial = build(:conference_commercial)
expect(commercial.valid?).to eq true
end
end