Skip to content

Commit

Permalink
fixing broken specs
Browse files Browse the repository at this point in the history
  • Loading branch information
robramsaynz committed Oct 20, 2014
1 parent d12dab0 commit 3024d09
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/views/baskets/list.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
%td.basket_name= link_to_index_for(basket)
%td.basket_created= basket.created_at.to_s(:long)
%td.basket_options
-if @site_admin || current_user.roles.include?(basket.role("admin"))
-if @site_admin || ( logged_in? && current_user.roles.include?(basket.role("admin")) )
%ul= link_to_actions_available_for(basket)
/end
/ end
Expand Down
10 changes: 9 additions & 1 deletion spec/horowhenau/features/contributed_by_searching_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ def first_result_text
first_result.find(".generic-result-header")
end

def first_image
find('.image-result-wrapper', match: :first)
end

def first_image_text
first_image.find(".image-result-header")
end

def within_contributor_area
find("#content-tools")
end
Expand All @@ -21,7 +29,7 @@ def within_contributor_area
expect(first_result_text).to have_content "The Petersen Estate"

click_on "Images (258)"
expect(first_result_text).to have_content "Dame Silvia Cartwright unveiling the Icon"
expect(first_image_text).to have_content "Dame Silvia Cartwright unveiling the Icon"

click_on "Audio (1)"
expect(first_result_text).to have_content "Horowhenua song"
Expand Down
13 changes: 11 additions & 2 deletions spec/horowhenau/features/search_results_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ def first_result_text
first_result.find(".generic-result-header")
end

def first_image
find('.image-result-wrapper', match: :first)
end

def first_image_text
first_image.find(".image-result-header")
end


feature "Browse search results" do

before(:each) do
Expand Down Expand Up @@ -39,7 +48,7 @@ def first_result_text
expect(first_result_text).to have_content "Manakau School 125th Jubilee 2013 and Dedication Ceremony at the completion of the Jubilee"

click_on "Images (21,792)"
expect(first_result_text).to have_content "Manakau School 125th Jubilee Rev Kahira Rau blessing the totem poles"
expect(first_image_text).to have_content "Manakau School 125th Jubilee Rev Kahira Rau blessing the totem poles"

click_on "Audio (106)"
expect(first_result_text).to have_content "Paraparaumu, 1942 by Bernard Smith 22 April 2012"
Expand Down Expand Up @@ -67,7 +76,7 @@ def first_result_text
expect(first_result_text).to have_content "Houses of the Horowhenua 2011"

click_on "Images (645)"
expect(first_result_text).to have_content "Waikawa Beach Road to Waikawa Beach settlement, 1965"
expect(first_image_text).to have_content "Waikawa Beach Road to Waikawa Beach settlement, 1965"

click_on "Audio (3)"
expect(first_result_text).to have_content "Ash Bell The Country Boy 6 May 2012"
Expand Down

0 comments on commit 3024d09

Please sign in to comment.