Commit d9d6ea895989382bd581db6acbebce3342b702a0
1 parent
ece9470c
Exists in
2_split_by_role
Fixed tests for article split_by_role
Showing
1 changed file
with
15 additions
and
15 deletions
Show diff stats
test/functional/profile_controller_test.rb
@@ -55,7 +55,7 @@ class ProfileControllerTest < ActionController::TestCase | @@ -55,7 +55,7 @@ class ProfileControllerTest < ActionController::TestCase | ||
55 | 55 | ||
56 | assert_response :success | 56 | assert_response :success |
57 | assert_template 'members' | 57 | assert_template 'members' |
58 | - assert assigns(:members_except_admins) | 58 | + assert assigns(:profile_admins) |
59 | assert assigns(:profile_admins) | 59 | assert assigns(:profile_admins) |
60 | end | 60 | end |
61 | 61 | ||
@@ -1749,40 +1749,40 @@ class ProfileControllerTest < ActionController::TestCase | @@ -1749,40 +1749,40 @@ class ProfileControllerTest < ActionController::TestCase | ||
1749 | assert_no_tag :tag => 'td', :descendant => { :tag => 'a', :content => /#{person.enterprises.count}/, :attributes => { :href => /profile\/#{person.identifier}\/enterprises$/ }} | 1749 | assert_no_tag :tag => 'td', :descendant => { :tag => 'a', :content => /#{person.enterprises.count}/, :attributes => { :href => /profile\/#{person.identifier}\/enterprises$/ }} |
1750 | end | 1750 | end |
1751 | 1751 | ||
1752 | - should 'only admins from a community be present in admin users div' do | 1752 | + should 'admins from a community be present in admin users div' do |
1753 | community = fast_create(Community) | 1753 | community = fast_create(Community) |
1754 | another_user = create_user('another_user').person | 1754 | another_user = create_user('another_user').person |
1755 | 1755 | ||
1756 | login_as(@profile.identifier) | 1756 | login_as(@profile.identifier) |
1757 | 1757 | ||
1758 | community.add_admin(@profile) | 1758 | community.add_admin(@profile) |
1759 | - community.add_member(another_user) | ||
1760 | 1759 | ||
1760 | + assert community.admins.include? @profile | ||
1761 | get :members, :profile => community.identifier | 1761 | get :members, :profile => community.identifier |
1762 | 1762 | ||
1763 | - assert_tag :tag => 'div', :attributes => { :class => /profile-admins/}, | 1763 | + assert_tag :tag => 'ul', :attributes => { :class => /profile-list-admins/}, |
1764 | :descendant => { :tag => 'a', :attributes => { :title => "testuser" } } | 1764 | :descendant => { :tag => 'a', :attributes => { :title => "testuser" } } |
1765 | 1765 | ||
1766 | - assert_no_tag :tag => 'div', :attributes => { :class => /profile-admins/}, | ||
1767 | - :descendant => { :tag => 'a', :attributes => { :title => "another_user" } } | 1766 | + assert_no_tag :tag => 'ul', :attributes => { :class => /profile-list-members/}, |
1767 | + :descendant => { :tag => 'a', :attributes => { :title => "testuser" } } | ||
1768 | end | 1768 | end |
1769 | 1769 | ||
1770 | - should 'only normal users from a community be present in normal users div' do | 1770 | + should 'all members, except admins, be present in members div' do |
1771 | community = fast_create(Community) | 1771 | community = fast_create(Community) |
1772 | - another_user = create_user('another_user').person | ||
1773 | - | ||
1774 | - login_as(@profile.identifier) | 1772 | + community.add_member(@profile) |
1775 | 1773 | ||
1776 | - community.add_admin(@profile) | 1774 | + another_user = create_user('another_user').person |
1777 | community.add_member(another_user) | 1775 | community.add_member(another_user) |
1778 | 1776 | ||
1779 | - get :members, :profile => community.identifier | 1777 | + assert_equal false, community.admins.include?(another_user) |
1780 | 1778 | ||
1781 | - assert_no_tag :tag => 'div', :attributes => { :class => /profile-members/}, | ||
1782 | - :descendant => { :tag => 'a', :attributes => { :title => "testuser" } } | 1779 | + get :members, :profile => community.identifier |
1783 | 1780 | ||
1784 | - assert_tag :tag => 'div', :attributes => { :class => /profile-members/}, | 1781 | + assert_tag :tag => 'ul', :attributes => { :class => /profile-list-members/}, |
1785 | :descendant => { :tag => 'a', :attributes => { :title => "another_user" } } | 1782 | :descendant => { :tag => 'a', :attributes => { :title => "another_user" } } |
1783 | + | ||
1784 | + assert_no_tag :tag => 'ul', :attributes => { :class => /profile-list-admins/}, | ||
1785 | + :descendant => { :tag => 'a', :attributes => { :title => "another_user" } } | ||
1786 | end | 1786 | end |
1787 | 1787 | ||
1788 | should 'members be sorted by name in ascendant order' do | 1788 | should 'members be sorted by name in ascendant order' do |