Module: ExplicitHelper
- Defined in:
- lib/vendor/plugins/rspec-rails/spec/resources/helpers/explicit_helper.rb
Instance Method Summary collapse
- #flash_thing ⇒ Object
- #method_in_explicit_helper ⇒ Object
- #method_using_output_buffer ⇒ Object
- #method_using_template ⇒ Object
- #named_path ⇒ Object
- #named_url ⇒ Object
- #params_foo ⇒ Object
-
#prepend(arg, &block) ⇒ Object
this is an example of a method spec’able with eval_erb in helper specs.
- #request_thing ⇒ Object
- #session_foo ⇒ Object
Instance Method Details
#flash_thing ⇒ Object
35 36 37 |
# File 'lib/vendor/plugins/rspec-rails/spec/resources/helpers/explicit_helper.rb', line 35 def flash_thing flash[:thing] end |
#method_in_explicit_helper ⇒ Object
2 3 4 |
# File 'lib/vendor/plugins/rspec-rails/spec/resources/helpers/explicit_helper.rb', line 2 def method_in_explicit_helper "<div>This is text from a method in the ExplicitHelper</div>" end |
#method_using_output_buffer ⇒ Object
39 40 41 |
# File 'lib/vendor/plugins/rspec-rails/spec/resources/helpers/explicit_helper.rb', line 39 def method_using_output_buffer concat("the_text_from_concat") end |
#method_using_template ⇒ Object
43 44 45 |
# File 'lib/vendor/plugins/rspec-rails/spec/resources/helpers/explicit_helper.rb', line 43 def method_using_template update_page { |p| p["#some_id"].replace_html "" } end |
#named_path ⇒ Object
19 20 21 |
# File 'lib/vendor/plugins/rspec-rails/spec/resources/helpers/explicit_helper.rb', line 19 def named_path rspec_on_rails_specs_path end |
#named_url ⇒ Object
15 16 17 |
# File 'lib/vendor/plugins/rspec-rails/spec/resources/helpers/explicit_helper.rb', line 15 def named_url rspec_on_rails_specs_url end |
#params_foo ⇒ Object
23 24 25 |
# File 'lib/vendor/plugins/rspec-rails/spec/resources/helpers/explicit_helper.rb', line 23 def params_foo params[:foo] end |
#prepend(arg, &block) ⇒ Object
this is an example of a method spec’able with eval_erb in helper specs
7 8 9 10 11 12 13 |
# File 'lib/vendor/plugins/rspec-rails/spec/resources/helpers/explicit_helper.rb', line 7 def prepend(arg, &block) begin # rails edge after 2.1.0 eliminated need for block.binding concat(arg) + block.call rescue concat(arg, block.binding) + block.call end end |
#request_thing ⇒ Object
31 32 33 |
# File 'lib/vendor/plugins/rspec-rails/spec/resources/helpers/explicit_helper.rb', line 31 def request_thing request.thing end |
#session_foo ⇒ Object
27 28 29 |
# File 'lib/vendor/plugins/rspec-rails/spec/resources/helpers/explicit_helper.rb', line 27 def session_foo session[:foo] end |