Beispiel #1
0
 /**
  * Checks that skills/stars/flags are correct
  *
  * (Have to decide an ordering here - probably alphabetical on skill name, case-insensitive)
  */
 public function testProfileNonEmptySkillsMatrix()
 {
     $faker = Faker\Factory::create();
     factory(App\Models\Profile::class, 'withAUser', 1)->create();
     factory(App\Models\Tag::class, 3)->create();
     $profile = App\Models\Profile::first();
     $rating = 5;
     foreach (App\Models\Tag::all() as $tag) {
         $seeking = $faker->boolean;
         $offering = $faker->boolean;
         $profile->add_tag($tag, $rating, $seeking, $offering);
         $tags[] = [$tag->name, $rating, $seeking, $offering];
         $rating = $rating - 1;
     }
     $this->visit(route('profile.view', ['name' => $profile->user->username]))->see('seeInElement', '.rating:nth-child(1)', 6)->see('seeInElement', '.rating:nth-child(2)', 4)->see('seeInElement', '.rating:nth-child(3)', 2);
 }