Sha256: 8fdc4fb60cc05c315a879733495f4f348c30b438b85e052a05535ccabbc8fe97

Contents?: true

Size: 862 Bytes

Versions: 47

Compression:

Stored size: 862 Bytes

Contents

module ExplicitHelper
  def method_in_explicit_helper
    "<div>This is text from a method in the ExplicitHelper</div>"
  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

Version data entries

47 entries across 47 versions & 10 rubygems

Version Path
cavalle-rspec-rails-1.2.2.0.1 spec/resources/helpers/explicit_helper.rb
cavalle-rspec-rails-1.2.2.0.2 spec/resources/helpers/explicit_helper.rb
cavalle-rspec-rails-1.2.3.1 spec/resources/helpers/explicit_helper.rb
cavalle-rspec-rails-1.2.4.0.1 spec/resources/helpers/explicit_helper.rb
dchelimsky-rspec-rails-1.1.12 spec/resources/helpers/explicit_helper.rb
dchelimsky-rspec-rails-1.1.99.1 spec/resources/helpers/explicit_helper.rb
dchelimsky-rspec-rails-1.1.99.13 spec/resources/helpers/explicit_helper.rb
dchelimsky-rspec-rails-1.1.99.2 spec/resources/helpers/explicit_helper.rb
dchelimsky-rspec-rails-1.1.99.3 spec/resources/helpers/explicit_helper.rb
dchelimsky-rspec-rails-1.1.99.4 spec/resources/helpers/explicit_helper.rb
dchelimsky-rspec-rails-1.1.99.5 spec/resources/helpers/explicit_helper.rb
dchelimsky-rspec-rails-1.1.99.6 spec/resources/helpers/explicit_helper.rb
dchelimsky-rspec-rails-1.1.99.7 spec/resources/helpers/explicit_helper.rb
dchelimsky-rspec-rails-1.1.99.8 spec/resources/helpers/explicit_helper.rb
dchelimsky-rspec-rails-1.1.99.9 spec/resources/helpers/explicit_helper.rb
mcmire-rspec-rails-1.1.99.9 spec/resources/helpers/explicit_helper.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/rspec-rails-1.3.4/spec/resources/helpers/explicit_helper.rb
richzhou-rspec-rails-1.3.4 spec/resources/helpers/explicit_helper.rb
rspec-rails-1.3.4 spec/resources/helpers/explicit_helper.rb
rspec-rails-1.3.3 spec/resources/helpers/explicit_helper.rb