you should only be testing public methods, so in this case the species
method.


On 19 February 2014 16:50, Decio Battaglia <notifications@github.com> wrote:

> In app/models/dashboard_stats.rb:
>
> > -        search = MTaxonConcept.where(
> > -          "taxonomy_is_cites_eu = '#{taxonomy_is_cites_eu}'
> > -          AND class_name = '#{species_class[:name]}'
> > -          AND countries_ids_ary && ARRAY[#{@geo_entity.id}]")
> > -        result = {
> > -          :name => species_class[:name],
> > -          :common_name_en => species_class[:common_name_en],
> > -          :count => search.count
> > -        }
> > -        species_results[taxonomy] << result
> > -      end
> > +    species_results = []
> > +    get_species_classes(:cites_eu).each do |species_class|
> > +      search = MTaxonConcept.where(
> > +        "taxonomy_is_cites_eu = 't'
> > +        AND cites_listed = 't'
>
> specs: slightly confused on this one.
> Should I be writing a spec for the species method or for the query?
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/unepwcmc/SAPI/pull/220/files#r9872140>
> .
>



-- 
Agnieszka Figiel