diff options
author | Dennis Tang <dennis@dennistang.net> | 2018-05-07 21:06:02 +0300 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2018-05-07 21:06:02 +0300 |
commit | a9496c27c9bb2876b9d94bfbe33f252a931caa8f (patch) | |
tree | fb9033473aa067cbde1cf8b222ba5045e24b0623 /spec/features/projects/clusters | |
parent | 14e16915357ee77c2a1f93f2f6b6dfcc6fdf389f (diff) |
Resolve "Inform users of up to $500 offer for GCP account"
Diffstat (limited to 'spec/features/projects/clusters')
-rw-r--r-- | spec/features/projects/clusters/gcp_spec.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/features/projects/clusters/gcp_spec.rb b/spec/features/projects/clusters/gcp_spec.rb index dfe8e02dce0..fe334b531f0 100644 --- a/spec/features/projects/clusters/gcp_spec.rb +++ b/spec/features/projects/clusters/gcp_spec.rb @@ -184,4 +184,44 @@ feature 'Gcp Cluster', :js do expect(page).to have_css('.signin-with-google') end end + + context 'when user has not dismissed GCP signup offer' do + before do + visit project_clusters_path(project) + end + + it 'user sees offer on cluster index page' do + expect(page).to have_css('.gcp-signup-offer') + end + + it 'user sees offer on cluster create page' do + click_link 'Add Kubernetes cluster' + + expect(page).to have_css('.gcp-signup-offer') + end + + it 'user sees offer on cluster GCP login page' do + click_link 'Add Kubernetes cluster' + click_link 'Create on Google Kubernetes Engine' + + expect(page).to have_css('.gcp-signup-offer') + end + end + + context 'when user has dismissed GCP signup offer' do + before do + visit project_clusters_path(project) + end + + it 'user does not see offer after dismissing' do + expect(page).to have_css('.gcp-signup-offer') + + find('.gcp-signup-offer .close').click + wait_for_requests + + click_link 'Add Kubernetes cluster' + + expect(page).not_to have_css('.gcp-signup-offer') + end + end end |