How to test the locals on a render?

0

I have the following question, I make my tests using Ministest, however I have a problem when testing the locals of a render ... I do not know how to test, for example:

Controller:

def salvou
   render('cadastro/salvou', locals: {id: params[:id]})
end

In this case my saved is a js file.

Test:

it "Redireciona para o salvou" do
    [...]
    assert_template 'cadastro/salvou'
end

And the locals, how do I test?

Thank you!

    
asked by anonymous 30.06.2014 / 21:23

1 answer

1
# assert that the "_customer" partial was rendered with a specific object
assert_template partial: '_customer', locals: { customer: @customer }

ref: ActionController :: TestCase

    
17.07.2014 / 20:19