Commit e31ff0ef authored by James Lopez's avatar James Lopez

add registry entity and specs

parent 5a493883
class ProjectRegistryEntity < Grape::Entity
include ActionView::Helpers::NumberHelper
expose :project_id
expose :last_repository_synced_at
expose :last_repository_successful_sync_at
expose :last_wiki_synced_at
expose :last_wiki_successful_sync_at
expose :repository_retry_count
expose :wiki_retry_count
expose :last_repository_sync_failure
expose :last_wiki_sync_failure
end
class ProjectRegistrySerializer < BaseSerializer
entity ProjectRegistryEntity
end
require 'spec_helper'
describe ProjectRegistryEntity, :postgresql do
let(:registry) { create(:geo_project_registry, :synced) }
let(:entity) do
described_class.new(registry, request: double)
end
subject { entity.as_json }
it { is_expected.to have_key(:project_id) }
it { is_expected.to have_key(:last_repository_synced_at) }
it { is_expected.to have_key(:last_repository_successful_sync_at) }
it { is_expected.to have_key(:last_wiki_synced_at) }
it { is_expected.to have_key(:last_wiki_successful_sync_at) }
it { is_expected.to have_key(:repository_retry_count) }
it { is_expected.to have_key(:wiki_retry_count) }
it { is_expected.to have_key(:last_repository_sync_failure) }
it { is_expected.to have_key(:last_wiki_sync_failure) }
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