Skip to content

Instantly share code, notes, and snippets.

@zorab47
Created August 29, 2013 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zorab47/6379735 to your computer and use it in GitHub Desktop.
Save zorab47/6379735 to your computer and use it in GitHub Desktop.
Failing spec for ActiveAdmin::ResourceCollection
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