Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-26 18:06:18 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-26 18:06:18 +0300
commit4e9f718e190a944c39fda2a178eb8b901e7e6ec7 (patch)
treefcdcdf846450ebad15da60375ab3805ff9b343e8 /spec
parent5707f305f4b961e24369fcdaecf0b8ce1c34bad8 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/features/dashboard/active_tab_spec.rb16
-rw-r--r--spec/javascripts/notes/stores/mutation_spec.js17
-rw-r--r--spec/lib/gitlab/health_checks/simple_check_shared.rb8
3 files changed, 23 insertions, 18 deletions
diff --git a/spec/features/dashboard/active_tab_spec.rb b/spec/features/dashboard/active_tab_spec.rb
index 92d0c0c9260..ee85c136190 100644
--- a/spec/features/dashboard/active_tab_spec.rb
+++ b/spec/features/dashboard/active_tab_spec.rb
@@ -27,20 +27,4 @@ RSpec.describe 'Dashboard Active Tab', :js do
subject { visit dashboard_groups_path }
end
end
-
- context 'on activity projects' do
- it_behaves_like 'page has active tab', 'Activity' do
- subject { visit activity_dashboard_path }
- end
- end
-
- context 'on instance statistics' do
- subject { visit instance_statistics_root_path }
-
- it 'shows Instance Statistics` as active' do
- subject
-
- expect(find('.navbar-sub-nav li.active')).to have_link('Instance Statistics')
- end
- end
end
diff --git a/spec/javascripts/notes/stores/mutation_spec.js b/spec/javascripts/notes/stores/mutation_spec.js
index 4a640d589fb..ade4725dd68 100644
--- a/spec/javascripts/notes/stores/mutation_spec.js
+++ b/spec/javascripts/notes/stores/mutation_spec.js
@@ -48,9 +48,22 @@ describe('Notes Store mutations', () => {
});
describe('ADD_NEW_REPLY_TO_DISCUSSION', () => {
+ const newReply = Object.assign({}, note, { discussion_id: discussionMock.id });
+
+ let state;
+
+ beforeEach(() => {
+ state = { discussions: [{ ...discussionMock }] };
+ });
+
it('should add a reply to a specific discussion', () => {
- const state = { discussions: [discussionMock] };
- const newReply = Object.assign({}, note, { discussion_id: discussionMock.id });
+ mutations.ADD_NEW_REPLY_TO_DISCUSSION(state, newReply);
+
+ expect(state.discussions[0].notes.length).toEqual(4);
+ });
+
+ it('should not add the note if it already exists in the discussion', () => {
+ mutations.ADD_NEW_REPLY_TO_DISCUSSION(state, newReply);
mutations.ADD_NEW_REPLY_TO_DISCUSSION(state, newReply);
expect(state.discussions[0].notes.length).toEqual(4);
diff --git a/spec/lib/gitlab/health_checks/simple_check_shared.rb b/spec/lib/gitlab/health_checks/simple_check_shared.rb
index b4a8a4e6ab6..c3d55a11909 100644
--- a/spec/lib/gitlab/health_checks/simple_check_shared.rb
+++ b/spec/lib/gitlab/health_checks/simple_check_shared.rb
@@ -57,5 +57,13 @@ shared_context 'simple_check' do |metrics_prefix, check_name, success_result|
it { is_expected.to have_attributes(success: false, message: "#{described_class.human_name} check timed out") }
end
+
+ context 'Check is raising an unhandled exception' do
+ before do
+ allow(described_class).to receive(:check ).and_raise "unexpected error"
+ end
+
+ it { is_expected.to have_attributes(success: false, message: "unexpected #{described_class.human_name} check result: unexpected error") }
+ end
end
end