Commit 31c7694397b06a5d87b279308f9287ba39a9c7f5
1 parent
992cf6bb
Exists in
master
and in
28 other branches
ActionItem720: fixing tests
Showing
1 changed file
with
8 additions
and
6 deletions
Show diff stats
test/functional/profile_controller_test.rb
| @@ -67,7 +67,7 @@ class ProfileControllerTest < Test::Unit::TestCase | @@ -67,7 +67,7 @@ class ProfileControllerTest < Test::Unit::TestCase | ||
| 67 | login_as(@profile.identifier) | 67 | login_as(@profile.identifier) |
| 68 | community = Community.create!(:name => 'my test community') | 68 | community = Community.create!(:name => 'my test community') |
| 69 | get :index, :profile => community.identifier | 69 | get :index, :profile => community.identifier |
| 70 | - assert_tag :tag => 'a', :content => 'Join this community' | 70 | + assert_tag :tag => 'a', :attributes => { :href => "/myprofile/#{@profile.identifier}/memberships/join/#{community.id}" } |
| 71 | end | 71 | end |
| 72 | 72 | ||
| 73 | should 'not show Join This Community button for member users' do | 73 | should 'not show Join This Community button for member users' do |
| @@ -75,13 +75,15 @@ class ProfileControllerTest < Test::Unit::TestCase | @@ -75,13 +75,15 @@ class ProfileControllerTest < Test::Unit::TestCase | ||
| 75 | community = Community.create!(:name => 'my test community') | 75 | community = Community.create!(:name => 'my test community') |
| 76 | community.add_member(@profile) | 76 | community.add_member(@profile) |
| 77 | get :index, :profile => community.identifier | 77 | get :index, :profile => community.identifier |
| 78 | - assert_no_tag :tag => 'a', :content => 'Join this community' | 78 | + assert_no_tag :tag => 'a', :attributes => { :href => "/myprofile/#{@profile.identifier}/memberships/join/#{community.id}" } |
| 79 | + | ||
| 79 | end | 80 | end |
| 80 | 81 | ||
| 81 | should 'not show Join This Community button for non-registered users' do | 82 | should 'not show Join This Community button for non-registered users' do |
| 82 | community = Community.create!(:name => 'my test community') | 83 | community = Community.create!(:name => 'my test community') |
| 83 | get :index, :profile => community.identifier | 84 | get :index, :profile => community.identifier |
| 84 | - assert_no_tag :tag => 'a', :content => 'Join this community' | 85 | + assert_no_tag :tag => 'a', :attributes => { :href => "/myprofile/#{@profile.identifier}/memberships/leave/#{community.id}" } |
| 86 | + | ||
| 85 | end | 87 | end |
| 86 | 88 | ||
| 87 | should 'not show enterprises link to enterprise' do | 89 | should 'not show enterprises link to enterprise' do |
| @@ -190,7 +192,7 @@ class ProfileControllerTest < Test::Unit::TestCase | @@ -190,7 +192,7 @@ class ProfileControllerTest < Test::Unit::TestCase | ||
| 190 | login_as(@profile.identifier) | 192 | login_as(@profile.identifier) |
| 191 | community = Community.create!(:name => 'my test community') | 193 | community = Community.create!(:name => 'my test community') |
| 192 | get :index, :profile => community.identifier | 194 | get :index, :profile => community.identifier |
| 193 | - assert_no_tag :tag => 'a', :content => 'Leave this community' | 195 | + assert_no_tag :tag => 'a', :attributes => { :href => "/myprofile/#{@profile.identifier}/memberships/leave/#{community.id}" } |
| 194 | end | 196 | end |
| 195 | 197 | ||
| 196 | should 'show Leave This Community button for member users' do | 198 | should 'show Leave This Community button for member users' do |
| @@ -198,13 +200,13 @@ class ProfileControllerTest < Test::Unit::TestCase | @@ -198,13 +200,13 @@ class ProfileControllerTest < Test::Unit::TestCase | ||
| 198 | community = Community.create!(:name => 'my test community') | 200 | community = Community.create!(:name => 'my test community') |
| 199 | community.add_member(@profile) | 201 | community.add_member(@profile) |
| 200 | get :index, :profile => community.identifier | 202 | get :index, :profile => community.identifier |
| 201 | - assert_tag :tag => 'a', :content => 'Leave this community' | 203 | + assert_tag :tag => 'a', :attributes => { :href => "/myprofile/#{@profile.identifier}/memberships/leave/#{community.id}" } |
| 202 | end | 204 | end |
| 203 | 205 | ||
| 204 | should 'not show Leave This Community button for non-registered users' do | 206 | should 'not show Leave This Community button for non-registered users' do |
| 205 | community = Community.create!(:name => 'my test community') | 207 | community = Community.create!(:name => 'my test community') |
| 206 | get :index, :profile => community.identifier | 208 | get :index, :profile => community.identifier |
| 207 | - assert_no_tag :tag => 'a', :content => 'Leave this community' | 209 | + assert_no_tag :tag => 'a', :attributes => { :href => "/myprofile/#{@profile.identifier}/memberships/leave/#{community.id}" } |
| 208 | end | 210 | end |
| 209 | 211 | ||
| 210 | should 'check access before displaying profile' do | 212 | should 'check access before displaying profile' do |