Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Let local render_views override global setting #522

Merged
merged 1 commit into from Mar 31, 2012

Conversation

Projects
None yet
2 participants
Contributor

martinsvalin commented Mar 30, 2012

If render_views is enabled globally in the spec_helper, it clobbers attempts to disable it locally for specific examples due to the false || true logic.

Instead, only use the global setting if no local render_views was provided.

My use case: I am working on an old project, where render_views has been enabled globally for a long time. I'm trying to isolate new specs as much as possible, so I wanted to disable render_views for some new controller specs. Unfortunately render_views(false) didn't work as I expected it.

Here is a gist with steps to reproduce the behaviour: https://gist.github.com/2249825

I don't think this is the intended behaviour of render_views, so I'm contributing my patch upstream.

@martinsvalin martinsvalin Let local render_views override global setting
If render_views is enabled globally in the spec_helper, it clobbers attempts to disable it locally for specific examples due to the false || true logic.

Instead, only use the global setting if no local render_views was provided.
f7640ad

@justinko justinko added a commit that referenced this pull request Mar 31, 2012

@justinko justinko Merge pull request #522 from martinsvalin/render_views
Let local render_views override global setting
7419039

@justinko justinko merged commit 7419039 into rspec:master Mar 31, 2012

@justinko justinko added a commit that referenced this pull request Mar 31, 2012

@justinko justinko Changelog for #522 002f1da
Contributor

justinko commented Mar 31, 2012

Thanks @martinsvalin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment