Skip to content

Commit

Permalink
rename redirectresponder to actionredirectresponder
Browse files Browse the repository at this point in the history
  • Loading branch information
tcrayford committed Feb 18, 2012
1 parent a8598f2 commit 3c3f45f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/raptor/responders.rb
Expand Up @@ -11,7 +11,7 @@ def respond(route, subject, injector)
end
end

class RedirectResponder
class ActionRedirectResponder
def initialize(app_module, target)
@app_module = app_module
@target = target
Expand Down
2 changes: 1 addition & 1 deletion lib/raptor/router.rb
Expand Up @@ -171,7 +171,7 @@ def responder
template_path = @params[:render]

if redirect
RedirectResponder.new(@app_module, redirect)
ActionRedirectResponder.new(@app_module, redirect)
elsif text
PlaintextResponder.new(text)
elsif template_path
Expand Down
10 changes: 2 additions & 8 deletions spec/responders_spec.rb
Expand Up @@ -2,7 +2,7 @@
require_relative "spec_helper"
require_relative "../lib/raptor"

describe Raptor::RedirectResponder do
describe Raptor::ActionRedirectResponder do
before { Raptor.stub(:log) }

let(:app_module) { stub(:app_module) }
Expand All @@ -28,14 +28,8 @@
response['Location'].should == "/my_resource"
end

it "redirects to other places when given a string" do
response = redirect_to_action("http://google.com", stub)
response.status.should == 302
response['Location'].should == "http://google.com"
end

def redirect_to_action(action, record)
responder = Raptor::RedirectResponder.new(app_module, action)
responder = Raptor::ActionRedirectResponder.new(app_module, action)
response = responder.respond(route, record, Raptor::Injector.new)
end
end
Expand Down

0 comments on commit 3c3f45f

Please sign in to comment.