summaryrefslogtreecommitdiff
path: root/gentoobrowse-api/unittests/testUsers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gentoobrowse-api/unittests/testUsers.cpp')
-rw-r--r--gentoobrowse-api/unittests/testUsers.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/gentoobrowse-api/unittests/testUsers.cpp b/gentoobrowse-api/unittests/testUsers.cpp
index 1b74006..0f5ee9c 100644
--- a/gentoobrowse-api/unittests/testUsers.cpp
+++ b/gentoobrowse-api/unittests/testUsers.cpp
@@ -57,15 +57,11 @@ BOOST_AUTO_TEST_CASE(authenticateVerify)
BOOST_AUTO_TEST_CASE(create)
{
- auto ms1 = IceTray::Cube::get<IceTray::Mail::MailServer>();
- BOOST_REQUIRE(ms1);
- auto ms = std::dynamic_pointer_cast<IceTray::Mail::MockMailServer>(ms1);
- BOOST_REQUIRE(ms);
auto user = u->create("testuser", "testpass", "Test User", "test@user.com");
- BOOST_REQUIRE_EQUAL(1, ms->getSentEmails().size());
- BOOST_REQUIRE_EQUAL("Gentoo Browse: Welcome", ms->getSentEmails().front()->subject);
- BOOST_REQUIRE_EQUAL("test@user.com", ms->getSentEmails().front()->to.address);
- BOOST_REQUIRE_EQUAL("Test User", ms->getSentEmails().front()->to.name);
+ BOOST_REQUIRE_EQUAL(1, mms->getSentEmails().size());
+ BOOST_REQUIRE_EQUAL("Gentoo Browse: Welcome", mms->getSentEmails().front()->subject);
+ BOOST_REQUIRE_EQUAL("test@user.com", mms->getSentEmails().front()->to.address);
+ BOOST_REQUIRE_EQUAL("Test User", mms->getSentEmails().front()->to.name);
BOOST_REQUIRE_EQUAL(4, user->userid);
BOOST_REQUIRE_EQUAL("testuser", user->username);
BOOST_REQUIRE_EQUAL("Test User", user->userrealname);
@@ -119,12 +115,10 @@ BOOST_AUTO_TEST_CASE(createAgain)
* * return original user
* * resend verification
*/
- auto ms = std::dynamic_pointer_cast<IceTray::Mail::MockMailServerImpl>(this->ms);
- BOOST_REQUIRE(ms);
auto user = u->create("testuser", "testpass", "Test User", "recreate@user.com");
- BOOST_REQUIRE_EQUAL(2, ms->getSentEmails().size());
- BOOST_REQUIRE_EQUAL("Gentoo Browse: Welcome", ms->getSentEmails()[1]->subject);
- BOOST_REQUIRE_EQUAL("test@user.com", ms->getSentEmails()[1]->to.address);
+ BOOST_REQUIRE_EQUAL(2, mms->getSentEmails().size());
+ BOOST_REQUIRE_EQUAL("Gentoo Browse: Welcome", mms->getSentEmails()[0]->subject);
+ BOOST_REQUIRE_EQUAL("test@user.com", mms->getSentEmails()[0]->to.address);
BOOST_REQUIRE_EQUAL(4, user->userid);
BOOST_REQUIRE_EQUAL(36, user->verifyguid.length());
}