Skip to content

Commit

Permalink
#141 refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Suban05 committed Sep 2, 2024
1 parent 2151683 commit 920830a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/baza/test_tokens.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,17 @@ def test_creates_token
def test_notify_user_after_creating
loog = Loog::Buffer.new
human = Baza::Humans.new(fake_pgsql, tbot: Baza::Tbot::Fake.new(loog)).ensure(fake_name)
tokens = human.tokens
name = fake_name
token = tokens.add(name)
token = human.tokens.add(name)
assert_equal(token.name, name)
assert_includes(loog.to_s, "Token with the name '#{name}' has been created successfully")
end

def test_does_not_notify_user_after_fail_creating
loog = Loog::Buffer.new
human = Baza::Humans.new(fake_pgsql, tbot: Baza::Tbot::Fake.new(loog)).ensure(fake_name)
tokens = human.tokens
assert_raises do
tokens.add(nil)
human.tokens.add(nil)
end
assert_empty(loog.to_s)
end
Expand Down

0 comments on commit 920830a

Please sign in to comment.