1
0
Fork 0
mirror of https://github.com/drapergem/draper synced 2023-03-27 23:21:17 -04:00

Fix mock error by following error instructions

Fixes the following error:

```
[WARNING] Could not load generator
"generators/test_unit/decorator_generator". Error: Rails::Generators
received :require with unexpected arguments
  expected: ("application_decorator")
       got: ("generators/test_unit/decorator_generator")
 Please stub a default value first if message might be received with
other args as well
```
This commit is contained in:
David Rodríguez 2017-02-23 13:19:10 -03:00
parent 0204be12a2
commit 7f8ece627e

View file

@ -40,6 +40,7 @@ describe Rails::Generators::DecoratorGenerator do
context "with an ApplicationDecorator" do
before do
allow_any_instance_of(Object).to receive(:require)
allow_any_instance_of(Object).to receive(:require).with("application_decorator").and_return(
stub_const "ApplicationDecorator", Class.new
)