Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix specs expecting the token

Oliver Güntherf225b95b6903
diff --git a/spec/features/users/create_spec.rb b/spec/features/users/create_spec.rb
index 08817c6d595..846ba5e3218 100644
--- a/spec/features/users/create_spec.rb
+++ b/spec/features/users/create_spec.rb
@@ -43,7 +43,7 @@ describe 'create users', type: :feature, selenium: true do
perform_enqueued_jobs
ActionMailer::Base.deliveries.last
end
- let(:mail_body) { mail.body.parts.first.to_s }
+ let(:mail_body) { mail.body.parts.first.body.to_s }
let(:token) { mail_body.scan(/token=(.*)$/).first.first }
it 'creates the user' do
diff --git a/spec_legacy/functional/user_mailer_spec.rb b/spec_legacy/functional/user_mailer_spec.rb
index 9853f013f6a..5a470f82490 100644
--- a/spec_legacy/functional/user_mailer_spec.rb
+++ b/spec_legacy/functional/user_mailer_spec.rb
@@ -327,7 +327,8 @@ describe UserMailer, type: :mailer do
mail = UserMailer.user_signed_up(token)
assert mail.deliver_now
- assert mail.body.encoded.include?("https://redmine.foo/account/activate?token=#{token.value}")
+ assert mail.body.parts[0].body.include?("https://redmine.foo/account/activate?token=#{token.value}")
+ assert mail.body.parts[1].body.include?("https://redmine.foo/account/activate?token=#{token.value}")
end
context 'with locale settings',