Commit 4cee31db

mo khan <mo@mokhan.ca>
2014-08-06 23:32:37
create the new login page and action.
1 parent 0431641
Changed files (5)
app/controllers/sessions_controller.rb
@@ -0,0 +1,5 @@
+class SessionsController < ApplicationController
+  def new
+    @session = Session.new
+  end
+end
app/models/session.rb
@@ -0,0 +1,5 @@
+class Session
+
+  def persisted?
+  end
+end
app/views/sessions/new.html.erb
@@ -0,0 +1,1 @@
+<h1>login</h1>
config/routes.rb
@@ -33,6 +33,8 @@ Cake::Application.routes.draw do
   end
   get 'tags/:id' => 'creation_tags#show'
 
+  resources :sessions, only: [:new]
+
   # /search
   get "search" => 'search#index'
 
spec/controllers/sessions_controller_spec.rb
@@ -0,0 +1,11 @@
+require "rails_helper"
+
+describe SessionsController do
+  describe "#new" do
+    it "loads the login page" do
+      get :new
+      expect(response).to be_success
+      expect(assigns(:session)).to be_new_record
+    end
+  end
+end