Update tests to set the username cookie as necessary

This commit is contained in:
Tom Hughes 2011-11-07 21:41:49 +00:00
parent 9e2132b83d
commit 33fb432beb
3 changed files with 15 additions and 1 deletions

View file

@ -43,6 +43,8 @@ class SiteControllerTest < ActionController::TestCase
# test the right editor gets used when the user hasn't set a preference
def test_edit_without_preference
@request.cookies["_osm_username"] = users(:public_user).display_name
get(:edit, nil, { 'user' => users(:public_user).id })
assert_response :success
assert_template :partial => "_#{DEFAULT_EDITOR}", :count => 1
@ -50,6 +52,8 @@ class SiteControllerTest < ActionController::TestCase
# and when they have...
def test_edit_with_preference
@request.cookies["_osm_username"] = users(:public_user).display_name
user = users(:public_user)
user.preferred_editor = "potlatch"
user.save!