Commit 1e78417c33145811cad9890484e929bc834229a6
1 parent
b93de569
Exists in
master
and in
20 other branches
rails4: fix remaining unit and functionals tests
Showing
3 changed files
with
10 additions
and
5 deletions
Show diff stats
test/functional/search_controller_test.rb
... | ... | @@ -316,7 +316,7 @@ class SearchControllerTest < ActionController::TestCase |
316 | 316 | ev1 = create_event(person, :name => 'event 1', :category_ids => [@category.id], :start_date => ten_days_ago) |
317 | 317 | ev2 = create_event(person, :name => 'event 2', :category_ids => [@category.id], :start_date => DateTime.now - 2.month) |
318 | 318 | |
319 | - get :events, day: ten_days_ago.day+1.second, month: ten_days_ago.month, year: ten_days_ago.year | |
319 | + get :events, day: ten_days_ago.day, month: ten_days_ago.month, year: ten_days_ago.year | |
320 | 320 | assert_equal [ev1], assigns(:events) |
321 | 321 | end |
322 | 322 | |
... | ... | @@ -329,7 +329,7 @@ class SearchControllerTest < ActionController::TestCase |
329 | 329 | |
330 | 330 | ev2 = create_event(person, :name => 'event 2', :start_date => ten_days_ago) |
331 | 331 | |
332 | - get :events, day: ten_days_ago.day+1.second, month: ten_days_ago.month, year: ten_days_ago.year, category_path: @category.path.split('/') | |
332 | + get :events, day: ten_days_ago.day, month: ten_days_ago.month, year: ten_days_ago.year, category_path: @category.path.split('/') | |
333 | 333 | |
334 | 334 | assert_equal [ev1], assigns(:events) |
335 | 335 | end | ... | ... |
test/unit/person_notifier_test.rb
... | ... | @@ -48,6 +48,8 @@ class PersonNotifierTest < ActiveSupport::TestCase |
48 | 48 | |
49 | 49 | should 'display author name in delivered mail' do |
50 | 50 | @community.add_member(@member) |
51 | + ActionMailer::Base.deliveries.clear | |
52 | + | |
51 | 53 | Comment.create!(:author => @admin, :title => 'test comment', :body => 'body!', :source => @article) |
52 | 54 | process_delayed_job_queue |
53 | 55 | notify | ... | ... |
test/unit/scrap_test.rb
... | ... | @@ -88,7 +88,8 @@ class ScrapTest < ActiveSupport::TestCase |
88 | 88 | end |
89 | 89 | |
90 | 90 | should "create the leave_scrap action tracker verb on scrap creation of one user to another" do |
91 | - p1 = create_user.person | |
91 | + User.current = create_user | |
92 | + p1 = User.current.person | |
92 | 93 | p2 = create_user.person |
93 | 94 | s = Scrap.new |
94 | 95 | s.sender= p1 |
... | ... | @@ -105,7 +106,8 @@ class ScrapTest < ActiveSupport::TestCase |
105 | 106 | end |
106 | 107 | |
107 | 108 | should "create the leave_scrap action tracker verb on scrap creation of one user to community" do |
108 | - p = create_user.person | |
109 | + User.current = create_user | |
110 | + p = User.current.person | |
109 | 111 | c = fast_create(Community) |
110 | 112 | s = Scrap.new |
111 | 113 | s.sender= p |
... | ... | @@ -163,7 +165,8 @@ class ScrapTest < ActiveSupport::TestCase |
163 | 165 | end |
164 | 166 | |
165 | 167 | should "create the leave_scrap_to_self action tracker verb on scrap creation of one user to itself" do |
166 | - p = create_user.person | |
168 | + User.current = create_user | |
169 | + p = User.current.person | |
167 | 170 | s = Scrap.new |
168 | 171 | s.sender= p |
169 | 172 | s.receiver= p | ... | ... |