mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Topic#featured_link
may contain more than a URL.
This commit is contained in:
@ -11,6 +11,22 @@ describe Topic do
|
||||
context 'validations' do
|
||||
let(:topic) { Fabricate.build(:topic) }
|
||||
|
||||
context "#featured_link" do
|
||||
describe 'when featured_link contains more than a URL' do
|
||||
it 'should not be valid' do
|
||||
topic.featured_link = 'http://meta.discourse.org TEST'
|
||||
expect(topic).to_not be_valid
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when featured_link is a valid URL' do
|
||||
it 'should be valid' do
|
||||
topic.featured_link = 'http://meta.discourse.org'
|
||||
expect(topic).to be_valid
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "#title" do
|
||||
it { is_expected.to validate_presence_of :title }
|
||||
|
||||
|
Reference in New Issue
Block a user