gitlab-org--gitlab-foss/spec/lib/gitlab/data_builder/wiki_page_spec.rb
Zeger-Jan van de Weg 92482e01b4
Bump Gitaly to 0.98.0
Hooks were run for wikis, but given the internal API wasn't responding
failures happended, as seen on:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18693
2018-05-07 14:10:04 +02:00

21 lines
841 B
Ruby

require 'spec_helper'
describe Gitlab::DataBuilder::WikiPage do
set(:project) { create(:project, :repository, :wiki_repo) }
let(:wiki_page) { create(:wiki_page, wiki: project.wiki) }
let(:user) { create(:user) }
describe '.build' do
let(:data) { described_class.build(wiki_page, user, 'create') }
it { expect(data).to be_a(Hash) }
it { expect(data[:object_kind]).to eq('wiki_page') }
it { expect(data[:user]).to eq(user.hook_attrs) }
it { expect(data[:project]).to eq(project.hook_attrs) }
it { expect(data[:wiki]).to eq(project.wiki.hook_attrs) }
it { expect(data[:object_attributes]).to include(wiki_page.hook_attrs) }
it { expect(data[:object_attributes]).to include(url: Gitlab::UrlBuilder.build(wiki_page)) }
it { expect(data[:object_attributes]).to include(action: 'create') }
end
end