Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/rspec/rails/view_rendering.rb
Expand Up @@ -47,7 +47,8 @@ def integrate_views

# @api private
def render_views?
metadata_for_rspec_rails[:render_views] || RSpec.configuration.render_views?
return RSpec.configuration.render_views? unless metadata_for_rspec_rails.key? :render_views
metadata_for_rspec_rails[:render_views]
end
end

Expand Down
6 changes: 6 additions & 0 deletions spec/rspec/rails/view_rendering_spec.rb
Expand Up @@ -54,6 +54,12 @@ def example.controller
group.render_views false
group.new.render_views?.should be_false
end

it "overrides the global config if render_views is enabled there" do
RSpec.configuration.stub(:render_views?).and_return true
group.render_views false
group.new.render_views?.should be_false
end
end

context "in a nested group" do
Expand Down