Commit df51a028c8f75152f21f4a3bb46f666ac3566e4d
1 parent
69d5f48c
Exists in
staging
and in
39 other branches
rails4: set current user on approve_article tests
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
test/functional/application_controller_test.rb
... | ... | @@ -194,7 +194,6 @@ class ApplicationControllerTest < ActionController::TestCase |
194 | 194 | User.expects(:current=).with do |user| |
195 | 195 | user == testuser |
196 | 196 | end.at_least_once |
197 | - User.expects(:current=).with(nil).at_least_once if RUBY_VERSION >= '2.0' | |
198 | 197 | get :index |
199 | 198 | end |
200 | 199 | ... | ... |
test/unit/approve_article_test.rb
... | ... | @@ -6,7 +6,8 @@ class ApproveArticleTest < ActiveSupport::TestCase |
6 | 6 | ActionMailer::Base.delivery_method = :test |
7 | 7 | ActionMailer::Base.perform_deliveries = true |
8 | 8 | ActionMailer::Base.deliveries = [] |
9 | - @profile = create_user('test_user').person | |
9 | + User.current = @user = create_user 'test_user' | |
10 | + @profile = @user.person | |
10 | 11 | @article = fast_create(TextileArticle, :profile_id => @profile.id, :name => 'test name', :abstract => 'Lead of article', :body => 'This is my article') |
11 | 12 | @community = fast_create(Community) |
12 | 13 | @community.add_member(@profile) | ... | ... |