add match history

This commit is contained in:
2026-11-15 18:27:05 +03:00
parent 93b883dfba
commit 8f70bb639d
11 changed files with 954 additions and 11 deletions
+17
View File
@@ -61,6 +61,23 @@ RSpec.describe User, type: :model do
end
end
describe "#avatar_url" do
let(:user) { User.create!(valid_attributes) }
it "returns nil when avatar is not attached" do
expect(user.avatar_url).to be_nil
end
it "returns full url when avatar is attached" do
user.avatar.attach(
io: StringIO.new("\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x06\x00\x00\x00\x1f\x15c4"),
filename: "avatar.png",
content_type: "image/png"
)
expect(user.avatar_url).to include("avatar.png")
end
end
describe "rating" do
it "defaults to the neutral initial value of 100" do
expect(User.create!(valid_attributes).rating).to eq(100)