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