diff --git a/app/views/crops/index.html.haml b/app/views/crops/index.html.haml index f385ef4b4..762cd7923 100644 --- a/app/views/crops/index.html.haml +++ b/app/views/crops/index.html.haml @@ -1,6 +1,9 @@ - content_for :title, "Crops" - c = 0 +%p + = "Displaying #{@crops.length} crops" + %ul.thumbnails .row - @crops.each do |crop| diff --git a/app/views/members/index.html.haml b/app/views/members/index.html.haml index 276e44f47..6b79e951a 100644 --- a/app/views/members/index.html.haml +++ b/app/views/members/index.html.haml @@ -1,5 +1,8 @@ = content_for :title, "Growstuff members" +%p + = "Displaying #{@members.length} members" + %ul.thumbnails - @members.each do |m| %li.span2 diff --git a/app/views/updates/index.html.haml b/app/views/updates/index.html.haml index 9818890d8..a98eaec2c 100644 --- a/app/views/updates/index.html.haml +++ b/app/views/updates/index.html.haml @@ -1,6 +1,9 @@ = content_for :title, "Recent Growstuff member updates" +%p + = "Displaying #{@updates.length} updates" + - @updates.each do |update| - = render :partial => "single", :locals => { :update => update, :subject => true } + = render :partial => "single", :locals => { :update => update, :subject => true } = link_to 'New Update', new_update_path diff --git a/spec/views/crops/index.html.haml_spec.rb b/spec/views/crops/index.html.haml_spec.rb index 855210826..6360bf20d 100644 --- a/spec/views/crops/index.html.haml_spec.rb +++ b/spec/views/crops/index.html.haml_spec.rb @@ -20,7 +20,12 @@ describe "crops/index" do assert_select "a", :text => "Maize" assert_select "a", :text => "Tomato" end - + + it "counts the number of crops" do + render + rendered.should contain "Displaying 2 crops" + end + context "logged out" do it "doesn't show the new crop link if logged out" do render diff --git a/spec/views/members/index.html.haml_spec.rb b/spec/views/members/index.html.haml_spec.rb index 60ea5d5dc..ab91aa84f 100644 --- a/spec/views/members/index.html.haml_spec.rb +++ b/spec/views/members/index.html.haml_spec.rb @@ -27,4 +27,9 @@ describe "members/index" do rendered.should contain "bob" rendered.should_not contain "bob..." end + + it "counts the number of members" do + rendered.should contain "Displaying 2 members" + end + end diff --git a/spec/views/updates/index.html.haml_spec.rb b/spec/views/updates/index.html.haml_spec.rb index 591b53d1c..9be107d9e 100644 --- a/spec/views/updates/index.html.haml_spec.rb +++ b/spec/views/updates/index.html.haml_spec.rb @@ -29,4 +29,10 @@ describe "updates/index" do assert_select "div.update>div.update-body", :text => "MyText".to_s, :count => 2 end + + it "counts the number of updates" do + render + rendered.should contain "Displaying 2 updates" + end + end