Remove redundant specs
This commit is contained in:
parent
44f4c18b5e
commit
f3647f55d8
|
@ -89,39 +89,19 @@ module Draper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when the item decorator is inferrable from the collection decorator" do
|
context "when the :with option was given" do
|
||||||
context "when the :with option was given" do
|
it "uses the :with option" do
|
||||||
it "uses the :with option" do
|
decorator = CollectionDecorator.new([Product.new], with: OtherDecorator).first
|
||||||
decorator = ProductsDecorator.new([Product.new], with: OtherDecorator)
|
|
||||||
|
|
||||||
expect(*decorator).to be_decorated_with OtherDecorator
|
expect(decorator).to be_decorated_with OtherDecorator
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context "when the :with option was not given" do
|
|
||||||
it "infers the item decorator from the collection decorator" do
|
|
||||||
decorator = ProductsDecorator.new([Product.new])
|
|
||||||
|
|
||||||
expect(*decorator).to be_decorated_with ProductDecorator
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when the item decorator is not inferrable from the collection decorator" do
|
context "when the :with option was not given" do
|
||||||
context "when the :with option was given" do
|
it "infers the item decorator from each item" do
|
||||||
it "uses the :with option" do
|
decorator = CollectionDecorator.new([double(decorate: :inferred_decorator)]).first
|
||||||
decorator = CollectionDecorator.new([Product.new], with: OtherDecorator)
|
|
||||||
|
|
||||||
expect(*decorator).to be_decorated_with OtherDecorator
|
expect(decorator).to be :inferred_decorator
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context "when the :with option was not given" do
|
|
||||||
it "infers the item decorator from each item" do
|
|
||||||
decorator = CollectionDecorator.new([double(decorate: :inferred_decorator)])
|
|
||||||
|
|
||||||
expect(*decorator).to be :inferred_decorator
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue