Created
August 29, 2013 15:40
-
-
Save zorab47/6379735 to your computer and use it in GitHub Desktop.
Failing spec for ActiveAdmin::ResourceCollection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe ActiveAdmin::ResourceCollection do | |
let(:application) { ActiveAdmin::Application.new } | |
let(:namespace) { ActiveAdmin::Namespace.new(application, :admin) } | |
context ".add" do | |
let(:resource) { ActiveAdmin::Resource.new(namespace, AdminUser) } | |
let(:resource_renamed) { ActiveAdmin::Resource.new(namespace, AdminUser, as: "SuperAdminUser") } | |
context "when renamed resource is added first" do | |
before do | |
namespace.resources.add(resource_renamed) | |
namespace.resources.add(resource) | |
end | |
it "contains both resources" do | |
expect(namespace.resources.values).to include(resource, resource_renamed) | |
end | |
end | |
context "when resource is added first" do | |
before do | |
namespace.resources.add(resource) | |
namespace.resources.add(resource_renamed) | |
end | |
it "contains both resources" do | |
expect(namespace.resources.values).to include(resource, resource_renamed) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment