Browse files

Updated Atrium::BrowseLevel to test #values

  • Loading branch information...
1 parent 1b1554f commit d857f85a450827208e92c9c169fd00eac6c5961f @jeremyf jeremyf committed Jul 11, 2012
Showing with 12 additions and 1 deletion.
  1. +2 −1 app/models/atrium/browse_level.rb
  2. +10 −0 test_support/spec/models/atrium/browse_level_spec.rb
View
3 app/models/atrium/browse_level.rb
@@ -27,7 +27,8 @@ class Atrium::BrowseLevel < ActiveRecord::Base
serialize :exclude_query_params
- attr_accessor :values, :selected
+ attr_accessor :selected
+ attr_writer :values
def values
@values ||= []
View
10 test_support/spec/models/atrium/browse_level_spec.rb
@@ -14,10 +14,20 @@
it { should be_accessible :solr_facet_name }
it { should validate_presence_of :solr_facet_name }
+ it { should respond_to :selected }
+ it { should respond_to :selected= }
+
+ describe '#values' do
+ it 'should be enumerable' do
+ Atrium::BrowseLevel.new.values.should be_kind_of Enumerable
+ end
+ end
+
describe '#to_s' do
it 'should be #solr_facet_name' do
string = "Hello"
Atrium::BrowseLevel.new(:solr_facet_name => string).to_s.should == string
end
end
+
end

0 comments on commit d857f85

Please sign in to comment.