gma / nesta

File Based CMS and Static Site Generator
http://nestacms.com
MIT License
902 stars 122 forks source link

Summaries scope #18

Closed cfurrow closed 13 years ago

cfurrow commented 13 years ago

Using correct branch for this pull request now.

Added scope param to another area that needed it to maintain context in Haml renderings

gma commented 13 years ago

Cheers for spotting that/submitting the pull request. Unfortunately I get 12 spec failures when I run rake spec.

This bug clearly needs fixing though; I can put it on my todo list if you like, or if you fancy fixing it I'd really appreciate a new test to cover the rendering in the body method too. I was just looking at why I missed this, and it's clearly not DRY enough; I suspect we need a protected rendering method on FileModel that takes some markup and returns some HTML.

cfurrow commented 13 years ago

I'll look into those failing tests a little bit. I feel silly for not checking that out before checking in.

I like the idea of creating a rendering method in the FileModel. Sounds like a good place to head to next.

cfurrow commented 13 years ago

Fixed the 12 specs that were failing by passing in nil scopes for article.body() calls in models_spec.rb and updated atom.builder to pass in a nil scope for article.body() call.

Now to create a new spec (or set of specs) for the new haml scope stuff for this pull req.

gma commented 13 years ago

How about we set a default value for scope as nil (e.g. def body(scope = nil)) and then we don't need to pass anything in the specs? That'd work the same way as the other call then.

I think it probably only needs one spec to cover this; we just need to prove that it can call one of the helpers. The test I added the other day called a date helper, I think.

gma commented 13 years ago

I finally got around to sorting this, taking your implementation and writing a new spec for it.

https://github.com/gma/nesta/commit/0cab9041f2e9d8097259d2a1c627dfde4fd11789

Cheers, Graham