Commit 11ec6f1

mo khan <mo@mokhan.ca>
2015-01-03 14:55:16
update form to post to the registration create action.
1 parent 54a9473
Changed files (4)
app/views/registrations/new.html.erb
@@ -1,5 +1,5 @@
 <div class="row">
-<%= form_for @user, url: root_path do |f| %>
+<%= form_for @user, url: registrations_path do |f| %>
     <div class="small-12 columns">
       <label>Username
         <%= f.text_field :username, placeholder: "Username" %>
config/routes.rb
@@ -1,4 +1,4 @@
 Rails.application.routes.draw do
   root 'sessions#new'
-  resources :registrations, only: [:new]
-end
\ No newline at end of file
+  resources :registrations, only: [:new, :create]
+end
spec/controllers/registrations_controller_spec.rb
@@ -7,4 +7,4 @@ describe RegistrationsController do
       expect(assigns(:user)).to be_new_record
     end
   end
-end
\ No newline at end of file
+end
spec/routing/registrations_routing_spec.rb
@@ -0,0 +1,7 @@
+require 'rails_helper'
+
+describe '/registrations' do
+  it 'routes to the create action' do
+    expect(post: 'registrations').to route_to(controller: 'registrations', action: 'create')
+  end
+end