Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkadiusz-Wrzawinski-DNA committed Oct 15, 2024
1 parent 0a58030 commit 5c6a31d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
18 changes: 9 additions & 9 deletions test/models/merchant_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

class MerchantTest < ActiveSupport::TestCase
test "should not save merchant without a name" do
merchant = Merchant.new merchantId: "TESTID"
assert_not _merchant.save
merchant = Merchant.new merchantId: "TESTID"
assert_not merchant.save
end

test "should not save merchant without a merchantId" do
merchant = Merchant.new name: "TESTNAME"
assert_not _merchant.save
merchant = Merchant.new name: "TESTNAME"
assert_not merchant.save
end

test "should save merchant with a merchantId and a name" do
merchant = Merchant.new merchantId: "TESTID", name: "TESTNAME"
assert _merchant.save
merchant = Merchant.new merchantId: "TESTID", name: "TESTNAME"
assert merchant.save
end

test "should create and save merchant with a random UUID as merchantId" do
merchant = Merchant.create_with_uuid name: "TESTNAME"
assert _merchant.persisted?
assert_equal 36, _merchant.merchantId.length
merchant = Merchant.create_with_uuid name: "TESTNAME"
assert merchant.persisted?
assert_equal 36, merchant.merchantId.length
end
end
24 changes: 12 additions & 12 deletions test/models/user_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ class UserTest < ActiveSupport::TestCase
end

test "should not save user without a fullName" do
user = User.new userId: "TESTID", merchant_id: @merchant.id, email: "a@a"
assert_not _user.save
user = User.new userId: "TESTID", merchant_id: @merchant.id, email: "a@a"
assert_not user.save
end

test "should not save user without a merchantId" do
user = User.new fullName: "TESTNAME", merchant_id: @merchant.id, email: "a@a"
assert_not _user.save
user = User.new fullName: "TESTNAME", merchant_id: @merchant.id, email: "a@a"
assert_not user.save
end

test "should not save user without an email" do
user = User.new userId: "TESTID", fullName: "TESTNAME", merchant_id: @merchant.id
assert_not _user.save
user = User.new userId: "TESTID", fullName: "TESTNAME", merchant_id: @merchant.id
assert_not user.save
end

test "should save user with a userId and a fullName and an email" do
user = User.new userId: "TESTID", fullName: "TESTNAME", merchant_id: @merchant.id, email: "a@a"
assert _user.save
user = User.new userId: "TESTID", fullName: "TESTNAME", merchant_id: @merchant.id, email: "a@a"
assert user.save
end

test "should create and save user with a random UUID as userId" do
user = User.create_with_uuid fullName: "TESTNAME", merchantId: @merchant.merchantId, email: "a@a"
assert _user.persisted?
assert_equal 36, _user.userId.length
test "should create and save user with a random UUID as userId" do

Check failure on line 29 in test/models/user_test.rb

View workflow job for this annotation

GitHub Actions / lint

Layout/TrailingWhitespace: Trailing whitespace detected.
user = User.create_with_uuid_and_account fullName: "TESTNAME", merchantId: @merchant.merchantId, email: "a@a"
assert user.persisted?
assert_equal 36, user.userId.length
end
end

0 comments on commit 5c6a31d

Please sign in to comment.