summaryrefslogtreecommitdiff
path: root/spec/features/projects/settings/user_tags_project_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/settings/user_tags_project_spec.rb')
-rw-r--r--spec/features/projects/settings/user_tags_project_spec.rb26
1 files changed, 22 insertions, 4 deletions
diff --git a/spec/features/projects/settings/user_tags_project_spec.rb b/spec/features/projects/settings/user_tags_project_spec.rb
index ff19ed22744..e9a2aa29352 100644
--- a/spec/features/projects/settings/user_tags_project_spec.rb
+++ b/spec/features/projects/settings/user_tags_project_spec.rb
@@ -2,22 +2,40 @@
require 'spec_helper'
-RSpec.describe 'Projects > Settings > User tags a project' do
+RSpec.describe 'Projects > Settings > User tags a project', :js do
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
+ let!(:topic) { create(:topic, name: 'topic1') }
before do
sign_in(user)
visit edit_project_path(project)
+ wait_for_all_requests
end
- it 'sets project topics' do
- fill_in 'Topics', with: 'topic1, topic2'
+ it 'select existing topic' do
+ fill_in class: 'gl-token-selector-input', with: 'topic1'
+ wait_for_all_requests
+
+ find('.gl-avatar-labeled[entity-name="topic1"]').click
+
+ page.within '.general-settings' do
+ click_button 'Save changes'
+ end
+
+ expect(find('#project_topic_list_field', visible: :hidden).value).to eq 'topic1'
+ end
+
+ it 'select new topic' do
+ fill_in class: 'gl-token-selector-input', with: 'topic2'
+ wait_for_all_requests
+
+ click_button 'Add "topic2"'
page.within '.general-settings' do
click_button 'Save changes'
end
- expect(find_field('Topics').value).to eq 'topic1, topic2'
+ expect(find('#project_topic_list_field', visible: :hidden).value).to eq 'topic2'
end
end