mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 17:53:40 +08:00
FIX: system attribute not set correctly on new badges
This commit is contained in:
parent
40af9ce612
commit
354d40a6ea
|
@ -206,7 +206,7 @@ SQL
|
|||
end
|
||||
|
||||
def system?
|
||||
id < 100
|
||||
id && id < 100
|
||||
end
|
||||
|
||||
def default_name=(val)
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
require 'spec_helper'
|
||||
require_dependency 'badge'
|
||||
|
||||
describe Badge do
|
||||
|
||||
context 'validations' do
|
||||
before(:each) { Fabricate(:badge) }
|
||||
|
||||
it { should validate_presence_of :name }
|
||||
it { should validate_presence_of :badge_type }
|
||||
it { should validate_uniqueness_of :name }
|
||||
end
|
||||
|
||||
end
|
||||
|
11
spec/models/badge_spec.rb
Normal file
11
spec/models/badge_spec.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
require 'spec_helper'
|
||||
require_dependency 'badge'
|
||||
|
||||
describe Badge do
|
||||
|
||||
it 'has a valid system attribute for new badges' do
|
||||
Badge.new.system?.should be_false
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user