System notice: In light of the Debian OpenSSL security issue we've regenerated the server keys. See this thread for instructions and the new key fingerprints.

Commit 4df2c72157a36da905827c946cc7098c2124a9c7

got nested integrate_views working

Commit diff

rspec_on_rails/lib/spec/rails/example/controller_example_group.rb

 
7272 #
7373 # See Spec::Rails::Example::ControllerExampleGroup for more information about
7474 # Integration and Isolation modes.
75 def integrate_views
76 @integrate_views = true
75 def integrate_views(integrate_views = true)
76 @integrate_views = integrate_views
7777 end
78
7879 def integrate_views? # :nodoc:
7980 @integrate_views
8081 end
82
83 def inherited(klass) # :nodoc:
84 klass.integrate_views(integrate_views?)
85 super
86 end
8187
8288 # You MUST provide a controller_name within the context of
8389 # your controller specs:
toggle raw diff

rspec_on_rails/spec/rails/example/controller_isolation_spec.rb

 
4040 lambda { get 'action_with_errors_in_template' }.should raise_error(ActionView::TemplateError)
4141 response.should_not be_success
4242 end
43
44 describe "nested" do
45 controller_name :controller_spec
46
47 it "should render a template" do
48 get 'action_with_template'
49 response.should be_success
50 response.should have_tag('div', 'This is action_with_template.rhtml')
51 end
52
53 describe "with integrate_views turned off" do
54 controller_name :controller_spec
55 integrate_views false
56
57 it "should not care if the template doesn't exist" do
58 get 'some_action'
59 response.should be_success
60 response.should render_template("template/that/does/not/actually/exist")
61 end
62 end
63 end
4364end
toggle raw diff