Skip to content

Commit

Permalink
change tests
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkeash committed Oct 14, 2018
1 parent a364d8c commit 775c1ca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 29 deletions.
30 changes: 1 addition & 29 deletions tests/Feature/CheckInvitesTest.php
Expand Up @@ -104,7 +104,7 @@ public function it_can_have_unlimited_redemptions()
/**
* @test
*/
public function it_is_not_case_sensitive_on_uppercase_code()
public function it_is_not_case_sensitive()
{
Invite::forceCreate([
'code' => 'ABCDE',
Expand All @@ -114,32 +114,4 @@ public function it_is_not_case_sensitive_on_uppercase_code()
Assert::assertTrue(Doorman::check('abcde'));
Assert::assertTrue(Doorman::check('AbCdE'));
}

/**
* @test
*/
public function it_is_not_case_sensitive_on_lowercase_code()
{
Invite::forceCreate([
'code' => 'abcde',
]);

Assert::assertTrue(Doorman::check('ABCDE'));
Assert::assertTrue(Doorman::check('abcde'));
Assert::assertTrue(Doorman::check('AbCdE'));
}

/**
* @test
*/
public function it_is_not_case_sensitive_on_mixed_case_code()
{
Invite::forceCreate([
'code' => 'abCDe',
]);

Assert::assertTrue(Doorman::check('ABCDE'));
Assert::assertTrue(Doorman::check('abcde'));
Assert::assertTrue(Doorman::check('AbCdE'));
}
}
12 changes: 12 additions & 0 deletions tests/Feature/GenerateInvitesTest.php
Expand Up @@ -115,4 +115,16 @@ public function only_one_invite_per_email_can_be_generated_2()
{
Doorman::generate()->for('me@ashleyclarke.me')->times(3)->make();
}

/**
* @test
*/
public function generated_codes_should_always_be_uppercase()
{
Doorman::generate()->make();

$invite = Invite::first();

Assert::assertEquals(strtoupper($invite->code), $invite->code);
}
}

0 comments on commit 775c1ca

Please sign in to comment.