diff --git a/app/models/guide.rb b/app/models/guide.rb index 277450582..ede4bb106 100644 --- a/app/models/guide.rb +++ b/app/models/guide.rb @@ -46,18 +46,19 @@ def compatibility_score end def compatibility_label + '' # TODO: - score = compatibility_score + # score = compatibility_score - if score.nil? - return '' - elsif score > 75 - return 'high' - elsif score > 50 - return 'medium' - else - return 'low' - end + # if score.nil? + # return '' + # elsif score > 75 + # return 'high' + # elsif score > 50 + # return 'medium' + # else + # return 'low' + # end end slug :name diff --git a/spec/models/guide_spec.rb b/spec/models/guide_spec.rb index f360a6088..919d74973 100644 --- a/spec/models/guide_spec.rb +++ b/spec/models/guide_spec.rb @@ -17,4 +17,20 @@ expect(guide.owned_by?(nil)).to eq(false) expect(guide.owned_by?(other_user)).to eq(false) end + + it 'has not implemented a real compatibility label' do + guide = FactoryGirl.build(:guide) + + guide.stub(:compatibility_score).and_return 80 + expect(guide.compatibility_label).to eq('') + + guide.stub(:compatibility_score).and_return 60 + expect(guide.compatibility_label).to eq('') + + guide.stub(:compatibility_score).and_return 20 + expect(guide.compatibility_label).to eq('') + + guide.stub(:compatibility_score).and_return nil + expect(guide.compatibility_label).to eq('') + end end