spec/unit/resource/sidebars_spec.rb in activeadmin-0.6.6 vs spec/unit/resource/sidebars_spec.rb in activeadmin-1.0.0.pre1
- old
+ new
@@ -1,6 +1,6 @@
-require 'spec_helper'
+require 'rails_helper'
describe ActiveAdmin::Resource::Sidebars do
let(:resource) do
namespace = ActiveAdmin::Namespace.new(ActiveAdmin::Application.new, :admin)
@@ -15,28 +15,28 @@
resource.clear_sidebar_sections!
resource.sidebar_sections << sidebar
end
it "should add a sidebar section" do
- resource.should have(1).sidebar_sections
+ expect(resource.sidebar_sections.size).to eq(1)
end
end
describe "retrieving sections for a controller action" do
- let(:only_index){ ActiveAdmin::SidebarSection.new(:help, :only => :index) }
- let(:only_show){ ActiveAdmin::SidebarSection.new(:help, :only => :show) }
+ let(:only_index){ ActiveAdmin::SidebarSection.new(:help, only: :index) }
+ let(:only_show){ ActiveAdmin::SidebarSection.new(:help, only: :show) }
before do
resource.clear_sidebar_sections!
resource.sidebar_sections << only_index
resource.sidebar_sections << only_show
end
it "should only return the relevant action items" do
- resource.should have(2).sidebar_sections
- resource.sidebar_sections_for("index").should == [only_index]
+ expect(resource.sidebar_sections.size).to eq(2)
+ expect(resource.sidebar_sections_for("index")).to eq [only_index]
end
end
end