Created
February 2, 2012 23:32
-
-
Save ceaser/1726445 to your computer and use it in GitHub Desktop.
Overriding Controllers with Devise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Located at app/controllers/people/registrations_controller_spec.rb | |
class People::RegistrationsController < Devise::RegistrationsController | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Located at spec/controllers/people/registrations_controller_spec.rb | |
require 'spec_helper' | |
describe People::RegistrationsController do | |
describe "POST 'create'" do | |
it "creates an person" do | |
post :create | |
end | |
it "creates a site" | |
it "flashes a notice on successful signup" | |
it "should sign in" | |
it "should redirect to the 'Home#index'" | |
end | |
describe "POST 'create' with invalid parameters" do | |
it "flashes an invalid message" | |
it "expires session data" | |
it "renders 'new'" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Located at config/routes.rb | |
MyApp::Application.routes.draw do | |
devise_for :people, :controllers => { sessions: "people/sessions", registrations: "people/registrations"} | |
# ... | |
match '/person/sites' => 'sites#index', as: "person_root" | |
root :to => 'home#index' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment