blob: f76b8a1ded1857a78a7157df619b30365afc88f5 (
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
30
31
32
33
34
35
36
37
38
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe NewProjectReadmeContentExperiment, :experiment do
subject { described_class.new(namespace: project.namespace) }
let(:project) { create(:project, name: 'Experimental', description: 'An experiment project') }
it "renders the basic README" do
expect(subject.run_with(project)).to eq(<<~MARKDOWN.strip)
# Experimental
An experiment project
MARKDOWN
end
describe "the advanced variant" do
let(:markdown) { subject.run_with(project, variant: :advanced) }
let(:initial_url) { 'https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file' }
it "renders the project details" do
expect(markdown).to include(<<~MARKDOWN.strip)
# Experimental
An experiment project
## Getting started
MARKDOWN
end
it "renders redirect URLs" do
expect(markdown).to include(
Rails.application.routes.url_helpers.experiment_redirect_url(subject, url: initial_url)
)
end
end
end
|