4 class CompaniesControllerTest < ActionDispatch::IntegrationTest
6 # test all routes which lead to this controller
9 { :path => "/profile/company", :method => :get },
10 { :controller => "profiles/companies", :action => "show" }
13 { :path => "/profile/company", :method => :put },
14 { :controller => "profiles/companies", :action => "update" }
22 get profile_company_path
24 assert_response :success
28 def test_show_unauthorized
29 get profile_company_path
31 assert_redirected_to login_path(:referer => profile_company_path)
38 put profile_company_path, :params => { :user => { :company => "new company", :description => user.description } }
40 assert_redirected_to user_path(user)
42 assert_response :success
44 assert_dom ".alert-success", :text => "Profile company updated."
47 assert_equal "new company", user.company