Sha256: 785449f30dad1c8e76f78d54922ed43a4796aad2e10e7e9ddba565361c6df89b

Contents?: true

Size: 481 Bytes

Versions: 3

Compression:

Stored size: 481 Bytes

Contents

require 'test_helper'

class SessionsControllerTest < ActionController::TestCase
  def test_new
    get :new
    assert_template 'new'
  end

  def test_create_invalid
    User.stubs(:authenticate).returns(nil)
    post :create
    assert_template 'new'
    assert_nil session['user_id']
  end

  def test_create_valid
    User.stubs(:authenticate).returns(User.first)
    post :create
    assert_redirected_to root_url
    assert_equal User.first.id, session['user_id']
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dailycred-0.3.1 dummy-preauth/test/functional/sessions_controller_test.rb
dailycred-0.3.0 dummy-preauth/test/functional/sessions_controller_test.rb
dailycred-0.2.0 dummy-preauth/test/functional/sessions_controller_test.rb