editing_person_info_test.rb 784 Bytes
require "#{File.dirname(__FILE__)}/../test_helper"

class EditingPersonInfoTest < ActionController::IntegrationTest

  fixtures :users, :profiles, :domains, :environments

  should 'allow to edit person info' do

    profile = Profile.find_by_identifier('ze')

    login('ze', 'test')

    get '/myprofile/ze'
    assert_response :success

    assert_tag :tag => 'td', :content => profile.name
    assert_tag :tag => 'td', :content => profile.address
    assert_tag :tag => 'td', :content => profile.contact_information

    get '/myprofile/ze/profile_editor/edit'
    assert_response :success

    post '/myprofile/ze/profile_editor/edit', :profile_data => { :address => 'a new address', :contact_information => 'a new contact information' }
    assert_response :redirect

  end
end