diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-16 09:07:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-16 09:07:06 +0300 |
commit | 3546e1bb0971347e9e9984de0799e3fb53743b33 (patch) | |
tree | f65e47d5deb95905aa419ebd70ce02c7b32ddb8f /spec | |
parent | f155cc9034f2247c5d368f9b0212ad44248b0c5e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/boards/sidebar_spec.rb | 31 | ||||
-rw-r--r-- | spec/lib/gitlab/metrics/transaction_spec.rb | 8 |
2 files changed, 39 insertions, 0 deletions
diff --git a/spec/features/boards/sidebar_spec.rb b/spec/features/boards/sidebar_spec.rb index 2b923df40c5..d68a4c52448 100644 --- a/spec/features/boards/sidebar_spec.rb +++ b/spec/features/boards/sidebar_spec.rb @@ -14,6 +14,8 @@ describe 'Issue Boards', :js do let!(:bug) { create(:label, project: project, name: 'Bug') } let!(:regression) { create(:label, project: project, name: 'Regression') } let!(:stretch) { create(:label, project: project, name: 'Stretch') } + let!(:scoped_label_1) { create(:label, project: project, name: 'Scoped::Label1') } + let!(:scoped_label_2) { create(:label, project: project, name: 'Scoped::Label2') } let!(:issue1) { create(:labeled_issue, project: project, assignees: [user], milestone: milestone, labels: [development], relative_position: 2) } let!(:issue2) { create(:labeled_issue, project: project, labels: [development, stretch], relative_position: 1) } let(:board) { create(:board, project: project) } @@ -27,6 +29,8 @@ describe 'Issue Boards', :js do end before do + stub_licensed_features(scoped_labels: true) + project.add_maintainer(user) sign_in(user) @@ -309,6 +313,33 @@ describe 'Issue Boards', :js do expect(card).to have_content(bug.title) end + it 'removes existing scoped label' do + click_card(card) + + page.within('.labels') do + click_link 'Edit' + + wait_for_requests + + click_link scoped_label_1.title + click_link scoped_label_2.title + + wait_for_requests + + find('.dropdown-menu-close-icon').click + + page.within('.value') do + expect(page).to have_selector('.scoped-label-wrapper', count: 1) + expect(page).not_to have_content(scoped_label_1.title) + expect(page).to have_content(scoped_label_2.title) + end + end + + expect(card).to have_selector('.scoped-label-wrapper', count: 1) + expect(card).not_to have_content(scoped_label_1.title) + expect(card).to have_content(scoped_label_2.title) + end + it 'adds a multiple labels' do click_card(card) diff --git a/spec/lib/gitlab/metrics/transaction_spec.rb b/spec/lib/gitlab/metrics/transaction_spec.rb index 45e74597a2e..08de2426c5a 100644 --- a/spec/lib/gitlab/metrics/transaction_spec.rb +++ b/spec/lib/gitlab/metrics/transaction_spec.rb @@ -27,6 +27,14 @@ describe Gitlab::Metrics::Transaction do end end + describe '#thread_cpu_duration' do + it 'returns the duration of a transaction in seconds' do + transaction.run { } + + expect(transaction.thread_cpu_duration).to be > 0 + end + end + describe '#allocated_memory' do it 'returns the allocated memory in bytes' do transaction.run { 'a' * 32 } |