Skip to content

Commit

Permalink
Merge pull request #2963 from projecthydra/no_select_all
Browse files Browse the repository at this point in the history
Remove check-all button from My Collections listing
  • Loading branch information
atz committed Dec 8, 2016
2 parents 4f2e8af + 5c6e546 commit 4a47147
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/helpers/batch_edits_helper.rb
Expand Up @@ -8,7 +8,7 @@ def batch_delete
# Displays a "check all" button with a dropdown that has "Select None"
# and "Select current page" actions
def render_check_all
return if controller_name == "my/collections"
return if params[:controller] == "my/collections"
render 'batch_edits/check_all'
end
end
8 changes: 4 additions & 4 deletions spec/helpers/batch_edits_helper_spec.rb
Expand Up @@ -6,28 +6,28 @@

context "with my works" do
it "shows the check all dropdown" do
allow(controller).to receive(:controller_name).and_return("my/works")
allow(controller).to receive(:params).and_return(controller: "my/works")
expect(helper.render_check_all).to have_css("span.glyphicon-cog")
end
end

context "with my shares" do
it "shows the check all dropdown" do
allow(controller).to receive(:controller_name).and_return("my/shares")
allow(controller).to receive(:params).and_return(controller: "my/shares")
expect(helper.render_check_all).to have_css("span.glyphicon-cog")
end
end

context "with my highlights" do
it "shows the check all dropdown" do
allow(controller).to receive(:controller_name).and_return("my/shares")
allow(controller).to receive(:params).and_return(controller: "my/shares")
expect(helper.render_check_all).to have_css("span.glyphicon-cog")
end
end

context "with my collections" do
it "does not show the check all dropdown" do
allow(controller).to receive(:controller_name).and_return("my/collections")
allow(controller).to receive(:params).and_return(controller: "my/collections")
expect(helper.render_check_all).to be_nil
end
end
Expand Down

0 comments on commit 4a47147

Please sign in to comment.