Blame view

tests/integration/Tip/ShowTipInHomeTest.php 978 Bytes
e77200db5   nologostudio.ru   Initial commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  <?php
  
  namespace FootyRoom\Tests;
  
  use FootyRoom\Support\MongoClient;
  use FootyRoom\Config;
  
  class ShowTipInHomeTest extends TestCase
  {
      use SetsUpFixtures;
  
      public function setup()
      {
          parent::setup();
  
          $this->mongoDb = $this->app->make(MongoClient::class)->footyroom;
      }
  
      public function testShowTipSetToTrueShouldShowTipsInHomePage()
      {
          $response = $this->call('GET', '/');
          $this->assertEquals(200, $response->status());
          $this->assertContains('Betting Tips', $response->getContent());
      }
  
      public function testShowTipSetToFalseShouldNotShowTipsInHomePage()
      {
          $this->mongoDb->selectCollection('configs')->updateOne(
              ['_id' => 'home-page'],
              ['$set' => [
                  'showTips' => false,
              ]]
          );
  
          $response = $this->call('GET', '/');
          $this->assertEquals(200, $response->status());
          $response->assertDontSee('Betting Tips');
      }
  }