add match history
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user