Commit cdde09ea authored by Nick Thomas's avatar Nick Thomas

Fix conflicts in specs

parent 656f0413
......@@ -73,11 +73,7 @@ describe Projects::JobsController do
it 'verifies number of queries', :request_store do
recorded = ActiveRecord::QueryRecorder.new { get_index }
<<<<<<< HEAD
expect(recorded.count).to be_within(6).of(8)
=======
expect(recorded.count).to be_within(5).of(7)
>>>>>>> ce/master
end
def create_job(name, status)
......
......@@ -51,15 +51,13 @@ describe 'Help Pages', feature: true do
it 'hides the version check image if the image request fails' do
# We use '--load-images=yes' with poltergeist so the image fails to load
expect(find('.js-version-status-badge', visible: false)).not_to be_visible
<<<<<<< HEAD
=======
end
end
describe 'when help page is customized' do
before do
allow_any_instance_of(ApplicationSetting).to receive(:help_page_hide_commercial_content?) { true }
allow_any_instance_of(ApplicationSetting).to receive(:help_page_text) { "My Custom Text" }
allow_any_instance_of(ApplicationSetting).to receive(:help_text) { "My Custom Text" }
allow_any_instance_of(ApplicationSetting).to receive(:help_page_support_url) { "http://example.com/help" }
login_as :user
......@@ -76,7 +74,6 @@ describe 'Help Pages', feature: true do
it 'should use a custom support url' do
expect(page).to have_link "See our website for getting help", href: "http://example.com/help"
>>>>>>> ce/master
end
end
end
......@@ -8,15 +8,12 @@ feature 'Protected Branches', feature: true, js: true do
before do
login_as(user)
<<<<<<< HEAD
=======
end
def set_protected_branch_name(branch_name)
find(".js-protected-branch-select").trigger('click')
find(".dropdown-input-field").set(branch_name)
click_on("Create wildcard #{branch_name}")
>>>>>>> ce/master
end
describe "explicit protected branches" do
......
......@@ -7,7 +7,6 @@ feature 'Projected Tags', feature: true, js: true do
before do
login_as(user)
end
<<<<<<< HEAD
def set_allowed_to(operation, option = 'Masters', form: '.new-protected-tag')
within form do
......@@ -19,8 +18,6 @@ feature 'Projected Tags', feature: true, js: true do
find(".js-allowed-to-#{operation}").click # needed to submit form in some cases
end
end
=======
>>>>>>> ce/master
def set_protected_tag_name(tag_name)
find(".js-protected-tag-select").click
......
......@@ -10,8 +10,6 @@ describe Gitlab::Database::MigrationHelpers, lib: true do
before do
allow(model).to receive(:puts)
end
<<<<<<< HEAD
=======
describe '#add_timestamps_with_timezone' do
before do
......@@ -45,7 +43,6 @@ describe Gitlab::Database::MigrationHelpers, lib: true do
end
end
end
>>>>>>> ce/master
describe '#add_concurrent_index' do
context 'outside a transaction' do
......
......@@ -356,12 +356,6 @@ describe Gitlab::GitAccess, lib: true do
end
describe '#check_push_access!' do
<<<<<<< HEAD
=======
before do
merge_into_protected_branch
end
>>>>>>> ce/master
let(:unprotected_branch) { 'unprotected_branch' }
before do
......@@ -522,11 +516,7 @@ describe Gitlab::GitAccess, lib: true do
[%w(feature exact), ['feat*', 'wildcard']].each do |protected_branch_name, protected_branch_type|
context do
before do
<<<<<<< HEAD
create(:protected_branch, :remove_default_access_levels, :masters_can_push, name: protected_branch_name, project: project)
=======
create(:protected_branch, name: protected_branch_name, project: project)
>>>>>>> ce/master
end
run_permission_checks(permissions_matrix)
......@@ -534,11 +524,7 @@ describe Gitlab::GitAccess, lib: true do
context "when developers are allowed to push into the #{protected_branch_type} protected branch" do
before do
<<<<<<< HEAD
create(:protected_branch, :remove_default_access_levels, :masters_can_push, :developers_can_push, name: protected_branch_name, project: project)
=======
create(:protected_branch, :developers_can_push, name: protected_branch_name, project: project)
>>>>>>> ce/master
end
run_permission_checks(permissions_matrix.deep_merge(developer: { push_protected_branch: true, push_all: true, merge_into_protected_branch: true }))
......@@ -546,11 +532,7 @@ describe Gitlab::GitAccess, lib: true do
context "developers are allowed to merge into the #{protected_branch_type} protected branch" do
before do
<<<<<<< HEAD
create(:protected_branch, :remove_default_access_levels, :masters_can_push, :developers_can_merge, name: protected_branch_name, project: project)
=======
create(:protected_branch, :developers_can_merge, name: protected_branch_name, project: project)
>>>>>>> ce/master
end
context "when a merge request exists for the given source/target branch" do
......@@ -579,11 +561,7 @@ describe Gitlab::GitAccess, lib: true do
context "when developers are allowed to push and merge into the #{protected_branch_type} protected branch" do
before do
<<<<<<< HEAD
create(:protected_branch, :remove_default_access_levels, :masters_can_push, :developers_can_merge, :developers_can_push, name: protected_branch_name, project: project)
=======
create(:protected_branch, :developers_can_merge, :developers_can_push, name: protected_branch_name, project: project)
>>>>>>> ce/master
end
run_permission_checks(permissions_matrix.deep_merge(developer: { push_protected_branch: true, push_all: true, merge_into_protected_branch: true }))
......@@ -686,11 +664,7 @@ describe Gitlab::GitAccess, lib: true do
context "when no one is allowed to push to the #{protected_branch_name} protected branch" do
before do
<<<<<<< HEAD
create(:protected_branch, :remove_default_access_levels, :no_one_can_push, name: protected_branch_name, project: project)
=======
create(:protected_branch, :no_one_can_push, name: protected_branch_name, project: project)
>>>>>>> ce/master
end
run_permission_checks(permissions_matrix.deep_merge(developer: { push_protected_branch: false, push_all: false, merge_into_protected_branch: false },
......
......@@ -40,13 +40,8 @@ describe Gitlab::Kubernetes do
describe '#filter_by_label' do
it 'returns matching labels' do
<<<<<<< HEAD
matching_items = [kube_pod(app: 'foo'), kube_deployment(app: 'foo')]
items = matching_items + [kube_pod, kube_deployment]
=======
matching_items = [kube_pod(app: 'foo')]
items = matching_items + [kube_pod]
>>>>>>> ce/master
expect(filter_by_label(items, app: 'foo')).to eq(matching_items)
end
......
......@@ -31,33 +31,21 @@ describe Gitlab::Saml::User, lib: true do
allow(Gitlab::Saml::Config).to receive_messages({ options: { name: 'saml', groups_attribute: 'groups', external_groups: groups, args: {} } })
end
<<<<<<< HEAD
def stub_saml_admin_group_config(groups)
allow(Gitlab::Saml::Config).to receive_messages({ options: { name: 'saml', groups_attribute: 'groups', admin_groups: groups, args: {} } })
end
=======
>>>>>>> ce/master
before do
stub_basic_saml_config
end
describe 'account exists on server' do
<<<<<<< HEAD
let!(:existing_user) { create(:user, email: 'john@mail.com', username: 'john') }
before do
stub_omniauth_config({ allow_single_sign_on: ['saml'], auto_link_saml_user: true })
end
=======
before do
stub_omniauth_config({ allow_single_sign_on: ['saml'], auto_link_saml_user: true })
end
let!(:existing_user) { create(:user, email: 'john@mail.com', username: 'john') }
>>>>>>> ce/master
context 'and should bind with SAML' do
it 'adds the SAML identity to the existing user' do
saml_user.save
......
......@@ -129,11 +129,7 @@ describe KubernetesService, models: true, caching: true do
it "returns the default namespace" do
is_expected.to eq(service.send(:default_namespace))
end
<<<<<<< HEAD
=======
>>>>>>> ce/master
context 'when namespace is specified' do
before do
service.namespace = 'my-namespace'
......@@ -314,7 +310,6 @@ describe KubernetesService, models: true, caching: true do
it { is_expected.to be_nil }
end
<<<<<<< HEAD
context 'when kubernetes responds with valid pods and deployments' do
before do
stub_kubeclient_pods
......@@ -322,23 +317,12 @@ describe KubernetesService, models: true, caching: true do
end
it { is_expected.to eq(pods: [kube_pod], deployments: [kube_deployment]) }
=======
context 'when kubernetes responds with valid pods' do
before do
stub_kubeclient_pods
end
it { is_expected.to eq(pods: [kube_pod]) }
>>>>>>> ce/master
end
context 'when kubernetes responds with 500s' do
before do
stub_kubeclient_pods(status: 500)
<<<<<<< HEAD
stub_kubeclient_deployments(status: 500)
=======
>>>>>>> ce/master
end
it { expect { subject }.to raise_error(KubeException) }
......@@ -347,10 +331,7 @@ describe KubernetesService, models: true, caching: true do
context 'when kubernetes responds with 404s' do
before do
stub_kubeclient_pods(status: 404)
<<<<<<< HEAD
stub_kubeclient_deployments(status: 404)
=======
>>>>>>> ce/master
end
it { is_expected.to eq(pods: [], deployments: []) }
......
......@@ -148,7 +148,6 @@ describe ProjectSnippetPolicy, models: true do
before do
project.team << [external_user, :developer]
end
<<<<<<< HEAD
it do
is_expected.to include(:read_project_snippet)
......@@ -159,8 +158,6 @@ describe ProjectSnippetPolicy, models: true do
context 'auditor user' do
let(:current_user) { create(:user, :auditor) }
subject { abilities(current_user, :private) }
=======
>>>>>>> ce/master
it do
is_expected.to include(:read_project_snippet)
......
......@@ -11,11 +11,7 @@ describe API::Jobs, :api do
ref: project.default_branch)
end
<<<<<<< HEAD
let(:build) { create(:ci_build, pipeline: pipeline) }
=======
let!(:job) { create(:ci_build, pipeline: pipeline) }
>>>>>>> ce/master
let(:user) { create(:user) }
let(:api_user) { user }
......@@ -30,7 +26,6 @@ describe API::Jobs, :api do
let(:query) { Hash.new }
before do
build
get api("/projects/#{project.id}/jobs", api_user), query
end
......@@ -94,7 +89,6 @@ describe API::Jobs, :api do
let(:query) { Hash.new }
before do
build
get api("/projects/#{project.id}/pipelines/#{pipeline.id}/jobs", api_user), query
end
......@@ -196,21 +190,13 @@ describe API::Jobs, :api do
describe 'GET /projects/:id/jobs/:job_id/artifacts' do
before do
<<<<<<< HEAD
stub_artifacts_object_storage
get api("/projects/#{project.id}/jobs/#{build.id}/artifacts", api_user)
end
context 'job with artifacts' do
context 'when artifacts are stored locally' do
let(:build) { create(:ci_build, :artifacts, pipeline: pipeline) }
=======
get api("/projects/#{project.id}/jobs/#{job.id}/artifacts", api_user)
end
context 'job with artifacts' do
let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) }
>>>>>>> ce/master
context 'when artifacts are stored locally' do
let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) }
context 'authorized user' do
let(:download_headers) do
......@@ -221,28 +207,21 @@ describe API::Jobs, :api do
it 'returns specific job artifacts' do
expect(response).to have_http_status(200)
expect(response.headers).to include(download_headers)
expect(response.body).to match_file(build.artifacts_file.file.file)
expect(response.body).to match_file(job.artifacts_file.file.file)
end
end
<<<<<<< HEAD
context 'unauthorized user' do
let(:api_user) { nil }
it 'does not return specific job artifacts' do
expect(response).to have_http_status(401)
end
=======
it 'returns specific job artifacts' do
expect(response).to have_http_status(200)
expect(response.headers).to include(download_headers)
expect(response.body).to match_file(job.artifacts_file.file.file)
>>>>>>> ce/master
end
end
context 'when artifacts are stored remotely' do
let(:build) { create(:ci_build, :artifacts, :remote_store, pipeline: pipeline) }
let(:job) { create(:ci_build, :artifacts, :remote_store, pipeline: pipeline) }
it 'returns location redirect' do
expect(response).to have_http_status(302)
......@@ -255,17 +234,14 @@ describe API::Jobs, :api do
end
end
describe 'GET /projects/:id/artifacts/:ref_name/download?job=name' do
let(:api_user) { reporter }
let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) }
before do
<<<<<<< HEAD
stub_artifacts_object_storage
build.success
=======
job.success
>>>>>>> ce/master
end
def get_for_ref(ref = pipeline.ref, job_name = job.name)
......@@ -320,26 +296,19 @@ describe API::Jobs, :api do
context 'find proper job' do
shared_examples 'a valid file' do
<<<<<<< HEAD
context 'when artifacts are stored locally' do
let(:download_headers) do
{ 'Content-Transfer-Encoding' => 'binary',
'Content-Disposition' =>
"attachment; filename=#{build.artifacts_file.filename}" }
"attachment; filename=#{job.artifacts_file.filename}" }
end
it { expect(response).to have_http_status(200) }
it { expect(response.headers).to include(download_headers) }
=======
let(:download_headers) do
{ 'Content-Transfer-Encoding' => 'binary',
'Content-Disposition' =>
"attachment; filename=#{job.artifacts_file.filename}" }
>>>>>>> ce/master
end
context 'when artifacts are stored remotely' do
let(:build) { create(:ci_build, :artifacts, :remote_store, pipeline: pipeline) }
let(:job) { create(:ci_build, :artifacts, :remote_store, pipeline: pipeline) }
it 'returns location redirect' do
expect(response).to have_http_status(302)
......
......@@ -200,10 +200,6 @@ describe API::Runner do
let(:user_agent) { 'gitlab-runner 9.0.0 (9-0-stable; go1.7.4; linux/amd64)' }
before do
<<<<<<< HEAD
job
=======
>>>>>>> ce/master
stub_container_registry_config(enabled: false)
end
......@@ -818,10 +814,7 @@ describe API::Runner do
let(:file_upload2) { fixture_file_upload(Rails.root + 'spec/fixtures/dk.png', 'image/gif') }
before do
<<<<<<< HEAD
stub_artifacts_object_storage
=======
>>>>>>> ce/master
job.run!
end
......
......@@ -41,15 +41,10 @@ describe API::Settings, 'Settings' do
plantuml_url: 'http://plantuml.example.com',
default_snippet_visibility: 'internal',
restricted_visibility_levels: ['public'],
<<<<<<< HEAD
default_artifacts_expire_in: '2 days'
=======
default_artifacts_expire_in: '2 days',
help_page_text: 'custom help text',
help_page_hide_commercial_content: true,
help_page_support_url: 'http://example.com/help'
>>>>>>> ce/master
expect(response).to have_http_status(200)
expect(json_response['default_projects_limit']).to eq(3)
expect(json_response['signin_enabled']).to be_falsey
......
......@@ -470,10 +470,7 @@ describe Ci::API::Builds do
let(:headers_with_token) { headers.merge(Ci::API::Helpers::BUILD_TOKEN_HEADER => token) }
before do
<<<<<<< HEAD
stub_artifacts_object_storage
=======
>>>>>>> ce/master
build.run!
end
......
......@@ -2,10 +2,7 @@ require 'spec_helper'
require 'rubocop'
require 'rubocop/rspec/support'
<<<<<<< HEAD
require 'rubocop-rspec'
=======
>>>>>>> ce/master
require_relative '../../../../rubocop/cop/rspec/single_line_hook'
......
......@@ -110,11 +110,7 @@ describe PipelineSerializer do
it 'verifies number of queries', :request_store do
recorded = ActiveRecord::QueryRecorder.new { subject }
<<<<<<< HEAD
expect(recorded.count).to be_within(1).of(62)
=======
expect(recorded.count).to be_within(1).of(57)
>>>>>>> ce/master
expect(recorded.count).to be_within(1).of(61)
expect(recorded.cached_count).to eq(0)
end
......
......@@ -384,11 +384,7 @@ describe MergeRequests::UpdateService, services: true do
should_not_email(non_subscriber)
end
<<<<<<< HEAD
context 'when the merge request has the `label` label' do
=======
context 'when issue has the `label` label' do
>>>>>>> ce/master
before do
merge_request.labels << label
end
......
......@@ -18,20 +18,14 @@ describe ArtifactUploader do
describe '.artifacts_upload_path' do
subject { described_class.artifacts_upload_path }
<<<<<<< HEAD
it { is_expected.to start_with(local_path) }
=======
it { is_expected.to start_with(path) }
>>>>>>> ce/master
it { is_expected.to end_with('tmp/uploads/') }
end
describe '#store_dir' do
subject { uploader.store_dir }
<<<<<<< HEAD
let(:path) { "#{job.created_at.utc.strftime('%Y_%m')}/#{job.project_id}/#{job.id}" }
context 'when using local storage' do
......@@ -48,28 +42,19 @@ describe ArtifactUploader do
it { is_expected.to eq(path) }
end
=======
it { is_expected.to start_with(path) }
it { is_expected.to end_with("#{job.project_id}/#{job.id}") }
>>>>>>> ce/master
end
describe '#cache_dir' do
subject { uploader.cache_dir }
<<<<<<< HEAD
it { is_expected.to start_with(local_path) }
it { is_expected.to end_with('tmp/cache') }
=======
it { is_expected.to start_with(path) }
it { is_expected.to start_with(local_path) }
it { is_expected.to end_with('/tmp/cache') }
end
describe '#work_dir' do
subject { uploader.work_dir }
it { is_expected.to start_with(path) }
it { is_expected.to start_with(local_path) }
it { is_expected.to end_with('/tmp/work') }
end
......@@ -87,6 +72,5 @@ describe ArtifactUploader do
it { is_expected.not_to be_nil }
end
>>>>>>> ce/master
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment