Simplify WikiPage#hook_attrs spec

This commit is contained in:
Sean McGivern 2018-07-17 10:38:09 +01:00
parent 35d2a058e5
commit 1e2c28ab41

View file

@ -555,14 +555,12 @@ describe WikiPage do
end
describe '#hook_attrs' do
before do
create_page("test page", "test![WikiPage_Image](/uploads/abc/WikiPage_Image.png)")
@page = wiki.wiki.page(title: "test page")
@wiki_page = described_class.new(wiki, @page, true)
end
it 'adds absolute urls for images in the content' do
expect(@wiki_page.hook_attrs['content']).to eq("test![WikiPage_Image](#{Settings.gitlab.url}/uploads/abc/WikiPage_Image.png)")
create_page("test page", "test![WikiPage_Image](/uploads/abc/WikiPage_Image.png)")
page = wiki.wiki.page(title: "test page")
wiki_page = described_class.new(wiki, page, true)
expect(wiki_page.hook_attrs['content']).to eq("test![WikiPage_Image](#{Settings.gitlab.url}/uploads/abc/WikiPage_Image.png)")
end
end