diff --git a/test/functional/tasks_controller_test.rb b/test/functional/tasks_controller_test.rb index 1328f76..053a05d 100644 --- a/test/functional/tasks_controller_test.rb +++ b/test/functional/tasks_controller_test.rb @@ -64,7 +64,7 @@ class TasksControllerTest < Test::Unit::TestCase end should 'affiliate roles to user after finish add member task' do - t = AddMember.create!(:person => profile, :community => profile) + t = AddMember.create!(:person => profile, :organization => profile) count = profile.members.size post :close, :decision => 'finish', :id => t.id profile = Profile.find(@profile.id) @@ -72,7 +72,7 @@ class TasksControllerTest < Test::Unit::TestCase end should 'display custom form to add members task' do - t = AddMember.create!(:person => profile, :community => profile) + t = AddMember.create!(:person => profile, :organization => profile) get :index, :profile => profile.identifier assert_tag :tag => 'form', :attributes => { :action => "/myprofile/#{profile.identifier}/tasks/close/#{t.id}" } end @@ -80,7 +80,7 @@ class TasksControllerTest < Test::Unit::TestCase should 'display member role checked if target has members' do profile.affiliate(profile, Profile::Roles.admin) assert_equal 1, profile.members.size - t = AddMember.create!(:person => profile, :community => profile) + t = AddMember.create!(:person => profile, :organization => profile) get :index, :profile => profile.identifier assert_tag :tag => 'input', :attributes => { :name => 'task[roles][]', :checked => 'checked', :value => Profile::Roles.member.id } end @@ -88,7 +88,7 @@ class TasksControllerTest < Test::Unit::TestCase should 'display roles besides role member unchecked if target has members' do profile.affiliate(profile, Profile::Roles.admin) assert_equal 1, profile.members.size - t = AddMember.create!(:person => profile, :community => profile) + t = AddMember.create!(:person => profile, :organization => profile) get :index, :profile => profile.identifier Role.find(:all).select{ |r| r.has_kind?('Profile') and r.id != Profile::Roles.member.id }.each do |i| assert_no_tag :tag => 'input', :attributes => { :name => 'task[roles][]', :checked => 'checked', :value => i.id } @@ -97,7 +97,7 @@ class TasksControllerTest < Test::Unit::TestCase should 'display all roles checked if target has no members' do assert_equal 0, profile.members.size - t = AddMember.create!(:person => profile, :community => profile) + t = AddMember.create!(:person => profile, :organization => profile) get :index, :profile => profile.identifier Role.find(:all).select{ |r| r.has_kind?('Profile') }.each do |i| assert_tag :tag => 'input', :attributes => { :name => 'task[roles][]', :checked => 'checked', :value => i.id } diff --git a/test/unit/add_friend_test.rb b/test/unit/add_friend_test.rb index 7428499..1e59029 100644 --- a/test/unit/add_friend_test.rb +++ b/test/unit/add_friend_test.rb @@ -72,7 +72,7 @@ class AddFriendTest < ActiveSupport::TestCase task = AddFriend.create!(:person => p1, :friend => p2) - assert_equal 'testuser1 wants to be your friend', task.description + assert_equal 'testuser1 wants to be your friend.', task.description end should 'has permission to manage friends' do diff --git a/test/unit/add_member_test.rb b/test/unit/add_member_test.rb index 8933165..1d8c8d0 100644 --- a/test/unit/add_member_test.rb +++ b/test/unit/add_member_test.rb @@ -10,7 +10,7 @@ class AddMemberTest < ActiveSupport::TestCase p = create_user('testuser1').person c = Community.create!(:name => 'closed community', :closed => true) TaskMailer.stubs(:deliver_target_notification) - task = AddMember.create!(:person => p, :community => c) + task = AddMember.create!(:person => p, :organization => c) assert_difference c, :members, [p] do task.finish c.reload @@ -45,7 +45,7 @@ class AddMemberTest < ActiveSupport::TestCase TaskMailer.expects(:deliver_target_notification).at_least_once - task = AddMember.create!(:person => p, :community => c) + task = AddMember.create!(:person => p, :organization => c) end should 'provide proper description' do @@ -54,14 +54,9 @@ class AddMemberTest < ActiveSupport::TestCase TaskMailer.stubs(:deliver_target_notification) - task = AddMember.create!(:person => p, :community => c) + task = AddMember.create!(:person => p, :organization => c) - assert_equal 'testuser1 wants to be a member', task.description - end - - should 'has community alias to target' do - t = AddMember.new - assert_same t.target, t.community + assert_equal 'testuser1 wants to be a member of "closed community".', task.description end should 'has permission to manage members' do @@ -73,7 +68,7 @@ class AddMemberTest < ActiveSupport::TestCase p = create_user('testuser1').person c = Community.create!(:name => 'community_test') TaskMailer.stubs(:deliver_target_notification) - task = AddMember.create!(:roles => [1,2,3], :person => p, :community => c) + task = AddMember.create!(:roles => [1,2,3], :person => p, :organization => c) assert_equal [1,2,3], task.roles end @@ -83,7 +78,7 @@ class AddMemberTest < ActiveSupport::TestCase roles = [Profile::Roles.member, Profile::Roles.admin] TaskMailer.stubs(:deliver_target_notification) - task = AddMember.create!(:roles => roles.map(&:id), :person => p, :community => c) + task = AddMember.create!(:roles => roles.map(&:id), :person => p, :organization => c) task.finish current_roles = p.find_roles(c).map(&:role) diff --git a/test/unit/pending_task_notifier_test.rb b/test/unit/pending_task_notifier_test.rb index a9c2072..18439fe 100644 --- a/test/unit/pending_task_notifier_test.rb +++ b/test/unit/pending_task_notifier_test.rb @@ -17,7 +17,7 @@ class PendingTaskNotifierTest < Test::Unit::TestCase env = Environment.default p = create_user('maelcum').person response = PendingTaskNotifier.deliver_notification(p) - assert_equal "#{env.name} - Pending tasks", response.subject + assert_equal "[#{env.name}] Pending tasks", response.subject assert_equal p.email, response.to[0] end -- libgit2 0.21.2