Sha256: fd1db98b5caf4cec36626a0efc7a187cfa03967d8f764f812d6b55c989e65810

Contents?: true

Size: 1.77 KB

Versions: 68

Compression:

Stored size: 1.77 KB

Contents

class RedirectSpecController < ApplicationController

  def action_with_no_redirect
    render :text => "this is just here to keep this from causing a MissingTemplate error"
  end
  
  def action_with_redirect_to_somewhere
    redirect_to :action => 'somewhere'
  end
  
  def action_with_redirect_to_other_somewhere
    redirect_to :controller => 'render_spec', :action => 'text_action'
  end
  
  def action_with_redirect_to_somewhere_and_return
    redirect_to :action => 'somewhere' and return
    render :text => "this is after the return"
  end
  
  def somewhere
    render :text => "this is just here to keep this from causing a MissingTemplate error"
  end
  
  def action_with_redirect_to_rspec_site
    redirect_to "http://rspec.rubyforge.org"
  end
  
  def action_with_redirect_back
    redirect_to :back
  end
  
  def action_with_redirect_in_respond_to
    respond_to do |wants|
      wants.html { redirect_to :action => 'somewhere' }
    end
  end

  def action_with_redirect_which_creates_query_string
    redirect_to :action => "somewhere", :id => 1111, :param1 => "value1", :param2 => "value2"
  end

  # note: sometimes this is the URL which rails will generate from the hash in
  # action_with_redirect_which_creates_query_string
  def action_with_redirect_with_query_string_order1
    redirect_to "http://test.host/redirect_spec/somewhere/1111?param1=value1&param2=value2"
  end

  # note: sometimes this is the URL which rails will generate from the hash in
  # action_with_redirect_which_creates_query_string
  def action_with_redirect_with_query_string_order2
    redirect_to "http://test.host/redirect_spec/somewhere/1111?param2=value2&param1=value1"
  end

  def action_with_redirect_to_unroutable_url_inside_app
    redirect_to :controller => "nonexistant", :action => "none"
  end

end

Version data entries

68 entries across 68 versions & 12 rubygems

Version Path
dchelimsky-rspec-rails-1.1.10 spec_resources/controllers/redirect_spec_controller.rb
dchelimsky-rspec-rails-1.1.11.1 spec/resources/controllers/redirect_spec_controller.rb
dchelimsky-rspec-rails-1.1.11.2 spec/resources/controllers/redirect_spec_controller.rb
dchelimsky-rspec-rails-1.1.11.3 spec/resources/controllers/redirect_spec_controller.rb
dchelimsky-rspec-rails-1.1.11.4 spec/resources/controllers/redirect_spec_controller.rb
dchelimsky-rspec-rails-1.1.11.5 spec/resources/controllers/redirect_spec_controller.rb
dchelimsky-rspec-rails-1.1.11.6 spec/resources/controllers/redirect_spec_controller.rb
dchelimsky-rspec-rails-1.1.11 spec_resources/controllers/redirect_spec_controller.rb
dchelimsky-rspec-rails-1.1.6 spec_resources/controllers/redirect_spec_controller.rb
dchelimsky-rspec-rails-1.1.7 spec_resources/controllers/redirect_spec_controller.rb
dchelimsky-rspec-rails-1.1.8 spec_resources/controllers/redirect_spec_controller.rb
dchelimsky-rspec-rails-1.1.9 spec_resources/controllers/redirect_spec_controller.rb
jcnetdev-rspec-rails-1.1.5 spec_resources/controllers/redirect_spec_controller.rb
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec-rails/spec_resources/controllers/redirect_spec_controller.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec-rails/spec_resources/controllers/redirect_spec_controller.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec-rails/spec_resources/controllers/redirect_spec_controller.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec-rails/spec_resources/controllers/redirect_spec_controller.rb
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/plugins/rspec_on_rails/spec_resources/controllers/redirect_spec_controller.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/plugins/rspec_on_rails/spec_resources/controllers/redirect_spec_controller.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/plugins/rspec_on_rails/spec_resources/controllers/redirect_spec_controller.rb