Commit cbd6f636046425444eaa78665574b234ced86a51
1 parent
10e7ec44
Exists in
staging
and in
39 other branches
rails4: fix functionals test after merge
Showing
3 changed files
with
7 additions
and
8 deletions
Show diff stats
lib/authenticated_system.rb
test/functional/application_controller_test.rb
test/functional/profile_controller_test.rb
| ... | ... | @@ -808,13 +808,11 @@ class ProfileControllerTest < ActionController::TestCase |
| 808 | 808 | end |
| 809 | 809 | |
| 810 | 810 | should 'the network activity be paginated' do |
| 811 | - p1= fast_create(Person) | |
| 812 | - 40.times{fast_create(ActionTrackerNotification, :action_tracker_id => fast_create(ActionTracker::Record), :profile_id => p1.id)} | |
| 811 | + User.current = user = create_user | |
| 812 | + p1 = user.person | |
| 813 | + 40.times{fast_create(ActionTrackerNotification, action_tracker_id: create(ActionTracker::Record, verb: :leave_scrap, user: p1, params: {content: 'blah'}), profile_id: p1.id)} | |
| 813 | 814 | |
| 814 | 815 | @controller.stubs(:logged_in?).returns(true) |
| 815 | - user = mock() | |
| 816 | - user.stubs(:person).returns(p1) | |
| 817 | - user.stubs(:login).returns('some') | |
| 818 | 816 | @controller.stubs(:current_user).returns(user) |
| 819 | 817 | get :index, :profile => p1.identifier |
| 820 | 818 | assert_equal 15, assigns(:network_activities).size |
| ... | ... | @@ -965,7 +963,7 @@ class ProfileControllerTest < ActionController::TestCase |
| 965 | 963 | |
| 966 | 964 | should 'the activities be paginated in people profiles' do |
| 967 | 965 | p1= fast_create(Person) |
| 968 | - 40.times{create(Scrap, :receiver_id => p1.id, :created_at => Time.now)} | |
| 966 | + 40.times{create(Scrap, sender: p1, receiver: p1, created_at: Time.now)} | |
| 969 | 967 | |
| 970 | 968 | @controller.stubs(:logged_in?).returns(true) |
| 971 | 969 | user = mock() |
| ... | ... | @@ -981,7 +979,7 @@ class ProfileControllerTest < ActionController::TestCase |
| 981 | 979 | should 'the activities be paginated in community profiles' do |
| 982 | 980 | p1= fast_create(Person) |
| 983 | 981 | c = fast_create(Community) |
| 984 | - 40.times{create(Scrap, :receiver_id => c.id)} | |
| 982 | + 40.times{create(Scrap, sender: p1, receiver: c)} | |
| 985 | 983 | |
| 986 | 984 | @controller.stubs(:logged_in?).returns(true) |
| 987 | 985 | user = mock() | ... | ... |