cirandas.net

ref: master

test/integration/editing_person_info_test.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require_relative "../test_helper"

class EditingPersonInfoTest < ActionDispatch::IntegrationTest

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

  should 'allow to edit person info' do

    profile = create_user('user_ze', :password => 'test', :password_confirmation => 'test').person

    profile.user.activate

    login(profile.identifier, 'test')

    get "/myprofile/#{profile.identifier}"
    assert_response :success

    assert_tag :tag => 'a', :attributes => { :href => "/myprofile/#{profile.identifier}/profile_editor/edit" }

    get "/myprofile/#{profile.identifier}/profile_editor/edit"
    assert_response :success

    post "/myprofile/#{profile.identifier}/profile_editor/edit", :profile_data => { :address => 'a new address', :contact_information => 'a new contact information' }
    assert_response :redirect

  end
end