Add authentication and User model
* Add User model * Add SessionsController * Add password authentication on User * Request authentication for all actions except sign in * Add some helpers for ApplicationController * Update features to work with mandatory authentication
This commit is contained in:
26
spec/views/sessions/new.html.haml_spec.rb
Normal file
26
spec/views/sessions/new.html.haml_spec.rb
Normal file
@@ -0,0 +1,26 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'sessions/new.html.haml' do
|
||||
it 'renders a form to sign in' do
|
||||
render
|
||||
rendered.should \
|
||||
have_selector("form[method=post][action='#{sessions_path}']")
|
||||
rendered.should have_selector('input[type=submit]')
|
||||
end
|
||||
|
||||
it 'renders a text field with a label for the mail address' do
|
||||
render
|
||||
rendered.should \
|
||||
have_selector("input[type=text][name='session[email]']")
|
||||
rendered.should \
|
||||
have_selector('label[for=session_email]', :text => 'Email')
|
||||
end
|
||||
|
||||
it 'renders a password field with a label for the password' do
|
||||
render
|
||||
rendered.should \
|
||||
have_selector("input[type=password][name='session[password]']")
|
||||
rendered.should \
|
||||
have_selector('label[for=session_password]', :text => 'Password')
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user