From 5f3139b538d1ff58b719a72d7c7cf05a5b6136b5 Mon Sep 17 00:00:00 2001 From: Francis Irving Date: Wed, 2 Dec 2009 17:51:30 +0000 Subject: Part of upgrade to rails 2.3.2 --- .../spec/resources/helpers/addition_helper.rb | 5 +++ .../spec/resources/helpers/explicit_helper.rb | 46 ++++++++++++++++++++++ .../spec/resources/helpers/more_explicit_helper.rb | 5 +++ .../resources/helpers/plugin_application_helper.rb | 6 +++ .../spec/resources/helpers/view_spec_helper.rb | 13 ++++++ 5 files changed, 75 insertions(+) create mode 100644 vendor/plugins/rspec-rails/spec/resources/helpers/addition_helper.rb create mode 100644 vendor/plugins/rspec-rails/spec/resources/helpers/explicit_helper.rb create mode 100644 vendor/plugins/rspec-rails/spec/resources/helpers/more_explicit_helper.rb create mode 100644 vendor/plugins/rspec-rails/spec/resources/helpers/plugin_application_helper.rb create mode 100644 vendor/plugins/rspec-rails/spec/resources/helpers/view_spec_helper.rb (limited to 'vendor/plugins/rspec-rails/spec/resources/helpers') diff --git a/vendor/plugins/rspec-rails/spec/resources/helpers/addition_helper.rb b/vendor/plugins/rspec-rails/spec/resources/helpers/addition_helper.rb new file mode 100644 index 000000000..14ad70c3e --- /dev/null +++ b/vendor/plugins/rspec-rails/spec/resources/helpers/addition_helper.rb @@ -0,0 +1,5 @@ +module AdditionHelper + def plus(addend) + @addend + addend + end +end diff --git a/vendor/plugins/rspec-rails/spec/resources/helpers/explicit_helper.rb b/vendor/plugins/rspec-rails/spec/resources/helpers/explicit_helper.rb new file mode 100644 index 000000000..f75d1ddcb --- /dev/null +++ b/vendor/plugins/rspec-rails/spec/resources/helpers/explicit_helper.rb @@ -0,0 +1,46 @@ +module ExplicitHelper + def method_in_explicit_helper + "
This is text from a method in the ExplicitHelper
" + end + + # this is an example of a method spec'able with eval_erb in helper specs + 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 + + def named_url + rspec_on_rails_specs_url + end + + def named_path + rspec_on_rails_specs_path + end + + def params_foo + params[:foo] + end + + def session_foo + session[:foo] + end + + def request_thing + request.thing + end + + def flash_thing + flash[:thing] + end + + def method_using_output_buffer + concat("the_text_from_concat") + end + + def method_using_template + update_page { |p| p["#some_id"].replace_html "" } + end +end diff --git a/vendor/plugins/rspec-rails/spec/resources/helpers/more_explicit_helper.rb b/vendor/plugins/rspec-rails/spec/resources/helpers/more_explicit_helper.rb new file mode 100644 index 000000000..7468741b2 --- /dev/null +++ b/vendor/plugins/rspec-rails/spec/resources/helpers/more_explicit_helper.rb @@ -0,0 +1,5 @@ +module MoreExplicitHelper + def method_in_more_explicit_helper + "
This is text from a method in the MoreExplicitHelper
" + end +end diff --git a/vendor/plugins/rspec-rails/spec/resources/helpers/plugin_application_helper.rb b/vendor/plugins/rspec-rails/spec/resources/helpers/plugin_application_helper.rb new file mode 100644 index 000000000..2107d2218 --- /dev/null +++ b/vendor/plugins/rspec-rails/spec/resources/helpers/plugin_application_helper.rb @@ -0,0 +1,6 @@ +# Methods added to this helper will be available to all templates in the application. +module ApplicationHelper + def method_in_plugin_application_helper + "
This is text from a method in the ApplicationHelper
" + end +end diff --git a/vendor/plugins/rspec-rails/spec/resources/helpers/view_spec_helper.rb b/vendor/plugins/rspec-rails/spec/resources/helpers/view_spec_helper.rb new file mode 100644 index 000000000..b05fc53f7 --- /dev/null +++ b/vendor/plugins/rspec-rails/spec/resources/helpers/view_spec_helper.rb @@ -0,0 +1,13 @@ +module ViewSpecHelper + def method_in_helper + "
This is text from a method in the ViewSpecHelper
" + end + + def method_in_template_with_partial + "
method_in_template_with_partial in ViewSpecHelper
" + end + + def method_in_partial + "
method_in_partial in ViewSpecHelper
" + end +end -- cgit v1.2.3