diff --git a/test/functional/profile_controller_test.rb b/test/functional/profile_controller_test.rb index d79ba08..4ae5b85 100644 --- a/test/functional/profile_controller_test.rb +++ b/test/functional/profile_controller_test.rb @@ -55,7 +55,7 @@ class ProfileControllerTest < ActionController::TestCase assert_response :success assert_template 'members' - assert assigns(:members_except_admins) + assert assigns(:profile_admins) assert assigns(:profile_admins) end @@ -1749,40 +1749,40 @@ class ProfileControllerTest < ActionController::TestCase assert_no_tag :tag => 'td', :descendant => { :tag => 'a', :content => /#{person.enterprises.count}/, :attributes => { :href => /profile\/#{person.identifier}\/enterprises$/ }} end - should 'only admins from a community be present in admin users div' do + should 'admins from a community be present in admin users div' do community = fast_create(Community) another_user = create_user('another_user').person login_as(@profile.identifier) community.add_admin(@profile) - community.add_member(another_user) + assert community.admins.include? @profile get :members, :profile => community.identifier - assert_tag :tag => 'div', :attributes => { :class => /profile-admins/}, + assert_tag :tag => 'ul', :attributes => { :class => /profile-list-admins/}, :descendant => { :tag => 'a', :attributes => { :title => "testuser" } } - assert_no_tag :tag => 'div', :attributes => { :class => /profile-admins/}, - :descendant => { :tag => 'a', :attributes => { :title => "another_user" } } + assert_no_tag :tag => 'ul', :attributes => { :class => /profile-list-members/}, + :descendant => { :tag => 'a', :attributes => { :title => "testuser" } } end - should 'only normal users from a community be present in normal users div' do + should 'all members, except admins, be present in members div' do community = fast_create(Community) - another_user = create_user('another_user').person - - login_as(@profile.identifier) + community.add_member(@profile) - community.add_admin(@profile) + another_user = create_user('another_user').person community.add_member(another_user) - get :members, :profile => community.identifier + assert_equal false, community.admins.include?(another_user) - assert_no_tag :tag => 'div', :attributes => { :class => /profile-members/}, - :descendant => { :tag => 'a', :attributes => { :title => "testuser" } } + get :members, :profile => community.identifier - assert_tag :tag => 'div', :attributes => { :class => /profile-members/}, + assert_tag :tag => 'ul', :attributes => { :class => /profile-list-members/}, :descendant => { :tag => 'a', :attributes => { :title => "another_user" } } + + assert_no_tag :tag => 'ul', :attributes => { :class => /profile-list-admins/}, + :descendant => { :tag => 'a', :attributes => { :title => "another_user" } } end should 'members be sorted by name in ascendant order' do -- libgit2 0.21.2