Permalink
Browse files

Merge pull request #522 from martinsvalin/render_views

Let local render_views override global setting
  • Loading branch information...
2 parents 6b7adaf + f7640ad commit 7419039a195954c951d07657be3d8df3b1f6c3c0 @justinko justinko committed Mar 31, 2012
Showing with 8 additions and 1 deletion.
  1. +2 −1 lib/rspec/rails/view_rendering.rb
  2. +6 −0 spec/rspec/rails/view_rendering_spec.rb
@@ -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
@@ -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

0 comments on commit 7419039

Please sign in to comment.