= simple_form_for user do |f|
= f.input :first_name
= f.input :last_name
= f.submit
require 'rails_helper'
describe 'users/_form.html.haml', type: :view do
context 'user form' do
it 'shows user data' do
user = User.new(first_name: 'Joe', last_name: 'Smith')
render partial: 'users/form', locals: { user: user }
expect(rendered).to have_content 'Joe'
end
end
end
I think the spec is looking for the partial relative to the spec directory/folder
This line in the error seems to indicate that. # ./spec/views/users/_form.html.haml_spec.rb:8:in `block (3 levels) in <top (required)>'
When the partial is used in the view it assumes the folder structure of the model. So I would say you can't use it the same way in the test.
D
--
You received this message because you are subscribed to the Google Groups "SimpleForm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simpleform+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.