source: subversion/sites/rails_port/test/functional/user_preference_controller_test.rb @ 14676

Last change on this file since 14676 was 14586, checked in by tomhughes, 10 years ago

Merge api06 branch to trunk.

File size: 801 bytes
Line 
1require File.dirname(__FILE__) + '/../test_helper'
2
3class UserPreferenceControllerTest < ActionController::TestCase
4  fixtures :users, :user_preferences
5 
6  def test_read
7    # first try without auth
8    get :read
9    assert_response :unauthorized, "should be authenticated"
10   
11    # now set the auth
12    basic_authorization("test@openstreetmap.org", "test")
13   
14    get :read
15    assert_response :success
16    assert_select "osm:root" do
17      assert_select "preferences", :count => 1 do
18        assert_select "preference", :count => 2
19        assert_select "preference[k=\"#{user_preferences(:a).k}\"][v=\"#{user_preferences(:a).v}\"]", :count => 1
20        assert_select "preference[k=\"#{user_preferences(:two).k}\"][v=\"#{user_preferences(:two).v}\"]", :count => 1
21      end
22    end
23  end
24
25end
Note: See TracBrowser for help on using the repository browser.