Sha256: d1fa2841289975e0b31df7d894b907dec862dd6c6f6ae6b26208227525a18ba2
Contents?: true
Size: 605 Bytes
Versions: 7
Compression:
Stored size: 605 Bytes
Contents
require File.dirname(__FILE__) + '/../spec_helper' describe CouchPotato::View::ModelViewSpec, 'map_function' do it "should include conditions" do spec = CouchPotato::View::ModelViewSpec.new Object, 'all', {:conditions => 'doc.closed = true'}, {} spec.map_function.should include('if(doc.ruby_class && doc.ruby_class == \'Object\' && (doc.closed = true))') end it "should not include conditions when they are nil" do spec = CouchPotato::View::ModelViewSpec.new Object, 'all', {}, {} spec.map_function.should include('if(doc.ruby_class && doc.ruby_class == \'Object\')') end end
Version data entries
7 entries across 7 versions & 1 rubygems