From e95b88a06d673ff95792d5c7d3934c88051691d9 Mon Sep 17 00:00:00 2001 From: Michael Kozono Date: Mon, 25 Feb 2019 12:42:34 -0800 Subject: Revert "Merge branch 'filter-confidential-issues' into 'master'" This reverts commit d133bf84c668df3dfc9938bb04150754cb873c8b, reversing changes made to 7981c0292b07a0138b096fa082341fcb13e9ce2b. --- .../concerns/issuable_collections_spec.rb | 4 +-- .../issues/filtered_search/dropdown_hint_spec.rb | 11 +------ .../issues/filtered_search/search_bar_spec.rb | 2 +- spec/finders/issues_finder_spec.rb | 28 +---------------- spec/models/issue_spec.rb | 9 ------ spec/requests/api/issues_spec.rb | 36 ---------------------- 6 files changed, 4 insertions(+), 86 deletions(-) (limited to 'spec') diff --git a/spec/controllers/concerns/issuable_collections_spec.rb b/spec/controllers/concerns/issuable_collections_spec.rb index 8580900215c..307c5d60c57 100644 --- a/spec/controllers/concerns/issuable_collections_spec.rb +++ b/spec/controllers/concerns/issuable_collections_spec.rb @@ -112,8 +112,7 @@ describe IssuableCollections do assignee_username: 'user1', author_id: '2', author_username: 'user2', - authorized_only: 'yes', - confidential: true, + authorized_only: 'true', due_date: '2017-01-01', group_id: '3', iids: '4', @@ -141,7 +140,6 @@ describe IssuableCollections do 'assignee_username' => 'user1', 'author_id' => '2', 'author_username' => 'user2', - 'confidential' => true, 'label_name' => 'foo', 'milestone_title' => 'bar', 'my_reaction_emoji' => 'thumbsup', diff --git a/spec/features/issues/filtered_search/dropdown_hint_spec.rb b/spec/features/issues/filtered_search/dropdown_hint_spec.rb index 096756f19cc..0e296ab2109 100644 --- a/spec/features/issues/filtered_search/dropdown_hint_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_hint_spec.rb @@ -66,7 +66,7 @@ describe 'Dropdown hint', :js do it 'filters with text' do filtered_search.set('a') - expect(find(js_dropdown_hint)).to have_selector('.filter-dropdown .filter-dropdown-item', count: 5) + expect(find(js_dropdown_hint)).to have_selector('.filter-dropdown .filter-dropdown-item', count: 4) end end @@ -119,15 +119,6 @@ describe 'Dropdown hint', :js do expect_tokens([{ name: 'my-reaction' }]) expect_filtered_search_input_empty end - - it 'opens the yes-no dropdown when you click on confidential' do - click_hint('confidential') - - expect(page).to have_css(js_dropdown_hint, visible: false) - expect(page).to have_css('#js-dropdown-confidential', visible: true) - expect_tokens([{ name: 'confidential' }]) - expect_filtered_search_input_empty - end end describe 'selecting from dropdown with some input' do diff --git a/spec/features/issues/filtered_search/search_bar_spec.rb b/spec/features/issues/filtered_search/search_bar_spec.rb index c4468922883..8abab3f35d6 100644 --- a/spec/features/issues/filtered_search/search_bar_spec.rb +++ b/spec/features/issues/filtered_search/search_bar_spec.rb @@ -100,7 +100,7 @@ describe 'Search bar', :js do find('.filtered-search-box .clear-search').click filtered_search.click - expect(find('#js-dropdown-hint')).to have_selector('.filter-dropdown .filter-dropdown-item', count: 6) + expect(find('#js-dropdown-hint')).to have_selector('.filter-dropdown .filter-dropdown-item', count: 5) expect(get_left_style(find('#js-dropdown-hint')['style'])).to eq(hint_offset) end end diff --git a/spec/finders/issues_finder_spec.rb b/spec/finders/issues_finder_spec.rb index 47e2548c3d6..fe8000e419b 100644 --- a/spec/finders/issues_finder_spec.rb +++ b/spec/finders/issues_finder_spec.rb @@ -490,32 +490,6 @@ describe IssuesFinder do end end - context 'filtering by confidential' do - set(:confidential_issue) { create(:issue, project: project1, confidential: true) } - - context 'no filtering' do - it 'returns all issues' do - expect(issues).to contain_exactly(issue1, issue2, issue3, issue4, confidential_issue) - end - end - - context 'user filters confidential issues' do - let(:params) { { confidential: true } } - - it 'returns only confdential issues' do - expect(issues).to contain_exactly(confidential_issue) - end - end - - context 'user filters only public issues' do - let(:params) { { confidential: false } } - - it 'returns only confdential issues' do - expect(issues).to contain_exactly(issue1, issue2, issue3, issue4) - end - end - end - context 'when the user is unauthorized' do let(:search_user) { nil } @@ -582,7 +556,7 @@ describe IssuesFinder do it 'returns the number of rows for the default state' do finder = described_class.new(user) - expect(finder.row_count).to eq(5) + expect(finder.row_count).to eq(4) end it 'returns the number of rows for a given state' do diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index 6101df2e099..5d18e085a6f 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -765,15 +765,6 @@ describe Issue do end end - describe '.confidential_only' do - it 'only returns confidential_only issues' do - create(:issue) - confidential_issue = create(:issue, confidential: true) - - expect(described_class.confidential_only).to eq([confidential_issue]) - end - end - it_behaves_like 'throttled touch' do subject { create(:issue, updated_at: 1.hour.ago) } end diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb index 1a4be2bd30f..d10ee6cc320 100644 --- a/spec/requests/api/issues_spec.rb +++ b/spec/requests/api/issues_spec.rb @@ -183,18 +183,6 @@ describe API::Issues do expect_paginated_array_response([issue.id, confidential_issue.id, closed_issue.id]) end - it 'returns only confidential issues' do - get api('/issues', user), params: { confidential: true, scope: 'all' } - - expect_paginated_array_response(confidential_issue.id) - end - - it 'returns only public issues' do - get api('/issues', user), params: { confidential: false } - - expect_paginated_array_response([issue.id, closed_issue.id]) - end - it 'returns issues reacted by the authenticated user' do issue2 = create(:issue, project: project, author: user, assignees: [user]) create(:award_emoji, awardable: issue2, user: user2, name: 'star') @@ -569,18 +557,6 @@ describe API::Issues do expect_paginated_array_response([group_confidential_issue.id, group_issue.id]) end - it 'returns only confidential issues' do - get api(base_url, user), params: { confidential: true } - - expect_paginated_array_response(group_confidential_issue.id) - end - - it 'returns only public issues' do - get api(base_url, user), params: { confidential: false } - - expect_paginated_array_response([group_closed_issue.id, group_issue.id]) - end - it 'returns an array of labeled group issues' do get api(base_url, user), params: { labels: group_label.title } @@ -806,18 +782,6 @@ describe API::Issues do expect_paginated_array_response([issue.id, confidential_issue.id, closed_issue.id]) end - it 'returns only confidential issues' do - get api("#{base_url}/issues", author), params: { confidential: true } - - expect_paginated_array_response(confidential_issue.id) - end - - it 'returns only public issues' do - get api("#{base_url}/issues", author), params: { confidential: false } - - expect_paginated_array_response([issue.id, closed_issue.id]) - end - it 'returns project confidential issues for assignee' do get api("#{base_url}/issues", assignee) -- cgit v1.2.3 From 9ffdd736f86b053fd02752e7f86f63229aebf602 Mon Sep 17 00:00:00 2001 From: Michael Kozono Date: Mon, 25 Feb 2019 12:43:14 -0800 Subject: Revert "Merge branch '49449-add-an-api-endpoint-for-bulk-updating-issues-and-mrs' into 'master'" This reverts commit 7981c0292b07a0138b096fa082341fcb13e9ce2b, reversing changes made to 9202bbd129537a698b986e6295d0c783b5a84815. --- spec/requests/api/issuable_bulk_update_spec.rb | 154 ------------------------- 1 file changed, 154 deletions(-) delete mode 100644 spec/requests/api/issuable_bulk_update_spec.rb (limited to 'spec') diff --git a/spec/requests/api/issuable_bulk_update_spec.rb b/spec/requests/api/issuable_bulk_update_spec.rb deleted file mode 100644 index 6463f3f5d35..00000000000 --- a/spec/requests/api/issuable_bulk_update_spec.rb +++ /dev/null @@ -1,154 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe API::IssuableBulkUpdate do - set(:project) { create(:project) } - set(:user) { project.creator } - - shared_examples "PUT /projects/:id/:issuable/bulk_update" do |issuable| - def bulk_update(issuable, issuables, params, update_user = user) - put api("/projects/#{project.id}/#{issuable.pluralize}/bulk_update", update_user), - params: { issuable_ids: Array(issuables).map(&:id) }.merge(params) - end - - context 'with not enough permissions' do - it 'returns 403 for guest users' do - guest = create(:user) - project.add_guest(guest) - - bulk_update(issuable, issuables, { state_event: 'close' }, guest) - - expect(response).to have_gitlab_http_status(403) - end - end - - context 'when modifying the state' do - it "closes #{issuable}" do - bulk_update(issuable, issuables, { state_event: 'close' }) - - expect(response).to have_gitlab_http_status(200) - expect(json_response['message']).to eq("#{issuables.count} #{issuable.pluralize(issuables.count)} updated") - expect(project.public_send(issuable.pluralize).opened).to be_empty - expect(project.public_send(issuable.pluralize).closed).not_to be_empty - end - - it "opens #{issuable}" do - closed_issuables = create_list("closed_#{issuable}".to_sym, 2) - - bulk_update(issuable, closed_issuables, { state_event: 'reopen' }) - - expect(response).to have_gitlab_http_status(200) - expect(project.public_send(issuable.pluralize).closed).to be_empty - end - end - - context 'when modifying the milestone' do - let(:milestone) { create(:milestone, project: project) } - - it "adds a milestone #{issuable}" do - bulk_update(issuable, issuables, { milestone_id: milestone.id }) - - expect(response).to have_gitlab_http_status(200) - issuables.each do |issuable| - expect(issuable.reload.milestone).to eq(milestone) - end - end - - it 'removes a milestone' do - issuables.first.milestone = milestone - milestone_issuable = issuables.first - - bulk_update(issuable, [milestone_issuable], { milestone_id: 0 }) - - expect(response).to have_gitlab_http_status(200) - expect(milestone_issuable.reload.milestone).to eq(nil) - end - end - - context 'when modifying the subscription state' do - it "subscribes to #{issuable}" do - bulk_update(issuable, issuables, { subscription_event: 'subscribe' }) - - expect(response).to have_gitlab_http_status(200) - expect(issuables).to all(be_subscribed(user, project)) - end - - it 'unsubscribes from issues' do - issuables.each do |issuable| - issuable.subscriptions.create(user: user, project: project, subscribed: true) - end - - bulk_update(issuable, issuables, { subscription_event: 'unsubscribe' }) - - expect(response).to have_gitlab_http_status(200) - issuables.each do |issuable| - expect(issuable).not_to be_subscribed(user, project) - end - end - end - - context 'when modifying the assignee' do - it 'adds assignee to issues' do - params = issuable == 'issue' ? { assignee_ids: [user.id] } : { assignee_id: user.id } - - bulk_update(issuable, issuables, params) - - expect(response).to have_gitlab_http_status(200) - issuables.each do |issuable| - expect(issuable.reload.assignees).to eq([user]) - end - end - - it 'removes assignee' do - assigned_issuable = issuables.first - - if issuable == 'issue' - params = { assignee_ids: 0 } - assigned_issuable.assignees << user - else - params = { assignee_id: 0 } - assigned_issuable.update_attribute(:assignee, user) - end - - bulk_update(issuable, [assigned_issuable], params) - expect(assigned_issuable.reload.assignees).to eq([]) - end - end - - context 'when modifying labels' do - let(:bug) { create(:label, project: project) } - let(:regression) { create(:label, project: project) } - let(:feature) { create(:label, project: project) } - - it 'adds new labels' do - bulk_update(issuable, issuables, { add_label_ids: [bug.id, regression.id, feature.id] }) - - issuables.each do |issusable| - expect(issusable.reload.label_ids).to contain_exactly(bug.id, regression.id, feature.id) - end - end - - it 'removes labels' do - labled_issuable = issuables.first - labled_issuable.labels << bug - labled_issuable.labels << regression - labled_issuable.labels << feature - - bulk_update(issuable, [labled_issuable], { remove_label_ids: [bug.id, regression.id] }) - - expect(labled_issuable.reload.label_ids).to contain_exactly(feature.id) - end - end - end - - it_behaves_like 'PUT /projects/:id/:issuable/bulk_update', 'issue' do - let(:issuables) { create_list(:issue, 2, project: project) } - end - - it_behaves_like 'PUT /projects/:id/:issuable/bulk_update', 'merge_request' do - let(:merge_request_1) { create(:merge_request, source_project: project) } - let(:merge_request_2) { create(:merge_request, :simple, source_project: project) } - let(:issuables) { [merge_request_1, merge_request_2] } - end -end -- cgit v1.2.3 From ea6945b8113160f2009daa854e612eb009690a2a Mon Sep 17 00:00:00 2001 From: Michael Kozono Date: Mon, 25 Feb 2019 12:43:26 -0800 Subject: Revert "Merge branch 'sh-fix-cpp-templates-404' into 'master'" This reverts commit 4b282e9ce1ae246c4538b3ede18d1380ea778029, reversing changes made to b6f37434a7022be1be40c0d0519aea3ceca25ea5. --- spec/requests/api/project_templates_spec.rb | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'spec') diff --git a/spec/requests/api/project_templates_spec.rb b/spec/requests/api/project_templates_spec.rb index 80e5033dab4..ab5d4de7ff7 100644 --- a/spec/requests/api/project_templates_spec.rb +++ b/spec/requests/api/project_templates_spec.rb @@ -92,22 +92,6 @@ describe API::ProjectTemplates do expect(json_response['name']).to eq('Actionscript') end - it 'returns C++ gitignore' do - get api("/projects/#{public_project.id}/templates/gitignores/C++") - - expect(response).to have_gitlab_http_status(200) - expect(response).to match_response_schema('public_api/v4/template') - expect(json_response['name']).to eq('C++') - end - - it 'returns C++ gitignore for URL-encoded names' do - get api("/projects/#{public_project.id}/templates/gitignores/C%2B%2B") - - expect(response).to have_gitlab_http_status(200) - expect(response).to match_response_schema('public_api/v4/template') - expect(json_response['name']).to eq('C++') - end - it 'returns a specific gitlab_ci_yml' do get api("/projects/#{public_project.id}/templates/gitlab_ci_ymls/Android") @@ -141,18 +125,6 @@ describe API::ProjectTemplates do expect(response).to have_gitlab_http_status(200) expect(response).to match_response_schema('public_api/v4/license') end - - shared_examples 'path traversal attempt' do |template_type| - it 'rejects invalid filenames' do - get api("/projects/#{public_project.id}/templates/#{template_type}/%2e%2e%2fPython%2ea") - - expect(response).to have_gitlab_http_status(500) - end - end - - TemplateFinder::VENDORED_TEMPLATES.each do |template_type, _| - it_behaves_like 'path traversal attempt', template_type - end end describe 'GET /projects/:id/templates/licenses/:key' do -- cgit v1.2.3 From cae2c336819d1838507b0c5d21c609710b21ac4f Mon Sep 17 00:00:00 2001 From: Michael Kozono Date: Mon, 25 Feb 2019 12:53:09 -0800 Subject: Revert "Merge branch 'fix-misspellings-app-comments' into 'master'" This reverts commit 9202bbd129537a698b986e6295d0c783b5a84815, reversing changes made to 4b282e9ce1ae246c4538b3ede18d1380ea778029. --- spec/features/issues/gfm_autocomplete_spec.rb | 2 +- spec/features/projects/blobs/edit_spec.rb | 2 +- spec/features/projects/wiki/markdown_preview_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'spec') diff --git a/spec/features/issues/gfm_autocomplete_spec.rb b/spec/features/issues/gfm_autocomplete_spec.rb index 986f3823275..c22ad0d20ef 100644 --- a/spec/features/issues/gfm_autocomplete_spec.rb +++ b/spec/features/issues/gfm_autocomplete_spec.rb @@ -278,7 +278,7 @@ describe 'GFM autocomplete', :js do end end - # This context has just one example in each contexts in order to improve spec performance. + # This context has jsut one example in each contexts in order to improve spec performance. context 'labels', :quarantine do let!(:backend) { create(:label, project: project, title: 'backend') } let!(:bug) { create(:label, project: project, title: 'bug') } diff --git a/spec/features/projects/blobs/edit_spec.rb b/spec/features/projects/blobs/edit_spec.rb index 1522a3361a1..6e6c299ee2e 100644 --- a/spec/features/projects/blobs/edit_spec.rb +++ b/spec/features/projects/blobs/edit_spec.rb @@ -77,7 +77,7 @@ describe 'Editing file blob', :js do click_link 'Preview' wait_for_requests - # the above generates two separate lists (not embedded) in CommonMark + # the above generates two seperate lists (not embedded) in CommonMark expect(page).to have_content("sublist") expect(page).not_to have_xpath("//ol//li//ul") end diff --git a/spec/features/projects/wiki/markdown_preview_spec.rb b/spec/features/projects/wiki/markdown_preview_spec.rb index 49058d1372a..49244c53a91 100644 --- a/spec/features/projects/wiki/markdown_preview_spec.rb +++ b/spec/features/projects/wiki/markdown_preview_spec.rb @@ -170,7 +170,7 @@ describe 'Projects > Wiki > User previews markdown changes', :js do fill_in :wiki_content, with: "1. one\n - sublist\n" click_on "Preview" - # the above generates two separate lists (not embedded) in CommonMark + # the above generates two seperate lists (not embedded) in CommonMark expect(page).to have_content("sublist") expect(page).not_to have_xpath("//ol//li//ul") end -- cgit v1.2.3