Navigation Menu

Skip to content

Commit

Permalink
Ensure first guide section is always shown on guides/show, unrelated …
Browse files Browse the repository at this point in the history
…test.
  • Loading branch information
kueda committed Feb 18, 2015
1 parent 0ff4e5b commit 78622e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/guides/show.html.haml
Expand Up @@ -274,7 +274,7 @@
.span6
%h4.name
= link_to guide_taxon.display_name, guide_taxon
- if gs = guide_taxon.guide_sections.first
- if gs = guide_taxon.guide_sections.order("COALESCE(position, id)").first
= truncate_with_more formatted_user_text(gs.description), :length => 400
.span3
.map
Expand Down
12 changes: 12 additions & 0 deletions spec/models/conservation_status_spec.rb
Expand Up @@ -103,6 +103,18 @@
o.latitude.should be_blank
end

it "should unobscure observations of taxon" do
o = Observation.make!(:taxon => @taxon, :latitude => 1, :longitude => 1)
o.should be_coordinates_obscured
without_delay {@cs.update_attributes(:geoprivacy => Observation::PRIVATE)}
o.reload
o.latitude.should be_blank
without_delay {@cs.update_attributes(:geoprivacy => Observation::OPEN)}
o.reload
o.latitude.should_not be_blank
o.private_latitude.should be_blank
end

it "should change geom for observations of taxon" do
o = Observation.make!(:taxon => @taxon, :latitude => 1, :longitude => 1)
lat = o.latitude
Expand Down

0 comments on commit 78622e3

Please sign in to comment.