changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec_on_rails/spec_resources/controllers/controller_spec_controller.rb

changeset 16: 01fd3f10ae84
author: moriq@moriq.com
date: Mon Mar 10 10:13:18 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec_on_rails
1class ControllerSpecController < ActionController::Base
2 if ['edge','2.0.0'].include?(ENV['RSPEC_RAILS_VERSION'])
3 set_view_path [File.join(File.dirname(__FILE__), "..", "views")]
4 else
5 set_view_path File.join(File.dirname(__FILE__), "..", "views")
6 end
7
8 def some_action
9 render :template => "template/that/does/not/actually/exist"
10 end
11
12 def action_with_template
13 session[:session_key] = "session value"
14 flash[:flash_key] = "flash value"
15 render :template => "controller_spec/action_with_template"
16 end
17
18 def action_with_partial
19 render :partial => "controller_spec/partial"
20 end
21
22 def action_with_partial_with_object
23 render :partial => "controller_spec/partial", :object => params[:thing]
24 end
25
26 def action_with_partial_with_locals
27 render :partial => "controller_spec/partial", :locals => {:thing => params[:thing]}
28 end
29
30 def action_with_errors_in_template
31 render :template => "controller_spec/action_with_errors_in_template"
32 end
33
34 def action_setting_the_assigns_hash
35 assigns['direct_assigns_key'] = :direct_assigns_key_value
36 @indirect_assigns_key = :indirect_assigns_key_value
37 end
38
39 def action_setting_flash_after_session_reset
40 reset_session
41 flash[:after_reset] = "available"
42 end
43
44 def action_setting_flash_before_session_reset
45 flash[:before_reset] = 'available'
46 reset_session
47 end
48
49 def action_with_render_update
50 render :update do |page|
51 page.replace :bottom, 'replace_me',
52 :partial => 'non_existent_partial'
53 end
54 end
55end
56