Sha256: 06aaa7bf8b5d578ba584999c4fac545977d74b1b9108667aad56901d3fa8bb6a

Contents?: true

Size: 662 Bytes

Versions: 9

Compression:

Stored size: 662 Bytes

Contents

require 'test_helper'

class <%= session_plural_class_name %>ControllerTest < ActionController::TestCase
  def test_new
    get :new
    assert_template 'new'
  end
  
  def test_create_invalid
    post :create, :<%= session_singular_name %> => { :username => "foo", :password => "badpassword" }
    assert_template 'new'
    assert_nil <%= session_class_name %>.find
  end
  
  def test_create_valid
    post :create, :<%= session_singular_name %> => { :username => "foo", :password => "secret" }
    assert_redirected_to "/"
    assert_equal <%= user_plural_name %>(:foo), <%= session_class_name %>.find.<%= user_singular_name %>
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
flexi_generators-0.2.10 lib/generators/flexi/auth/templates/tests/testunit/sessions_controller.rb
flexi_generators-0.2.8 lib/generators/flexi_auth/templates/tests/testunit/sessions_controller.rb
flexi_generators-0.2.6 lib/generators/flexi_auth/templates/tests/testunit/sessions_controller.rb
flexi_generators-0.2.5 lib/generators/flexi_auth/templates/tests/testunit/sessions_controller.rb
flexi_generators-0.2.4 lib/generators/flexi_auth/templates/tests/testunit/sessions_controller.rb
flexi_generators-0.2.3 lib/generators/flexi_auth/templates/tests/testunit/sessions_controller.rb
flexi_generators-0.2.2 lib/generators/flexi_auth/templates/tests/testunit/sessions_controller.rb
flexi_generators-0.2.1 lib/generators/flexi_auth/templates/tests/testunit/sessions_controller.rb
flexi_generators-0.2.0 lib/generators/flexi_auth/templates/tests/testunit/sessions_controller.rb