diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/features/projects/terraform_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/features/projects/terraform_spec.rb')
-rw-r--r-- | spec/features/projects/terraform_spec.rb | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/spec/features/projects/terraform_spec.rb b/spec/features/projects/terraform_spec.rb new file mode 100644 index 00000000000..2680dfb2b13 --- /dev/null +++ b/spec/features/projects/terraform_spec.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Terraform', :js do + let_it_be(:project) { create(:project) } + + let(:user) { project.creator } + + before do + gitlab_sign_in(user) + end + + context 'when user does not have any terraform states and visits index page' do + before do + visit project_terraform_index_path(project) + end + + it 'sees an empty state' do + expect(page).to have_content('Get started with Terraform') + end + end + + context 'when user has a terraform state' do + let_it_be(:terraform_state) { create(:terraform_state, :locked, project: project) } + + context 'when user visits the index page' do + before do + visit project_terraform_index_path(project) + end + + it 'displays a tab with states count' do + expect(page).to have_content("States #{project.terraform_states.size}") + end + + it 'displays a table with terraform states' do + expect(page).to have_selector( + '[data-testid="terraform-states-table"] tbody tr', + count: project.terraform_states.size + ) + end + + it 'displays terraform information' do + expect(page).to have_content(terraform_state.name) + end + end + end +end |