cirandas.net

ref: master

test/integration/login_to_the_application_test.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
require_relative "../test_helper"

class LoginToTheApplicationTest < ActionDispatch::IntegrationTest

  fixtures :users, :environments, :profiles

  def test_unauthenticated_user_tries_to_access_his_control_panel
    get '/myprofile/ze'
    assert_redirected_to '/account/login'

    post '/account/login', :user => { :login => 'ze', :password => "test" }

    assert_redirected_to '/myprofile/ze'
  end

end