From df51a028c8f75152f21f4a3bb46f666ac3566e4d Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Fri, 11 Sep 2015 20:14:31 -0300 Subject: [PATCH] rails4: set current user on approve_article tests --- test/functional/application_controller_test.rb | 1 - test/unit/approve_article_test.rb | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb index cd4afec..a06af8f 100644 --- a/test/functional/application_controller_test.rb +++ b/test/functional/application_controller_test.rb @@ -194,7 +194,6 @@ class ApplicationControllerTest < ActionController::TestCase User.expects(:current=).with do |user| user == testuser end.at_least_once - User.expects(:current=).with(nil).at_least_once if RUBY_VERSION >= '2.0' get :index end diff --git a/test/unit/approve_article_test.rb b/test/unit/approve_article_test.rb index 3862431..253fcc0 100644 --- a/test/unit/approve_article_test.rb +++ b/test/unit/approve_article_test.rb @@ -6,7 +6,8 @@ class ApproveArticleTest < ActiveSupport::TestCase ActionMailer::Base.delivery_method = :test ActionMailer::Base.perform_deliveries = true ActionMailer::Base.deliveries = [] - @profile = create_user('test_user').person + User.current = @user = create_user 'test_user' + @profile = @user.person @article = fast_create(TextileArticle, :profile_id => @profile.id, :name => 'test name', :abstract => 'Lead of article', :body => 'This is my article') @community = fast_create(Community) @community.add_member(@profile) -- libgit2 0.21.2