mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: Topic#featured_link
may contain more than a URL.
This commit is contained in:
parent
3c56c9b637
commit
4bd5acec47
3 changed files with 33 additions and 9 deletions
|
@ -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 }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue