Add GeoPushEvent model

parent b62b1c9f
class GeoPushEvent < ActiveRecord::Base
belongs_to :project
validates :project, presence: true
enum event_type: { repository_updated: 0, wiki_updated: 1 }
end
require 'rails_helper'
RSpec.describe GeoPushEvent, type: :model do
describe 'relationships' do
it { is_expected.to belong_to(:project) }
end
describe 'validations' do
it { is_expected.to validate_presence_of(:project) }
end
describe '#event_type' do
it { is_expected.to define_enum_for(:event_type).with([:repository_updated, :wiki_updated]) }
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment