Commit e14e17ae authored by James Lopez's avatar James Lopez

Merge branch 'refactor-skip-trial-view-specs' into 'master'

Refactor the _skip-trial view specs

See merge request gitlab-org/gitlab!43449
parents cef17004 e092cced
......@@ -5,29 +5,32 @@ require 'spec_helper'
RSpec.describe 'trials/_skip_trial.html.haml' do
include ApplicationHelper
context 'without glm_source' do
it 'displays skip trial' do
render 'trials/skip_trial'
let(:source) { nil }
expect(rendered).to have_content("Skip Trial (Continue with Free Account)")
end
before do
params[:glm_source] = source
render 'trials/skip_trial'
end
context 'with glm_source' do
it 'displays skip trial when using about.gitlab.com' do
params[:glm_source] = 'about.gitlab.com'
render 'trials/skip_trial'
subject { rendered }
expect(rendered).to have_content("Skip Trial (Continue with Free Account)")
shared_examples 'has Skip Trial verbiage' do
it { is_expected.to have_content("Skip Trial (Continue with Free Account)") }
end
it 'displays go back to GitLab when using GitLab.com' do
params[:glm_source] = 'gitlab.com'
context 'without glm_source' do
include_examples 'has Skip Trial verbiage'
end
render 'trials/skip_trial'
context 'with glm_source of about.gitlab.com' do
let(:source) { 'about.gitlab.com' }
expect(rendered).to have_content("Go back to GitLab")
include_examples 'has Skip Trial verbiage'
end
context 'with glm_source of gitlab.com' do
let(:source) { 'gitlab.com' }
it { is_expected.to have_content("Go back to GitLab") }
end
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