At the moment, there seems to be an issue with the templating - one of
the ActionMailer unit tests is failing, and a bunch of functional
tests are also failing. The functional failures are due to the removal
of a method we were relying on to determine what was being rendered
(‘first_render’). I suspect that these errors might be hiding another
minor template error.
The branch which contains Samuel W.’ patch for timestamped
migrations (‘use_rails_own_migration_mechanism’) isn’t merged with
edge or master yet, although I expect to merge it soon (potentially
this afternoon).
If you have any problems running the tests, let me know. Hope that
helps!
I have a question… the first
error, `test_should_be_able_to_create_mails_from_plugin’, seems to be
cause
by there being a missing template in
/test/plugins/test_plugin_mailing/app/views/plugin_mail/.
the error is:
ActionView::MissingTemplate: Missing template
plugin_mail/mail_from_plugin.erb in view path
What confuses me, is that there is a
standard mail_from_plugin.text.plain.erb template.
I copied this template into a file called mail_from_plugin.html.erb and
the
same test passed.
Does anyone have any idea why this is? Also I am not sure if there is a
reason that just the plain text template is in there and not the
html.erb
template. Is this test testing particularly for the plain text template?
however, I thought I would continue this conversation here as well.
Hi, I tried globally changing the <%= self.first_render %> to <%=
self.instance_variable_get(:@_first_render) %>
this seems to work pushing the errors to failures:
<“namespace/app_and_plugin/a_view (from app)”> expected but was
<“namespace/app_and_plugin/a_view.html.erb (from app)”>
etc.
This seems acceptable if the test condition was just changed from
assert_response_body ‘alpha_plugin/a_view’ to assert_response_body
‘alpha_plugin/a_view.html.erb’
would that still satisfy the test? are the file extensions a problem?
The test was testing the ‘default’ behaviour, but the template
overspecified that the email should be text/plain. The simplest way to
‘fix’ this test was to just rename the default template to ‘.erb’,
rather than ‘.text.plain.erb’, as this seems to be how Rails 2.2
expects ActionMailer to be used.
So… we’re now passing all tests against Edge Rails! In other words,
the engines plugin should now be compatible with Rails 2.2 (seems like
it always was, but the tests were a bit 2.1-specific).
I just resolved this bug, by implementing a specific mechanism for
determining the path of the template that was rendered. This is
cleaner than relying on ActionView’s internal state, and should
hopefully be more future-proof!