Commit f61d6f06b5301b283a7702a36c5a45f1c33544b9
1 parent
fa8d3216
Exists in
master
and in
29 other branches
rails3: fix tests of profile_members_controller
Showing
2 changed files
with
6 additions
and
6 deletions
Show diff stats
app/views/profile_members/_members_list.html.erb
| ... | ... | @@ -17,9 +17,9 @@ |
| 17 | 17 | <%= button_without_text :edit, _('Edit'), :action => 'change_role', :id => m %> |
| 18 | 18 | <%= button_to_remote_without_text(:remove, _('Remove'), |
| 19 | 19 | :update => 'members-list', |
| 20 | - :loading => '$("members-list").addClassName("loading")', | |
| 21 | - :success => "$('tr-#{m.identifier}').show()", | |
| 22 | - :complete => '$("members-list").removeClassName("loading")', | |
| 20 | + :loading => j('$("members-list").addClassName("loading")'), | |
| 21 | + :success => j("$('tr-#{m.identifier}').show()"), | |
| 22 | + :complete => j('$("members-list").removeClassName("loading")'), | |
| 23 | 23 | :url => { :id => m }.merge(remove_action)) if m != user %> |
| 24 | 24 | </div> |
| 25 | 25 | </td> | ... | ... |
test/functional/profile_members_controller_test.rb
| ... | ... | @@ -122,7 +122,7 @@ class ProfileMembersControllerTest < ActionController::TestCase |
| 122 | 122 | get :unassociate, :profile => com.identifier, :id => member |
| 123 | 123 | |
| 124 | 124 | assert_response :success |
| 125 | - assert_equal nil, @response.layout | |
| 125 | + assert_template :layout => nil | |
| 126 | 126 | member.reload |
| 127 | 127 | com.reload |
| 128 | 128 | assert_not_includes com.members, member |
| ... | ... | @@ -339,12 +339,12 @@ class ProfileMembersControllerTest < ActionController::TestCase |
| 339 | 339 | ent = fast_create(Enterprise, :name => 'Test Ent', :identifier => 'test_ent') |
| 340 | 340 | p = create_user_with_permission('test_user', 'manage_memberships', ent) |
| 341 | 341 | login_as :test_user |
| 342 | - r = ent.environment.roles.create!(:name => 'test_role', :permissions => ['some_perm']) | |
| 342 | + r = ent.environment.roles.create!(:name => 'test_role', :permissions => ['edit_profile']) | |
| 343 | 343 | get :update_roles, :profile => ent.identifier, :person => p.id, :roles => ["0", r.id, nil] |
| 344 | 344 | |
| 345 | 345 | p_roles = p.find_roles(ent).map(&:role).uniq |
| 346 | 346 | |
| 347 | - assert p_roles, [r] | |
| 347 | + assert_equal [r], p_roles | |
| 348 | 348 | end |
| 349 | 349 | |
| 350 | 350 | should 'set a community member as admin' do | ... | ... |