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
1 changed files with 1 additions and 0 deletions

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
)