images get ratios

This commit is contained in:
2022-12-14 13:11:36 +02:00
parent 2685963fd0
commit d7045946da
11 changed files with 88 additions and 58 deletions

View File

@ -4,14 +4,22 @@ module Merged
RSpec.describe Image, type: :model do
let(:first) {Image.all.values.first}
it "has Pages.all" do
it "has Image.all" do
expect(Image.all.class).to be Hash
end
it "has image" do
expect(first.class).to be Image
end
it "image has name" do
it "has name" do
expect(first.name).to eq "3dprinter_wide"
end
it "has height and width" do
expect(first.height).to eq 457
expect(first.width).to eq 1279
end
it "has height and width" do
expect(first.aspect_ratio).to eq [13,5]
end
end
end