Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[fixes #37] Don't load template source from file

This resolves an issue whereby RSpec was intentionally
not loading the template source unless you called
render_views. The force load of templates from source
was introduced in Issue #35.
  • Loading branch information...
commit e7be8bea95ea12603d7b9581330020b2589a683d 1 parent 6bc3dcd
@databyte databyte authored
Showing with 6 additions and 7 deletions.
  1. +5 −1 CHANGELOG.md
  2. +1 −6 lib/rabl/template.rb
View
6 CHANGELOG.md
@@ -1,8 +1,12 @@
# CHANGELOG
+## 0.6.14 (unreleased)
+
+ * Fix RSpec under Rails 3, use render_views to test output (Thanks @agibralter)
+
## 0.6.13
- * Small tweak to is_collection detection (look for each and map)
+ * Small tweak to is_collection detection (look for each and map)
* Adds `include_child_root` configuration option (Thanks @yoon)
## 0.6.12
View
7 lib/rabl/template.rb
@@ -45,16 +45,11 @@ def compile(template) %{
module ActionView
module Template::Handlers
class Rabl
-
class_attribute :default_format
self.default_format = Mime::JSON
def self.call(template)
- source = if template.source.empty?
- File.read(template.identifier)
- else # use source
- template.source
- end
+ source = template.source
%{ ::Rabl::Engine.new(#{source.inspect}).
render(self, assigns.merge(local_assigns)) }

7 comments on commit e7be8be

@agibralter

Thank you! :)

@nesquena
Owner

@databyte Should I push out 0.6.14 for this one fix?

@databyte
Collaborator

Not required unless you have something else in the hopper.

My guess is that there's going to be several failing specs after this one because you need to specify render_views to test output again. It may warrant a minor point release (i.e. 0.7.0) with a note at the top of the README for a month or two.

@nesquena
Owner

Good point, we can release the next version as 0.7.0 in a bit then after fixing a few other issues. Need to take a look at some of the other issues / bugs this weekend.

@databyte
Collaborator

Sounds good, I'll take a look myself on Sunday. Meet you in IRC if needed. :smirk:

@qnm

This change tripped me up - adding a note on the README would be a good idea. I read the .14 changelog but didn't realise the implications immediately.

@databyte
Collaborator

Sure thing - I wanted to and forgot.

Please sign in to comment.
Something went wrong with that request. Please try again.