Sha256: e7031bbfac037420b693b1d290295d09fc9b29def546b30e10c5d8c962f81e69

Contents?: true

Size: 1.09 KB

Versions: 6

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'
require 'active_admin/batch_actions/views/batch_action_popover'

describe ActiveAdmin::BatchActions::BatchActionPopover do

  let(:the_popover) do
    render_arbre_component do
      batch_action_popover do
        action ActiveAdmin::BatchAction.new( :action_1, "Action 1" )
        action ActiveAdmin::BatchAction.new( :action_2, "Action 2" )
        action ActiveAdmin::BatchAction.new( :action_3, "Action 3" )
      end
    end
  end

  it "should have an id" do
    the_popover.id.should == "batch_actions_popover"
  end

  describe "the action list" do
    subject do
      the_popover.find_by_class("popover_contents").first
    end

    its(:tag_name) { should eql("ul") }

    its(:content){ should include("<li><a href=\"#\" class=\"batch_action\" data-action=\"action_1\">Action 1 Selected</a></li>") }
    its(:content){ should include("<li><a href=\"#\" class=\"batch_action\" data-action=\"action_2\">Action 2 Selected</a></li>") }
    its(:content){ should include("<li><a href=\"#\" class=\"batch_action\" data-action=\"action_3\">Action 3 Selected</a></li>") }

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activeadmin-0.6.6 spec/unit/views/components/batch_action_popover_spec.rb
activeadmin-0.6.5 spec/unit/views/components/batch_action_popover_spec.rb
activeadmin-0.6.4 spec/unit/views/components/batch_action_popover_spec.rb
activeadmin-0.6.3 spec/unit/views/components/batch_action_popover_spec.rb
activeadmin-0.6.2 spec/unit/views/components/batch_action_popover_spec.rb
activeadmin-0.6.1 spec/unit/views/components/batch_action_popover_spec.rb