diff --git a/app/models/badge.rb b/app/models/badge.rb index 35d3796ad8e..be5cd30cfa0 100644 --- a/app/models/badge.rb +++ b/app/models/badge.rb @@ -206,7 +206,7 @@ SQL end def system? - id < 100 + id && id < 100 end def default_name=(val) diff --git a/spec/models/badge.rb b/spec/models/badge.rb deleted file mode 100644 index ab8ab50c3fd..00000000000 --- a/spec/models/badge.rb +++ /dev/null @@ -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 - diff --git a/spec/models/badge_spec.rb b/spec/models/badge_spec.rb new file mode 100644 index 00000000000..050d5bb9948 --- /dev/null +++ b/spec/models/badge_spec.rb @@ -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 +