Skip to content

Commit

Permalink
Home controller tests - test redirect and title (publiclab#2371)
Browse files Browse the repository at this point in the history
* Test homepage redirects to dashboard if user is logged in

* Add title check to homepage test
  • Loading branch information
seafr authored and jywarren committed Mar 7, 2018
1 parent 2dd7f57 commit 2f0c204
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/functional/home_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,18 @@ def setup
end

test 'should get home' do
title = I18n.t('home_controller.science_community')

get :home
assert_response :success
assert_select "title", "🎈 Public Lab: #{title}"
end

test 'home should redirect to dashboard if logged in' do
UserSession.create(users(:bob))

get :home
assert_redirected_to dashboard_url
end

test 'should get research if not logged by /dashboard' do
Expand Down

0 comments on commit 2f0c204

Please sign in to comment.