Initial commit
This commit is contained in:
21
spec/models/graphics_element_spec.rb
Normal file
21
spec/models/graphics_element_spec.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe GraphicsElement do
|
||||
describe "associations" do
|
||||
it { is_expected.to belong_to(:video) }
|
||||
end
|
||||
|
||||
describe "validations" do
|
||||
it { is_expected.to validate_presence_of(:graphic_type) }
|
||||
it { is_expected.to validate_presence_of(:text) }
|
||||
it { is_expected.to validate_presence_of(:time_elapsed) }
|
||||
end
|
||||
|
||||
describe "#appears_at" do
|
||||
it "returns formatted timecode" do
|
||||
graphics_element = build(:graphics_element, time_elapsed: "1.039")
|
||||
|
||||
expect(graphics_element.appears_at).to eq "00:00:01:01"
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user