diff --git a/app/helpers/batch_edits_helper.rb b/app/helpers/batch_edits_helper.rb index 3afc5944c4..d1c9c1a252 100644 --- a/app/helpers/batch_edits_helper.rb +++ b/app/helpers/batch_edits_helper.rb @@ -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 diff --git a/spec/helpers/batch_edits_helper_spec.rb b/spec/helpers/batch_edits_helper_spec.rb index 9a7233a3e4..4fe0d51a14 100644 --- a/spec/helpers/batch_edits_helper_spec.rb +++ b/spec/helpers/batch_edits_helper_spec.rb @@ -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