From 5fcf475bc62651909dc5ddffac508f407781b082 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 24 Jun 2016 17:45:55 +0100 Subject: Updated tests --- features/steps/shared/project.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'features/steps') diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index b3411c03118..0b4920883b8 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -223,6 +223,11 @@ module SharedProject create(:label, project: project, title: 'enhancement') end + step 'project "Shop" has issue: "bug report"' do + project = Project.find_by(name: "Shop") + create(:issue, project: project, title: "bug report") + end + step 'project "Shop" has CI enabled' do project = Project.find_by(name: "Shop") project.enable_ci -- cgit v1.2.1 From 4b9f76cede975106e1e34af787e46720e3c3bb2e Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Wed, 6 Jul 2016 15:45:43 +0800 Subject: Fix one of the failing tests. Test against the headers --- features/steps/project/builds/artifacts.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'features/steps') diff --git a/features/steps/project/builds/artifacts.rb b/features/steps/project/builds/artifacts.rb index 2876e8812e9..4bc74688132 100644 --- a/features/steps/project/builds/artifacts.rb +++ b/features/steps/project/builds/artifacts.rb @@ -68,10 +68,15 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps end step 'download of a file extracted from build artifacts should start' do - # this will be accelerated by Workhorse - response_json = JSON.parse(page.body, symbolize_names: true) - expect(response_json[:archive]).to end_with('build_artifacts.zip') - expect(response_json[:entry]).to eq Base64.encode64('ci_artifacts.txt') + send_data = response_headers[Gitlab::Workhorse::SEND_DATA_HEADER] + + expect(send_data).to start_with('artifacts-entry:') + + params = JSON.parse(Base64.urlsafe_decode64(send_data[/(?<=:)(.+)/])) + + expect(params.keys).to eq(['Archive', 'Entry']) + expect(params['Archive']).to end_with('build_artifacts.zip') + expect(params['Entry']).to eq(Base64.encode64('ci_artifacts.txt')) end step 'I click a first row within build artifacts table' do -- cgit v1.2.1 From bf2a86b73cce332ff8f4392ffc8df501193f32ec Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Thu, 7 Jul 2016 18:25:05 -0400 Subject: Revert "Merge branch 'issue_3946' into 'master' " This reverts commit 68155ee73b549a4f79744bb325542c29d45c71ea, reversing changes made to 7ebd011ed1de7aee706f07a53c63c90f1c8aa5d4. --- features/steps/admin/projects.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'features/steps') diff --git a/features/steps/admin/projects.rb b/features/steps/admin/projects.rb index d77945a6b9c..a7a28755a6c 100644 --- a/features/steps/admin/projects.rb +++ b/features/steps/admin/projects.rb @@ -18,9 +18,9 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps end end - step 'I select "Show archived projects"' do - find(:css, '#sort-projects-dropdown').click - click_link 'Show archived projects' + step 'I check "Show archived projects"' do + page.check 'Show archived projects' + click_button "Search" end step 'I should see "archived" label' do @@ -45,8 +45,7 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps step 'I transfer project to group \'Web\'' do allow_any_instance_of(Projects::TransferService). to receive(:move_uploads_to_new_namespace).and_return(true) - click_button 'Search for Namespace' - click_link 'group: web' + find(:xpath, "//input[@id='new_namespace_id']").set group.id click_button 'Transfer' end -- cgit v1.2.1 From 0de617772dfeb9bdcf3770e9acf7421db5023058 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Thu, 7 Jul 2016 23:48:02 -0400 Subject: Revert "Revert "Merge branch 'issue_3946' into 'master' "" This reverts commit bf2a86b73cce332ff8f4392ffc8df501193f32ec. --- features/steps/admin/projects.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'features/steps') diff --git a/features/steps/admin/projects.rb b/features/steps/admin/projects.rb index a7a28755a6c..d77945a6b9c 100644 --- a/features/steps/admin/projects.rb +++ b/features/steps/admin/projects.rb @@ -18,9 +18,9 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps end end - step 'I check "Show archived projects"' do - page.check 'Show archived projects' - click_button "Search" + step 'I select "Show archived projects"' do + find(:css, '#sort-projects-dropdown').click + click_link 'Show archived projects' end step 'I should see "archived" label' do @@ -45,7 +45,8 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps step 'I transfer project to group \'Web\'' do allow_any_instance_of(Projects::TransferService). to receive(:move_uploads_to_new_namespace).and_return(true) - find(:xpath, "//input[@id='new_namespace_id']").set group.id + click_button 'Search for Namespace' + click_link 'group: web' click_button 'Transfer' end -- cgit v1.2.1 From 78496e8c38ce0b415fa7aad5310b937a95265627 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Thu, 30 Jun 2016 16:17:10 +0100 Subject: Disable overflow messages With the option to expand and collapse individual diffs, these aren't needed any more. --- features/steps/project/commits/commits.rb | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'features/steps') diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb index 239036e431d..bea9f9d198b 100644 --- a/features/steps/project/commits/commits.rb +++ b/features/steps/project/commits/commits.rb @@ -125,25 +125,6 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps expect(page).to have_content 'Authors' end - step 'I visit big commit page' do - # Create a temporary scope to ensure that the stub_const is removed after user - RSpec::Mocks.with_temporary_scope do - stub_const('Gitlab::Git::DiffCollection::DEFAULT_LIMITS', { max_lines: 1, max_files: 1 }) - visit namespace_project_commit_path(@project.namespace, @project, sample_big_commit.id) - end - end - - step 'I see big commit warning' do - expect(page).to have_content sample_big_commit.message - expect(page).to have_content "Too many changes" - end - - step 'I see "Reload with full diff" link' do - link = find_link('Reload with full diff') - expect(link[:href]).to end_with('?force_show_diff=true') - expect(link[:href]).not_to include('.html') - end - step 'I visit a commit with an image that changed' do visit namespace_project_commit_path(@project.namespace, @project, sample_image_commit.id) end -- cgit v1.2.1 From 1bfc2ed633b2086b547727acc4aa0abaaea7731f Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Mon, 11 Jul 2016 20:06:35 +0800 Subject: Just remove the prefix, feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5094#note_12987385 --- features/steps/project/builds/artifacts.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/project/builds/artifacts.rb b/features/steps/project/builds/artifacts.rb index 4bc74688132..b4a32ed2e38 100644 --- a/features/steps/project/builds/artifacts.rb +++ b/features/steps/project/builds/artifacts.rb @@ -72,7 +72,8 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps expect(send_data).to start_with('artifacts-entry:') - params = JSON.parse(Base64.urlsafe_decode64(send_data[/(?<=:)(.+)/])) + base64_params = send_data.sub(/\Aartifacts\-entry:/, '') + params = JSON.parse(Base64.urlsafe_decode64(base64_params)) expect(params.keys).to eq(['Archive', 'Entry']) expect(params['Archive']).to end_with('build_artifacts.zip') -- cgit v1.2.1