|
@@ -1,7 +1,19 @@
|
1
|
1
|
require "test_helper"
|
2
|
2
|
|
3
|
3
|
class TeamTest < ActiveSupport::TestCase
|
4
|
|
- # test "the truth" do
|
5
|
|
- # assert true
|
6
|
|
- # end
|
|
4
|
+ test "team with valid name should be created" do
|
|
5
|
+ team = Team.new(name: "Valid name", description: "Random description")
|
|
6
|
+ assert team.valid?
|
|
7
|
+ end
|
|
8
|
+
|
|
9
|
+ test "team with taken name should not be created" do
|
|
10
|
+ other_team = teams(:one)
|
|
11
|
+ team = Team.new(name: other_team.name, description: "Random description")
|
|
12
|
+ assert_not team.valid?
|
|
13
|
+ end
|
|
14
|
+
|
|
15
|
+ test "team without name should not be created" do
|
|
16
|
+ team = Team.new(description: "Random description")
|
|
17
|
+ assert_not team.valid?
|
|
18
|
+ end
|
7
|
19
|
end
|