blob: b7b711e04c754a0cc42e924cec527535e4222c4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::WhatsNew::ItemPresenter do
let(:present) { Gitlab::WhatsNew::ItemPresenter.present(item) }
let(:item) { { "packages" => %w(Premium Ultimate) } }
let(:gitlab_com) { true }
before do
allow(Gitlab).to receive(:com?).and_return(gitlab_com)
end
describe '.present' do
context 'when on Gitlab.com' do
it 'transforms package names to gitlab.com friendly package names' do
expect(present).to eq({ "packages" => %w(Silver Gold) })
end
end
context 'when not on Gitlab.com' do
let(:gitlab_com) { false }
it 'does not transform package names' do
expect(present).to eq({ "packages" => %w(Premium Ultimate) })
end
end
end
end
|